jstokes5
Posts: 14
Joined: Wed Mar 27, 2013 2:30 am

Re: Turn Raspberry Pi into a P.L.C (Programable Logic Contro

Wed May 22, 2013 6:24 am

Hmmmm.

All we have to do is edumacate the electricians. :P

rm1170
Posts: 3
Joined: Mon May 27, 2013 2:12 pm

Re: Turn Raspberry Pi into a P.L.C (Programable Logic Contro

Mon May 27, 2013 3:11 pm

As an electrician, I felt compelled to reply.

The use of ladder logic is not a function of lack of education as much as it is an effort to streamline troubleshooting. It requires the same skill set already used in other areas of the systems we describe here. Ladder diagrams are used for wiring diagrams in modern relay controls (think e-stop, interlock, etc). They are also often used in mcc wiring diagrams.

As for productivity, once a programmer has written the program, the electrician will commission the project and maintain the equipment for 10 to 20 years, in my experience. This is where the manpower and opportunity cost of downtime really are found. A poorly designed / implemented control system can cost more than the initial install. This is overlooked by many integrators and designers.

Ladder diagrams are very useful and efficient in the troubleshooting process. Since we already recognize these from the rest of our work, it is a short putt to troubleshoot the program. Going on-line with the PLC speeds the process further and the ladder diagnostic tools are awesome. If you "black box" me with a proprietary, locked, or otherwise "clever" control system, you inhibit or prevent me from getting production back on-line.

Finally, let's not forget the best stumpers tend to pop up about an hour after I get into bed and result in me being at work troubleshooting with about an hour of sleep. Simple is better when I am tired. Downtime = $

This is how an electrician sees it.

rm1170
Posts: 3
Joined: Mon May 27, 2013 2:12 pm

Re: Turn Raspberry Pi into a P.L.C (Programable Logic Contro

Mon May 27, 2013 4:21 pm

Now don't get me wrong, as a developer of both platforms I hate those expensive 25k RAM (!) PLCs and all the visual programming nonsense that comes with it, but it's really still the only viable option if you need RELIABILITY.

So, the real question then is what would it take to build a PI with the same level of reliability as a PLC?
We walk before we run. If we limit ourselves to being perfect out of the gate, we will never get out of the gate.

The rpi-plc project is about vision of what could be. What if it had stackable modular i/o boards. They could communicate on can bus, be externally powered, stack indefinitely like arduino shields, and start in the $15 range. What if it had internal webserver using html pages as hmi and programmer for rpi-plc. We could use wifi dongle for accessability with any pc or smart phone.

Even with security and reliability limitations, there will be appropriate applications. (small business, hvac, home automation, etc) You would have a functional plc, hmi, software and means of programming for $50.

AB, Siemens, and the rest will notice. I guarantee it.

jstokes5
Posts: 14
Joined: Wed Mar 27, 2013 2:30 am

Re: Turn Raspberry Pi into a P.L.C (Programable Logic Contro

Mon May 27, 2013 9:43 pm

Sorry if I offended rm. I was joking. I'm an electrician myself.

rm1170
Posts: 3
Joined: Mon May 27, 2013 2:12 pm

Re: Turn Raspberry Pi into a P.L.C (Programable Logic Contro

Tue May 28, 2013 2:55 am

jstokes5 wrote:Sorry if I offended rm. I was joking. I'm an electrician myself.
Not at all. It is just a different perspective.

I am fascinated by the potential of this project.

User avatar
zaidpirwani
Posts: 28
Joined: Sat Sep 22, 2012 6:18 am
Location: Karachi, Pakistan
Contact: Website

Re: Turn Raspberry Pi into a P.L.C (Programable Logic Contro

Tue May 28, 2013 6:17 am

now that the potential of this project has been repeatedly established, can this conversation move to some actual work. Maybe we can make a group online for collaboration.

I am going to work on it with or without a group cause this is supposed to be my Final Year Project for engineering and I have to get it done one way or the other. the people here http://www.raspberrypi.org/phpBB3/viewt ... =41&t=4152 have started work on it, but 0x17 is out for weeks and not answering, vorrias the started of this thread and one of the MOST interested also seems to be busy these days.

My Status: I have made MOSFET based Input/Output boards from the similar OpnPLC project https://code.google.com/p/open-plc/, I have got a raspberry Pi running continuously at my home in headless mode and I use it via SSH or VNC, an RTC installed on my Pi to keep the time, I have installed Beremiz on it (not USED yet) from here: https://bitbucket.org/espees_plc/espees - now the task is to get the Beremiz working on either I2C/Serial/whatever and communicate with IO Boards which are AVR based, which 0x17 has probably done but hasn't given the write-up for.

FYI: am an industrial electronics engineering student from KHI, Pakistan, I know the electronics stuff which will go in this project and I can do programming etc as well quite well but am new to Linux so am stuck at some places. So, anyone up for making a proper group somewhere online and working on it, even if it's on weekends only...

acoliveira
Posts: 2
Joined: Tue May 28, 2013 2:36 pm

Re: Turn Raspberry Pi into a P.L.C (Programable Logic Contro

Tue May 28, 2013 10:34 pm

sorry for my poor english, you can use codetyphon/lazarus with scada package ;)

omegacore
Posts: 5
Joined: Fri Feb 01, 2013 7:57 pm

Re: Turn Raspberry Pi into a P.L.C (Programable Logic Contro

Tue May 28, 2013 11:58 pm

Might I encourage everyone to look at EPICS for the SCADA? Not that it matters at this point, the scada can always be interfaced later (probably by modbus).

I would like to help out by getting ethercat going with beremiz. I have limited experience, but I work with Beckhoff products all day, so I am getting familiar with EtherCAT. They have really good IO systems, that are very competitively priced (for industrial grade IO).

I just joined the Beremiz mailing list, and am ordering my Pi now. This will be very interesting.

resologis
Posts: 2
Joined: Fri Jun 07, 2013 7:14 pm

Re: Turn Raspberry Pi into a P.L.C (Programable Logic Contro

Thu Jun 20, 2013 12:15 am

You may also be interrested by our solution. Since last year, we have invested heavily in creating a product line based on the ISaGRAF runtime (RockWell Automation), a leader in the field of IEC programming. Our development project was originally intended to businesses, but having discovered RaspberryPi, we finally made ​​the decision to market a low price version ($ 99) for home use, in order to publicity our company. One "Img" file, ready to burn on the SD Card of the RaspberryPi Model B is available, with the ISaGRAF 6.2.1 programming software, Windows compatible. GPIO and PiFace drivers are integrated into the solution, in addition to the generic drivers like Modbus Master / Slave, certain functional blocks such as sending e-mails, PID controllers and more. The website http://ipc.resologis.com present application examples and guides to start. We expect further development in the years to come, and stronger next year to integrate many pilots and additional features. If you want to try the solution without Hardware, we also have produced à Vmware version of the runtime. A free license, for illimited use but with 2 hours continuous runtime is available. You just have to get your serial number at http://www.resologis.com.

Regards,

Resologis Team

FreePi
Posts: 1
Joined: Thu Jun 20, 2013 10:21 pm

Re: Turn Raspberry Pi into a P.L.C (Programable Logic Contro

Thu Jun 20, 2013 10:38 pm

Now that's a good news.

I imagine all the things that can be done with this platform.
- Intelligent house (Domotique)
- Embedded systems
- autonomous robot
- intelligent car
- remote monitoring and data acquisition
I already have a RPI, sure will try this soft PLC next days.

netwalker
Posts: 1
Joined: Sun Sep 15, 2013 7:23 pm

Re: Turn Raspberry Pi into a P.L.C (Programable Logic Contro

Sun Sep 15, 2013 7:33 pm

Hi to all,

I didn't read the whole thread, because I stumbled here by a google search.
I'm working on a complete solution around ICA. It can be found at:
http://www.openmsr.org/
the released binary is only for x86 Linux but in the last month I ported
it to the arm plattform. You can find it in the sources. I hope to build new
binaries in the next weeks. there is a soft plc which can be programmed in
instruction list, an optical object recognition, different loggers and a ajax web interface to
do the HMI interfacing. Everybody is welcome to enhance the tools collection.

Perhaps it has what you are looking for
Regards
Hartmut

ranpitime
Posts: 54
Joined: Sat Mar 23, 2013 5:21 am

Re: Turn Raspberry Pi into a P.L.C (Programable Logic Contro

Mon Jan 20, 2014 6:40 pm

Hi,
sure the missing part in the whole thread is
using Raspberry PI as plc with CODESYS V3:

Steps to use it:
1. Register here and download CODESYS V3.5SP5
http://www.codesys.com/download/password-inquiry.html
-> install CODESYS
2.
download the Raspberry Pi Image here:
http://store.codesys.com/mixedsearch/mi ... duct_area=
boot the Raspberry Pi with that image, now you could scan the raspberry Pi with CODESYS

Install the package in CODESYS (Package Manager)
Many CODESYS examples are included with that Package:
(After installing the Package you'll find the examples here:
"c:\Users\<yourname>\CODESYS Control for Raspberry PI" )
What is possible with the plc?
EthercatMaster
ModbusTCP / Master & Slave
Ethernet / IP Scanner
Using PIFace
Using PICam (Trigger Images by plc...)
Webvisu with SSL support which is executable on Android's and IPhone/Ipad
SoftMotion


If anyone need a debian package for installing the plc on his existing image you need to ask support@codesys.com for
codesyscontrol_V3.5.5.0.deb ...

A good how to start is:

https://www.youtube.com/watch?v=_MeQBfQObgk

Meanwhile a licensable version is available
Last edited by ranpitime on Thu Aug 07, 2014 6:10 pm, edited 2 times in total.

User avatar
abishur
Posts: 4478
Joined: Thu Jul 28, 2011 4:10 am
Location: USA
Contact: Website

Re: Turn Raspberry Pi into a P.L.C (Programable Logic Contro

Mon Jan 20, 2014 8:09 pm

Hi ranpitime, I've noticed that all your posts seem to be promoting this commercial product, often in threads that don't really seem to apply to the product... like this one for example. Please be sure to limit software suggestions to threads in which they are relevant. Of course if all you do on the forum is push a specific commercial item, you'll eventually be banned as a spammer. Just a fair warning :-)

From looking at the product documentation it would seem that CODESYS is more of an SCADA network asset management or system monitoring package, now maybe I'm missing something, but how does the software you're promoting help use the Raspberry Pi as an actual PLC?
Dear forum: Play nice ;-)

vorrias
Posts: 63
Joined: Mon Aug 15, 2011 3:31 pm
Location: Greece

Re: Turn Raspberry Pi into a P.L.C (Programable Logic Contro

Mon Jan 20, 2014 11:08 pm

Hello @abishur
I hope you remember me when I started the the back in 2011.
CODESYS is not a SCADA program (includes of course a module to make HMI visualizations ).
CODESYS is exactly what BEREMIZ promised to do (which it does). CODESYS is not free and is a commercial product that made life of Automation people easy because of a standard programing toll for industrial controllers that can work in different brands. We actually using CODESYS 2 in our factory and this addition into Raspberry is a good thing because you can use it as an educational tool in CODESYS 3.
I would like to see more on that and it could be nice not to have these two hours limitations or to make a special price for Raspberry users.

Still BEREMIZ remains an excellent choice for Raspberry just as I thought it back in 2011. Many people did a grate job as I see from this threads popularity.
Nice to talk to you again . You were one of my early supporters who belied on the project .
I kept this one that @ rm1170 wrote:
"by rm1170 » 27 May 2013 16:21
We walk before we run. If we limit ourselves to being perfect out of the gate, we will never get out of the gate. The rpi-plc project is about vision of what could be. You would have a functional plc, hmi, software and means of programming for $50. AB, Siemens, and the rest will notice. I guarantee it
"
HE IS A VISIONER!

Thanks for your support
Vasilis
Greece

ranpitime
Posts: 54
Joined: Sat Mar 23, 2013 5:21 am

Re: Turn Raspberry Pi into a P.L.C (Programable Logic Contro

Tue Jan 21, 2014 10:54 am

Hi
>now maybe I'm missing something, but how does the software you're promoting help use the Raspberry Pi as an actual PLC?
ok, sorry will not do it again, (the Intension was more how to do it)
but the answer to that question is a clear yes, it will turn Raspberry PI to an actual plc... that's it!
Thanks for the fair warning!

User avatar
abishur
Posts: 4478
Joined: Thu Jul 28, 2011 4:10 am
Location: USA
Contact: Website

Re: Turn Raspberry Pi into a P.L.C (Programable Logic Contro

Tue Jan 21, 2014 3:04 pm

ranpitime wrote:Hi
>now maybe I'm missing something, but how does the software you're promoting help use the Raspberry Pi as an actual PLC?
ok, sorry will not do it again, (the Intension was more how to do it)
but the answer to that question is a clear yes, it will turn Raspberry PI to an actual plc... that's it!
Thanks for the fair warning!
It sounds interesting, but all I seem to be able to find are descriptions alluding more to monitoring features than programming one.

Can you post a link to some screen shots showing off the PLC programming aspects of the software running on the Raspberry Pi? I saw a youtube video that said it was demonstrating it, but it looked like it was using a secondary PLC in conjunction with the Pi and there wasn't any narration describing what was going on.
Dear forum: Play nice ;-)

ranpitime
Posts: 54
Joined: Sat Mar 23, 2013 5:21 am

Re: Turn Raspberry Pi into a P.L.C (Programable Logic Contro

Tue Jan 21, 2014 6:16 pm

Hi,
here a screenshot programming ladder logic with the Raspberry Pi plc
Attachments
Pi_PLC_Ladder.png
Pi_PLC_Ladder.png (62.46 KiB) Viewed 37235 times

User avatar
abishur
Posts: 4478
Joined: Thu Jul 28, 2011 4:10 am
Location: USA
Contact: Website

Re: Turn Raspberry Pi into a P.L.C (Programable Logic Contro

Tue Jan 21, 2014 7:35 pm

Cool, thanks. Is there a library by any chance of instruction sets that come with it (For instance from the screenshot I can see it does Timer on delay, Examine if open, and Examine if closed)
Dear forum: Play nice ;-)

SGPIGLF
Posts: 1
Joined: Mon Jan 27, 2014 10:02 am

Re: Turn Raspberry Pi into a P.L.C (Programable Logic Contro

Mon Jan 27, 2014 10:11 am

Hi to all,
I am new to Raspberry Pi ,control engineering and PLC System. I thought as long as the system is able to perform the function design for it will be good enough. Why is there a need to get Raspberry Pi to becomes PLC System?
Do understand from the discussion above on Safety which I agree but in many situations there are external circuits connected to raspberry pi that can be designed to incorporate the safety requirement I guess..... Correct me if I am wrong or enlighten me on it.
Hope to learn more about all the experts here. Thanks.

User avatar
abishur
Posts: 4478
Joined: Thu Jul 28, 2011 4:10 am
Location: USA
Contact: Website

Re: Turn Raspberry Pi into a P.L.C (Programable Logic Contro

Tue Jan 28, 2014 3:15 pm

SGPIGLF wrote:Hi to all,
I am new to Raspberry Pi ,control engineering and PLC System. I thought as long as the system is able to perform the function design for it will be good enough. Why is there a need to get Raspberry Pi to becomes PLC System?
Do understand from the discussion above on Safety which I agree but in many situations there are external circuits connected to raspberry pi that can be designed to incorporate the safety requirement I guess..... Correct me if I am wrong or enlighten me on it.
Hope to learn more about all the experts here. Thanks.
Hmm... An interesting question. I bet everyone will have their own answer to it :lol: If you're asking as long as the Pi can turn on and sense digital signals and measure and source analog signals (which is 95% of what a PLC does) then why do we need to make it a full blown PLC since it's already doing everything a PLC does.

For me safety is a non-issue. There are great SCADA applications for the Raspberry pi without trying to turn it into an industrial PLC. By the time I make a Raspberry Pi into an industrial safe PLC device I would have been better off purchasing a cheap PLC off eBay. Instead, I think the real benefit for making a PLC Raspberry pi is for the educational aspects. To be able to take the Pi plus a digital and analog I/O card and be able to control that card not with java or python or C, but to be able to control it with PLC logic would be an amazingly beneficial thing.

For example, I just purchased an old Allen-Bradley SLC 5/02 off eBay, the PLC plus the power supply, the rack to hold it, a DC input card, DC output card, AC input card, AC output card, and an analog input card all cost me about $200. That's not too bad, but then I realized that the only way to communicate with it is to purchase a very expensive Allen-Bradley converter to talk on Datahighway, and then I can't edit the program online, or use floating point math. To get those features would cost me another $100. So for $300 I could have outdated technology that required a serial port to program (though in its defense, it would give me 32 digital inputs, 32 digital outputs and 4 analog inputs plus a more or less real time clock).

That's just WAY too expensive to use in a class room environment. I can't even get my company, a PLC programming company, to purchase a training PLC for new employees to learn on for that price! But a $50 solution that used the Pi and gave just a handful of electically isolated I/O and maybe an ADC with a could analog inputs? It wouldn't be much but it would be more than enough to teach new employees the basics and would be almost 3 times less than the last useless college book I bought!
Dear forum: Play nice ;-)

vorrias
Posts: 63
Joined: Mon Aug 15, 2011 3:31 pm
Location: Greece

Re: Turn Raspberry Pi into a P.L.C (Programable Logic Contro

Thu Jan 30, 2014 11:01 am

abishur wrote: .....That's just WAY too expensive to use in a class room environment. I can't even get my company, a PLC programming company, to purchase a training PLC for new employees to learn on for that price! But a $50 solution that used the Pi and gave just a handful of electrically isolated I/O and maybe an ADC with a could analog inputs? It wouldn't be much but it would be more than enough to teach new employees the basics and would be almost 3 times less than the last useless college book I bought!
Exactly that was the spirit when this thread was started back in 2011. We succeeded to make thinks moving to that direction.
And now 3S company (CODESYS 3) and Beremize have ported the software on Rpi.
THAT IS A GRATE LIP FORWARD to RPi spirit (as an educational tool).

DWomack
Posts: 20
Joined: Thu Jan 30, 2014 11:55 am

Re: Turn Raspberry Pi into a P.L.C (Programable Logic Contro

Thu Jan 30, 2014 12:19 pm

I was really excited to see 3 S Software release a demo of CoDeSys for the RaspberryPi.

This is powerful software with decades of development behind it. Major electrical controls manufacturers have selected it to be the foundation for their systems.

With the help of Bosch-Rexroth, a licensee of CoDeSys, I have been able to implement 17 axis coordinated motion packaging machines. This is serious software.

I downloaded the demo package from CoDeSys for my Pi. The package works. The main problem is that pesky 2 hour time limit on running. <grin>

I inquired of 3S about price and availability of runtimes for the Pi. Here is their reply:

************************
Hello Mr. Womack,

nice to hear that you like our product.
If we can stick to the testing timetable the full licensed version will be available in April.
We are now implementing the possibility to license the product on a software license container which will be a part of the runtime system.
So you won't need an extra license dongle unless you want it explicitly.
The fully licensed product without runtime limits will have a price of 35€.

Concerning your second question: the delivery of the full version will be the same as it is now (if you don't need a dongle).
In general the rule for vat in Germany is: you won't pay it if you are a company with a vat number (will be reviewed) and you have to pay if you are a private person.

Best regards

*************************

So, now you know.


Dennis

vorrias
Posts: 63
Joined: Mon Aug 15, 2011 3:31 pm
Location: Greece

Re: Turn Raspberry Pi into a P.L.C (Programable Logic Contro

Thu Jan 30, 2014 7:47 pm

DWomack & 3S answer wrote: So you won't need an extra license dongle unless you want it explicitly.
The fully licensed product without runtime limits will have a price of 35€.
Dennis
That is something! and I believe the best is not seen yet! Nice work @DWomack.
Keep me in touch if you like about your project in my email vorrias@argo.net.gr if you like it. I will appreciate it.

DWomack
Posts: 20
Joined: Thu Jan 30, 2014 11:55 am

Re: Turn Raspberry Pi into a P.L.C (Programable Logic Contro

Fri Jan 31, 2014 9:06 pm

I have the CoDeSys demo running.

The web visualization works. That is really neat!

I opened my router for the ip address and port 8080, which the software uses.

I can hit the Pi's CoDeSys web page from my iPhone or iPad.

With the web page idle, the codesyscontrol task is taking 6.5% of the Pi's cpu. It is using 2.4% of memory.

How do I know that? Linux has a command line command called top. It will show you those stats.

With the web page active on my phone, the numbers are 15% of cpu, and 2.5% of memory.

Really, really nice!


Dennis

DWomack
Posts: 20
Joined: Thu Jan 30, 2014 11:55 am

Re: Turn Raspberry Pi into a P.L.C (Programable Logic Contro

Thu Feb 06, 2014 8:16 pm

OK, a benchmark...

When Bill Gates and Paul Allen wrote that first Basic for the Altair 8800, here is the benchmark I used back then:

FOR i = 1 TO 1000
NEXT i

On a 4 MHz 8080 that code would execute in 4 seconds. The arithmetic was 32 bit floating point. 4 seconds.

Background:

That Basic would run in 4K of RAM! The interpreter took up about 3200 bytes. At the time you could get a floating point subroutine package, with transcendentals, that took up about 1600 bytes. So Gates and Allen did the rest of the Basic interpreter in about 1600 bytes. Tight code.

Now to CoDeSys on the Pi:

The CoDeSys Demo has two tasks. The Main task runs every 20 mSec. The Visualization (web) task runs every 100 mSec.

I added code to the Main task like this:

REPEAT
dwTemp := dwTemp + 1;
UNTIL
dwTemp = 500000
END_REPEAT;
dwTemp := 0

What this code does is increment an DWORD variable and compares it to the end value of 500000.

Half a million additions and comparisons every 20 mSec.

The Linux top command shows the codesyscontrol. task is consuming 80% of the CPU.

WOW!

Now to repeat the test as floating point...

I can't wait for the CoDeSys release in April.


Dennis

Return to “Other projects”

Who is online

Users browsing this forum: No registered users and 14 guests