diggy
Posts: 20
Joined: Fri Aug 19, 2011 9:52 pm
Contact: Website

Re: Turn Raspberry Pi into a P.L.C (Programable Logic Controller) Advanced

Wed Sep 07, 2011 10:30 am

...linux automatically sees it as a USB->Serial port....
I missed that part.

However, if performance is similar to a mainstream usb>serial converter I'm quite sure it won't do much.
I have programmed a simulated I2C working on a serial port (in windows) just fine. However when I try to connect to a serial port through a USB>serial the latency is so big that the slave devices (DS1621) miss the clock signal, thus the bus is not working.

Nevertheless it might be of usage to control IO not requiring a clock signal (eg push buttons, etc)
Another idea here is to make use of Contact closure on the serial IO. This effectively gives more than 10 on/off channels (with multiplexing)

vorrias
Posts: 65
Joined: Mon Aug 15, 2011 3:31 pm
Location: Greece
Contact: Skype

Re: Turn Raspberry Pi into a P.L.C (Programable Logic Controller) Advanced

Thu Sep 08, 2011 7:36 am

The nice thing gentlemen is, that we are thinking more or less on the same direction.
@diggy as you know PLCs are very very slow devices most of them having program cycle time some ms. (1ms program cycle is the fastest I know)
I remember back in 80s I made my own "PLC" based in Z80 CPU and program in assembler with cycle time some microseconds. No PLC even today come close to that (Only Bechkoff's with EtherCAT).
What I am saying is, this USB solution will have adequate speed for many non critical applications, like burglar alarms, and many home automation (that is a lot off applications).
To our project now YES R-Pi can work together with other R-Pis forming a high speed network controllers in a master slave model. To do that you need "real time" ethernet comunication between them, but not always as you can read farther. You can achieve that only with powerlink Ethernet winch is supported by the OPENPLC org (and with Beremiz I suppose) or with EtherCAT (a Beckhoff's open real time Ethernet) but you need a CODESYS environment (very good and open but you have to pay).
So for most applications that needs not very fast I/O, I2C bus can be adequate for I/O (Digital outputs/inputs analogue boards etc) attached locally to that bus. Best will be ta have a CAN bus on R-Pi but may be in the future they put a CAN master on board. That will be nice for Automobil applications as automotive controllers are using CAN bus as a FieldBus.
Speed on this (I2C) bus is about 400KHZ to 1M . This is the speed of the old DeviceNet bus and half of the CAN bus speed. This is good for most apps.
Now for critical high speed apps like servo-controller, high speed encoder and high speed analog conversion input/output forget this kind of bus(10KHZ encoder input may fit on I2C bus speed limitations though).Les us think a bit different model.
One R-Pi will be dedicated to become a positioning controller. Axis in like encoders and outputs will attached directly to R-Pi I/O s. Think it as a “back box” that gets command and reports what happened back to to master.
So from the master R-Pi you can "order" the slave R-Pi "GO TO POSITION 3000" . So the slave device will go there and will inform the maste that "THE JOB DONE". I think you got the idea. The same model are using many modern positioning makers (one of the best is http://www.galilmc.com DMC-40x0 Series) . This communication it is not critical. Real time here is not needed. The slave will have the responsibility to do the job done. If errors accruing slave positioning controller mast take actions immediately. Not waiting “what to do” from master. Master willmonitor “OK” or “ERROR”command from slave to issue other commands if necessary and so on.
But real time Ethernet will be needed in some cases as I stated in the beginning of this thread:
be able to communicate real time via Ethernet port to other remote Pi PLCs in a master/slave scenario.
Think having a kit like that and teach technical students the Motion Control!! having state of art hardware like this powerful “little thing” running latest technology in OPENPLC libraries!. This is a dream now for every automation student. The cost for a lab to setup this equipment is very high! Then when he became an engineer he will be able to use one R-Pi board to do the job!.
Ok I have many things in my mind (like using it with my next project THE ELECTRIC CAR) and I thing it is a good time to prepare the first white paper for R-Pi PLC. In the process we will add more info.
Yes @diggy one R-Pi can be used as HMI controller *Beremize has the software ready for that)! So forgive me but the keyword to finish this project FAST is Beremiz. AND YES! I have good news.
Yesterday I asked Edouard from Beremiz, if we can have a PLC module without any OS on it and the answer was:
"With OS" or "without OS" options are both possible with Beremiz, but
in case of no OS, features like dynamic program loading and serial or
USB or IP communication for control and debug will have to be fulfilled
in order to make the PLC usable.
Having real time with Linux is also possible today with rt-preempt
patches or Xenomai. So, if you already have Linux running, maybe is
that easier to use Linux drivers, and just use python runtime +
Xenomai ?*
Everybody likes it ? So Try to download Beremiz to see what I am talking about and in the meantime to see how to pack everything in the project. At the end may be easier than it looked in the beginning.
@charly130.-mk2 said if we need drivers we can easily build them.
@diggy I will be glad to help you rebuilding your factory automation with R-Pi PLC
Ok gentlemen lets go to work! It looks that R-Pi PLC can be realized after all!

diggy
Posts: 20
Joined: Fri Aug 19, 2011 9:52 pm
Contact: Website

Re: Turn Raspberry Pi into a P.L.C (Programable Logic Controller) Advanced

Fri Sep 09, 2011 7:42 am

I think we should create a Wiki somewhere for the Rpi PLC project to gather all information.

ErvKosch
Posts: 82
Joined: Thu Sep 01, 2011 3:40 pm

Re: Turn Raspberry Pi into a P.L.C (Programable Logic Controller) Advanced

Fri Sep 09, 2011 12:18 pm

Done: http://rpiplc.wikispaces.com/

Right now I have it open to everyone. If I start getting wiki-spam I'll have to make it members only. [Edit] The editing of pages that is. Anyone can read the site.

nrdb
Posts: 13
Joined: Fri Jul 29, 2011 5:35 am

Re: Turn Raspberry Pi into a P.L.C (Programable Logic Controller) Advanced

Fri Sep 09, 2011 6:53 pm

There is a lot of talk about communication speeds here. I am no expert in PLCs but I did once create a Ethernet computer network system from the ground up, both hardware and software. So here is my 2 cents worth.

As the ARM processor is running at a low voltage and any GPIO signals wont be able to exceed this voltage, an interface board will be needed (probably with op-isolators on it).

As you aren't going to be able to connect a Rpi directly to industrial machinery, some sort of interface board is going to be needed. So to cope with fast signal, you incorporate a pulse stretcher into it to make sure that any short pulse is accepted. If the pulses are occurring to fast, use another board with a counter on it.

As for communication, Ethernet (not tcp or ip) is very fast, using the Ethernet directly you can get almost 100MB/s transfer. That means that a 100 byte command to something will take about 1us to arrive. The only problem is that a handshake protocol is needed, as the Ethernet protocol is unreliable.

For my money I would use smart USB 2.0 devices. You get a 480Mbps channel, coupled with a cheap micro you could do almost anything. You could attach a lot of devices to your Rpi, you want to control a servo, fine, send a command to a micro to do what you want, is sends a reply when its done.

For a cheaper alternative you could use high speed RS-485 with a max 35Mb/s speed. Connect this to a PIC or AVR micro (a cheap atmega8 can do >250Kb/s), and you have a good system. For more expansion you can use a USB to serial converter, the FTDI USB to serial converter has a maximum speed of between 1Mbaud and 3Mbuad.

Basically use Rpi boards for the brains, use peripheral boards with PIC or AVR micros on them for all the signal and control functions. For big systems link several Rpi boards together with Ethernet.

I think this is obvious but when the Rpi is running as the PLC it should be running a very much stripped down Linux. With minimum drivers, no TCP/IP stack, no GUI. After all reliability is the most important thing, you don't want a bug in some unrelated service crashing your computer and therefore stopping the PLC software.

P.S. dont forget not to allow the internet anywhere near them, remember Stuxnet.

vorrias
Posts: 65
Joined: Mon Aug 15, 2011 3:31 pm
Location: Greece
Contact: Skype

Re: Turn Raspberry Pi into a P.L.C (Programable Logic Controller) Advanced

Sun Sep 11, 2011 5:25 pm

@nrdb state it here very clearly almost everything.
Connect this to a PIC or AVR micro (a cheap atmega8 can do >250Kb/s), and you have a good system
This is one solution to the problem so far. R-Pi as it is has limited possibilities of using its GPIO signals. We definitely need an interface board.
So it is better to use it as a "brain" and use one of the communication ports as a field bus to connect to any interface board with PIC or Atmel micro controller that gives us all the in/out power we need.
Now the question is which field bus is better to use or we are capable to run in R. And I am talking not just write our own control program in C or C++. This is too time consuming and this is not the purpose of this thread.
Our goal must is to make a full scale PLC as I stated in my first post "Be capable of running Programming language defined by the IEC-61131-3 standard."
That means we must be capable in running a PLC program in the four formats defined by IEC-61131-3 standards.
So we need an editor that will translate all the program into ARM C lang. That means a lot of libraries. The only open source program I found so far is Beremiz and its last update was in June. If anybody else knows something better, ok lets listen to him.
So coming back to what field bus we have to use, I had an interesting talk with Eduard from Beremiz team.
He told me that If we go with 3rd party field bus devices to do IO's then we will come up with an expensive solution, R-PI should have its own IO module(s).At the moment this is a problem. May be in a feature design it will have more I/O .
Mys opinion is yes and no (how expensive can be an interface board with Ethernet or I2C) because we can easily and cheeply build varius I/O boards with a PIC or Atmel controller.
If we had CAN bus things could be easier (Beremiz supports CAN through CANFestival). May be I2C is a solution but libraries must be written in Beremiz as far as I Know.
And above all we need real time solution. We need an industrial strength field bus.
But now it seams the only port we can use in a R-Pi board as an industrial strenght field bus is Ethernet. Ethernet is the next industrial standard field bus. And yes it looks that this is going to be our solution. Ehernet is not a real time bus. So we need real time Ethernet for controllers. These are Powerlink and EtherCAT (made by Bechkoff) . Both are open and free.
So Eduard told me that It will be possible as he will implement EtherCat support with a plug in binding the EtherLab project to Beremiz (matter of months). PowerLink will also be supported soon, through community contributions.. So may be it is our solution and @nrdb with his knowledge in Ethernet will help us a lot.
Onother R-Pi can be conectet through Ethernet to act as an HMI controller. HMI softeare is already included in beremiz.
I have many more to say but I will continue in the next post.
I am not familiar with the wiki page . Is this the wikipedia? Anyway I thing it is a good idea to upload there some white pages when I am ready.
If anyone program any PLC in the past please have a look at Beremiz. It is a fantastic project. It is open and we can help to make it better. A lot off work is putted to this project and we can use it free.
Your opinion counts.

charly130.mk2
Posts: 10
Joined: Tue Sep 06, 2011 7:05 am

Re: Turn Raspberry Pi into a P.L.C (Programable Logic Controller) Advanced

Mon Sep 12, 2011 8:04 am

@diggy

OK I managed to find some info on the UBW's big brother, the UBW32 (which has a lot more horsepower). It can handle some 12k commands per second (actual measurement, not theoretical, http://www.sparkfun.com/products/8971). How does that compare with more mainstream real-time cards? Also, bear in mind that this appears to be the default firmware... If you write your own, apparently it can switch pins on/off or read them at some 40MHz... Which I assume this would be better for real-time anyway, as you'd want to strip the firmware down to the bare essential to do what you want it to do, as opposed to having a huge firmware wasting cycles...

vorrias
Posts: 65
Joined: Mon Aug 15, 2011 3:31 pm
Location: Greece
Contact: Skype

Re: Turn Raspberry Pi into a P.L.C (Programable Logic Controller) Advanced

Mon Sep 12, 2011 11:48 am

@charly130.-mk2, this is very interesting litle board. Another solution are two interesting boards using PIC32. We can connect them directly to R-Pi Ethernet and use theem as inteligent I/O controllers. There are powerful boards and cheep.
http://www.digilentinc.com/Pro.....PKIT-UNO32
http://www.digilentinc.com/Pro.....PKIT-MAX32
R-Pi will have all the main PLC program (and HMI if we like in non critical apps) and send / receive comands into these boards in real time if we use EtherCAT or Powerlink comunication..

Jason
Posts: 9
Joined: Sun Sep 11, 2011 9:48 am
Contact: Website

Re: Turn Raspberry Pi into a P.L.C (Programable Logic Controller) Advanced

Mon Sep 12, 2011 1:00 pm

Quote from vorrias on September 11, 2011, 18:25
So coming back to what field bus we have to use, I had an interesting talk with Eduard from Beremiz team.
He told me that If we go with 3rd party field bus devices to do IO's then we will come up with an expensive solution, R-PI should have its own IO module(s).


I'd personally go for ModBUS. Lots of code to implement ModBUS MASTER (or Slave). The protocol is pretty simple with a CRC 16 at the end of each packet.
ASCII format is supported, and it can run over TCP (so Ethernet) or RS232/RS485

For any serious industrial control, interfacing to existing systems is a normal requirement.

vorrias
Posts: 65
Joined: Mon Aug 15, 2011 3:31 pm
Location: Greece
Contact: Skype

Re: Turn Raspberry Pi into a P.L.C (Programable Logic Controller) Advanced

Mon Sep 12, 2011 2:00 pm

Yes @jason that is true. MODBUS TCP/IP is good . But this is not a real time Ethernet solution and this is not fast. As far as I know MODBUS TCP/IP speed is limited to about 114KBPS. That is why industry introduced Ethernet Powerlink master and EtherCAT master. Both are real time Ethernet solutions over the same Ethernet gear. Correct me If I am wrong.
Still we can give MODBUS TCP/IP a try because Powerlink and EtherCAT needs some months to finalise. But this will be the best solution. At the moment there are some ready I/O modules using EtherCAT from diferent ventors (not very expensive at all). We can use these boards for a realy profesional job or we can try to build our owns. It must be a similar solution with Ethernet Powerlink.
Try
http://www.ethercat.org/en/pro.....6BA289.htm
http://www.etherlab.org/en/ethercat/
http://www.ethernet-powerlink......x.php?id=9

charly130.mk2
Posts: 10
Joined: Tue Sep 06, 2011 7:05 am

Re: Turn Raspberry Pi into a P.L.C (Programable Logic Controller) Advanced

Tue Sep 13, 2011 6:46 am

@ vorrias

Interesting boards... The MAX is a bit more expensive, but as you have mentioned, it has Ethernet and the PIC has more RAM/Flash (in fact the same part as the UBW32). The UNO on the other hard doesn't but its price is better than the UBW32... Plus Arduino shields can be used, which is a definite plus...

User avatar
TonyD
Posts: 448
Joined: Thu Sep 08, 2011 10:58 am
Location: Newcastle, UK
Contact: Website

Re: Turn Raspberry Pi into a P.L.C (Programable Logic Controller) Advanced

Tue Sep 13, 2011 12:20 pm

One of the good thing about Modbus protocol is its been around awhile, so there are lots of Modbus software stacks/implemenations available, many of them free.

I did a small PLC design for the Adruino last year, so once I get my hands on a R-Pi (or just some I/O details) and I'll adapt the PLC design for it. I'll probably add CAN Bus to it through a SPI chip from Microchip.
Tony

vorrias
Posts: 65
Joined: Mon Aug 15, 2011 3:31 pm
Location: Greece
Contact: Skype

Re: Turn Raspberry Pi into a P.L.C (Programable Logic Controller) Advanced

Thu Sep 15, 2011 10:21 am

@TonyD I agree Modbus protocol is an old time standard. Ok. If you Lets see what is your suggestion if I clearly understand.
You propose to put Modbus support into R-Pi PLC like the PLC program you made for Adruino . What kind of PLC language can you write with Adruino PLC? (Function Block Diagram - FBD, Sequential Function Chart - SFC, Ladder Diagram - LD, Structured Text - ST, Instruction List - IL, or see http://www.beremiz.org/documen.....pen-editor), Can we see more about this PLC program?
You propose to put CAN bus through SPI chip from Microchip. You mean an interface board connected to some some R-Pi ports and gives us CAN master out? e.g. Ethernet to CAN bus? Then we need to write a driver for that and encapsulated into the R-Pi PLC program. Can you be more specific?

thepanoguy
Posts: 17
Joined: Mon Sep 12, 2011 1:59 pm

Re: Turn Raspberry Pi into a P.L.C (Programable Logic Controller) Advanced

Thu Sep 15, 2011 10:53 am

Guys,

I appreciate your enthusiasm; there are a few points to keep in mind when designing mains energised equipment.

In Australia; I would assume other countries would have similar regulations, any electronic equipment interfaced into mains operated equipment requires the services of a licensed electrician and the electrical authority certification before it energised and used for production purposes.

Whatever operating system or programming language is used to control the microprocessor is irrelevant; the critical control code is compiled in native machine language and burnt on a ROM. All electronic equipment interfaced to the mains equipment must default to a mains fail safe condition; therefore all electronic equipment must contain additional failsafe electronics and hardware interlocking defaulting to the mains failsafe position. Ie There has to be an additional independent electrically failsafe hardware circuit capable of de-energising a mains operated contactor.

There is no way that the electrical authorities would permit any unauthorised controlling of the machinery; therefore the critical parts of the PLC control can be remotely monitored but never altered or bypass the ROM programming parameters.

vorrias
Posts: 65
Joined: Mon Aug 15, 2011 3:31 pm
Location: Greece
Contact: Skype

Re: Turn Raspberry Pi into a P.L.C (Programable Logic Controller) Advanced

Thu Sep 15, 2011 11:17 am

@thepanoguy at the moment we are not talking to produce a commercial product.
First of all we are examining what option we have to produce a professional PLC.
If I understand your point, I do not see why electrical authorities will have anything to do with the controller. The only connection with the electric power company is PLC's AC or DC internal power supply. Even if everything goes well with the firmware I can still damage the controllable equipment by writing bad controller program written in one of the PLC (FBD, SFC, LD, ST, IL). Any state of art PLC can make a lot of damage running the wrong program. On the firmware side to be safe in case of PLC malfunction (not wrong program) the only thing you can to is a watchdog circuit. This is included in every PLC design (But hardly used)

vorrias
Posts: 65
Joined: Mon Aug 15, 2011 3:31 pm
Location: Greece
Contact: Skype

Re: Turn Raspberry Pi into a P.L.C (Programable Logic Controller) Advanced

Thu Sep 15, 2011 12:09 pm

So back to our design.
If we want R-Pi to become a professional PLC must have some specifications.
At a Glance
1 - Capable to run industrial editor software for FBD, SFC, LD, ST, IL languages
2 - Capable to convert these programs to C so ARM17 can understand
3 - capable of interfacing to industrial field buses (All or part of them)
Interface to OpenCAN.
Interface to Modbus TCP/IP or Modbus serial.
Interface to Ethernet Powerlink (This is real time Ethernet)
Interface to EtherCAT (This is real time Ethernet)
4 - Capable of running an HMI program for User to PLC interface.
5 - Specific drivers must be written.
Of course another type of "PLC" can be written to control the outside world direct from C. But this is not the design I am talking about. (This can be another tread) Still any experience with similar projects will be a grate help like this Adruino PLC written by @TonyD. Getting the professional approach we have two options.
One option is interface R-Pi with ready commercial I/O (digital, analogue. encoder input) supporting these field buses and another option is to build our own I/O boards supporting these field buses. And yes one option is to interface directly from R-Pi GIOP, but this will have limited I/O power. (for simple designs may be that will be a solution). But the PLC program will remain the same. Only some I/O tables the designer mast change.
If we are sure what we are looking for we will find and build it.
Rule one! IF SOMEBODY MADE A HARDWARE OR SOFTWARE MODULE BEFORE AND IT IS FITTED TO OUR GOAL WE MUST USE IT AS IT IS (OR PART OF IT).
Otherwise we can talk for months and years with zero result. We have to decide after good consideration if we can build it or not (part or all of it).
I am open to suggestions gentlemen. Come on we have a lot of brain out there!

thepanoguy
Posts: 17
Joined: Mon Sep 12, 2011 1:59 pm

Re: Turn Raspberry Pi into a P.L.C (Programable Logic Controller) Advanced

Thu Sep 15, 2011 2:36 pm

References:
http://www.answers.com/topic/p.....controller
http://en.wikipedia.org/wiki/P.....controller
http://en.wikipedia.org/wiki/IEC_61131-3
http://www.rtaautomation.com/iec61131-3/
http://en.wikipedia.org/wiki/ISO_9000
http://www.qmsuk.com/
http://www.plcmanual.com/isoosi-model

PLC - A programmable Logic Controller by definition is a programmable microprocessor-based device that is used in discrete manufacturing to control assembly lines and machinery on the shop floor as well as many other types of mechanical, electrical and electronic equipment in a plant. Typically RISC based and programmed in an IEC 61131 programming language, a PLC is designed for real-time use in rugged, industrial environments. Connected to sensors and actuators, PLCs are categorized by the number and type of I/O ports they provide and by their I/O scan rate.

IEC 61131-3 by definition is a method of externally programming a PLC to carry out a particular task. The IEC 61131-3 program is stored in the battery backed up or non-volatile memory section of the PLC. The IEC 61131-3 program does not override the PLC microprocessor programming or the PLC’s electrical interlocking safety features. The safety features of the PLC are factory burned into a non accessible ROM and cannot be overridden by the IEC 61131-3 programming.

By industry definition if the product has not achieved ISO 9000 certification, the device is not a certified PLC device.

Svartalf
Posts: 596
Joined: Fri Jul 29, 2011 6:50 pm

Re: Turn Raspberry Pi into a P.L.C (Programable Logic Controller) Advanced

Thu Sep 15, 2011 4:48 pm

Quote from thepanoguy on September 15, 2011, 15:36
By industry definition if the product has not achieved ISO 9000 certification, the device is not a certified PLC device.

ISO-9000? That's a process and procedures spec for the vendor...not for a device.

diggy
Posts: 20
Joined: Fri Aug 19, 2011 9:52 pm
Contact: Website

Re: Turn Raspberry Pi into a P.L.C (Programable Logic Controller) Advanced

Thu Sep 15, 2011 7:17 pm

ISO-9000? That's a process and procedures spec for the vendor...not for a device.
Yeap +1 for that. It has nothing to do with products, only the process of making them.
All in all as said above, we are NOT going to be making a commercially available PLC, rather than a professional grade (kind of DIY) PLC abiding by the international standards used for PLCs' programing, control, connection, interaction and interoperability.

thepanoguy
Posts: 17
Joined: Mon Sep 12, 2011 1:59 pm

Re: Turn Raspberry Pi into a P.L.C (Programable Logic Controller) Advanced

Fri Sep 16, 2011 5:34 am

“All in all as said above, we are NOT going to be making a commercially available PLC, rather than a professional grade (kind of DIY) PLC abiding by the international standards used for PLCs' programing, control, connection, interaction and interoperability.”

Where is your business plan?

Who is your target market?

Where are the electrical and electronic specifications for your product?

Who is financing the design, manufacturing and sales?

ISO-9000 is a procedural specification.

ISO 9001:2000 specifies requirements for a quality management system where an organization needs to demonstrate its ability to consistently provide product that meets customer and applicable regulatory requirements, and aims to enhance customer satisfaction through the effective application of the system, including processes for continual improvement of the system and the assurance of conformity to customer and applicable regulatory requirements.

All requirements of this International Standard are generic and are intended to be applicable to all organizations, regardless of type, size and product provided.

Where any requirement(s) of this International Standard cannot be applied due to the nature of an organization and its product, this can be considered for exclusion.

Where exclusions are made, claims of conformity to this International Standard are not acceptable unless these exclusions are limited to requirements within clause 7, and such exclusions do not affect the organization's ability, or responsibility, to provide product that meets customer and applicable regulatory requirements.

The Raspberry Pi is a consumer grade electronics device.

PLC’s are manufactured from certified industrial grade electronic components and destructive tested in a certified ISO-9001:2000 laboratory.

Once they pass the testing they are given an electrical compliance certification number.

No electrical engineering industry will purchase PLC equipment or services from anyone who is not ISO-9000 certified or fails to produce the relevant ISO 9001:2000 product certification number.

Therefore; if you cannot achieve ISO-9000 and ISO 9001:2000 compliance, that leaves you competing with established companies selling into the hobby market.

vorrias
Posts: 65
Joined: Mon Aug 15, 2011 3:31 pm
Location: Greece
Contact: Skype

Re: Turn Raspberry Pi into a P.L.C (Programable Logic Controller) Advanced

Fri Sep 16, 2011 5:42 am

Ok everybody seams to have right. @thepanoguy yes a commercial PLC has all the safety burned in its ROM as you pointed out. I do not think all PLC vectors have ISO900 but this is irrelevant. As @diggy said we are NOT going to be making a commercially available PLC, rather than a professional grade (kind of DIY) PLC abiding by the international standards used for PLCs' programming, control, connection, interaction and interoperability.
This is true. We want DIY PLC. We will learn a lot and we will have a professional PLC to work with. Our intention is NOT to sell it competing with Siemens or other vendors.
OM as you pointed out. I do not think all PLC ventors have ISO900 but this is irelevant. @diggy will use this into his family business. Many will come and try this solution. R-Pi has the ability to be an HMI controller and a PLC controller at the same time. The savings can be enormous. Not to mention the satisfaction of building the thing and the ability so many technical people to have "hands on" in the PLC and automation sector. It looks like PLC for everybody. a "Volkswagen" PLC. Think who many things we all have to learn trying to implement this project. Like all the things you said us @thepanoguy. I am sure lots are coming.
Having a conversation with Eduard from Beremiz team I realised that automation engineers are stick with the big companies and they do not want to move to something else. It is the time this to change. Lets share our knowledge to "open" thins "close" club in automation. Innovations like R-Pi, PIC and Atmel (and more) micro controllers will help us to increase our Knowledge and make younger people to involve with this instead of building games.

vorrias
Posts: 65
Joined: Mon Aug 15, 2011 3:31 pm
Location: Greece
Contact: Skype

Re: Turn Raspberry Pi into a P.L.C (Programable Logic Controller) Advanced

Fri Sep 16, 2011 5:47 am

@thepanoguy when I am posting you are posting too. I will give you my answer later this afternoon I am buzzy right now finishing a project in my work. Some of them answered already Thanks..

vorrias
Posts: 65
Joined: Mon Aug 15, 2011 3:31 pm
Location: Greece
Contact: Skype

Re: Turn Raspberry Pi into a P.L.C (Programable Logic Controller) Advanced

Fri Sep 16, 2011 6:09 am

But I can put a quick answer here.
Where is your business plan?
We do not have a business plan because THIS IS NOT GOING TO BE A COMMERCIAL product. Being a Hitachi PLC programmer most of the time and a micro controller builder back in Z80 CPU days my intention was to be able to do with R-Pi all the things a commercial PLC can do and sometimes better because I do not have commercial rules so I do not care about industrial grade product. The controllers I build back in 1982 with Z80 are still working and people made a lot of money having this controller in the machines we use to build that time. (It proved without any ISO to be a robust product)
Who is your target market?
Automation learning community, hobby, anyone that love D.I.Y, engineers that like to apply the product encapsulating it with some other custom made designs.
Where are the electrical and electronic specifications for your product?
Some are already posted in my first post
First thinks first. Pi P.L.C must have at least these 4 goals:
1 - Be capable of running Programming language defined by the IEC-61131-3 standard.
2 - be able to communicate real time via Ethernet port to other remote Pi PLCs in a master/slave scenario.
3 - Be able to attach many I/O locally (reed relay, FET transistor out, triac, encoder input) . One idea to use cheep interface boards connected to I2C bus. The encoder input is necessary for positioning system and robotics.
4 - The system must run on a version of real time lynux if we want to capture events on a millisecond or less. Of course a Debian distro is OK if you do not want to be real time.
Some more will follow
Who is financing the design, manufacturing and sales?
Nobody. We are financing it from our own free time.
But we have already grate products like Beremiz (www.beremiz.org) that we can use. More to come.

nrdb
Posts: 13
Joined: Fri Jul 29, 2011 5:35 am

Re: Turn Raspberry Pi into a P.L.C (Programable Logic Controller) Advanced

Mon Sep 19, 2011 2:18 am

You could also use this as a teaching environment for basic electronics.

Have some simple i2c or multi-drop rs232 cards for doing various things.
* open-collector outputs for relays, small motors, lights etc.
* r/c servo motor controllers for moving things
* opto-isolated inputs for switches etc.
* temperature input board (e.g. using the DS18S20)
You should be able to connect in excess of 100 cards to a single Rpi.

Interface these into a /proc or /sys file system so a simply read/write to a file will control them. Then all sorts of programming/scripting languages can be used. It should be easy to get the response time well below a 10th of a second.

And maybe a webapp (for remote progamming) that has an easily understood programming interface like ladder logic (http://en.wikipedia.org/wiki/L.....dder_logic) and you would have a great teaching tool that could also operate as a simple PLC as long as fast responses where not needed.

@vorrias
I don't think a real time OS is needed. As millisecond timing for most jobs is just not going to be needed. You want to use an encoder, connect it to a dedicated micro via i2c.

How often do you really need very fast responses? You aren't likely to control a multi-thousand dollar robot with a sub $100 dollar PLC are you.

I think you could make a full fledged PLC out of the Rpi, but to do so would add a lot of complexity. That probably wouldn't get much use as commercial/industrial people wouldn't trust it to reliably control there million dollar manufacturing plants.

vorrias
Posts: 65
Joined: Mon Aug 15, 2011 3:31 pm
Location: Greece
Contact: Skype

Re: Turn Raspberry Pi into a P.L.C (Programable Logic Controller) Advanced

Tue Sep 20, 2011 11:19 am

@nrdb I agree almost with the majority of all you said. True most applications do not need a RTOS. The thing is that with R-Pi we can have both scenarios (an RTOS and a none RTOS solution ) as found out from a research I made. And still costs almost nothing.
OK you may not want to control a multi thousand dollar application with a 100$ PLC but still if you can do it (AND YOU CAN) there are many people that can use it (learning community too, real hobby professionals, DIY, and more).
In this url
http://www.mail-archive.com/ca.....00565.html
you can see how CAN and (RT)SocketCan linux solution is implemented. Clever staff.
So using R-Pi and Beremiz you can have CAN bus and soon EtherCAT bus (real time Ethernet) in you fingertips. And the whole procedure of implementing all this is exiting. We are not going to invent things other people did. The purpose of this thread is to examine the possibility of making R-Pi a real professional PLC (in fact better than many PLCs in the market). This nice Slovenian company http://www.smarteh.si/en has build an industrial grade PLC using Beremiz. It is cheep and high quality.
Then I can not see why is impossible to have an industrial grade R-Pi some time in the feature.
My aim is when we collect all the necessary info and after a good discussion with everyone interested will make up a team and start the project.
In another part of this forum a lot of discussion takes place about making I/O cards for R-Pi. This is grate for R-Pi PLC project.
Like we say in Greece "it is not the destination that matters, but the long journey up to the destination". I am saying is that at the end of this project a lot of things will be learned in the process.

Return to “Other projects”