PLC Ladder Diagram to Arduino Sketch Conversion
PLC Ladder Diagram to Arduino Sketch Conversion
(OP)
Hi all,
I'm trying to operate a linear actuator (SMC LEY25B-300) using an Arduino based PLC (Controllino MAXI), in retrospect i would have used a regular PLC with ladder logic but it's to late for that (for now).
Anyway, I've figured how everything should work but I'm stuck on the programming part.
The controller of the actuator is LECP6 PNP type.
The PLC is programmable just like any other Arduino board which sounded just like what needed at first, as the first prototype was controlled by two Arduino UNO boards (instead of the actuator we used rack and pinion driven by a servo motor).
Now that we are upgrading the prototype to something more robust with industrial parts, coding for the actuator isn't as straight forward as i thought.
I'm having a hard time with getting the timing right between the commands, so after searching for a while i learned that there is a possibility to create a ladder logic diagram and then converting it to an Arduino sketch.
So if anybody has any experience and can suggest a good program, guide or anything else that you think might help, will be much appreciated.
I'm trying to operate a linear actuator (SMC LEY25B-300) using an Arduino based PLC (Controllino MAXI), in retrospect i would have used a regular PLC with ladder logic but it's to late for that (for now).
Anyway, I've figured how everything should work but I'm stuck on the programming part.
The controller of the actuator is LECP6 PNP type.
The PLC is programmable just like any other Arduino board which sounded just like what needed at first, as the first prototype was controlled by two Arduino UNO boards (instead of the actuator we used rack and pinion driven by a servo motor).
Now that we are upgrading the prototype to something more robust with industrial parts, coding for the actuator isn't as straight forward as i thought.
I'm having a hard time with getting the timing right between the commands, so after searching for a while i learned that there is a possibility to create a ladder logic diagram and then converting it to an Arduino sketch.
So if anybody has any experience and can suggest a good program, guide or anything else that you think might help, will be much appreciated.
RE: PLC Ladder Diagram to Arduino Sketch Conversion
I found that post already (prior to posting here).
I asked the question for the same reason you mentioned yourself, there isn't much info and what is out there, is a mess and nothing concrete.
So i thought that I'm missing something.
Anyway, thank you again!
RE: PLC Ladder Diagram to Arduino Sketch Conversion
I made that mistake on a similar project. Try to do as little as possible in the interrupts, just increment or toggle a variable and then check the variable in your main loop to see if the interrupt was triggered.
RE: PLC Ladder Diagram to Arduino Sketch Conversion
Tried to make the actuator move between two positions (initial and final) to simulate a simplified version of the ventilation sequence that we need from our machine, so there isn't much going on in the code.
But the most peculiar thing happens when i run the code, if i leave the code to run just the initialization of the actuator and the commands to move to position 1 (initial) everything seems to work fine.
But when i add the second part, that moved the actuator to position 2 (final), which is basically a copy-paste when the only difference is a single input pin change that corresponds with the position 2 the whole thing stops from working.
After playing with the code Iv'e noticed that if i add the "delay" function it helps, but it adds up to more than 8 seconds of delay time, that makes the operation very inefficient.
I just cant understand why adding the same piece of code that initiates only after the first part was compiled completely ruins the WHOLE thing.
RE: PLC Ladder Diagram to Arduino Sketch Conversion
I am curious what you mean by 'ventilation'? Is this a building vent or a human lung emulator or something else?
RE: PLC Ladder Diagram to Arduino Sketch Conversion
About the code, it's crazy simple, about 15 lines for each direction. But i had it rewritten so many times that it stopped working all together.
I'll get it back to working order (with the cumulative delay) and post it, because I'm at a loss.
RE: PLC Ladder Diagram to Arduino Sketch Conversion
Funny coincidence, my linear actuator that used Arduino was for lung stuff too. Not treatment though, just simulation. VacuMed makes a much nicer one than I made. I'm guessing you need something different but this could give you some ideas.
http://www.vacumed.com/zcom/product/Product.do?com...
RE: PLC Ladder Diagram to Arduino Sketch Conversion
It was my first suggestion as a possible solution, to use a rotating link with a connecting rod, this will give a perfect sinusoidal air flow but for some reason it was rejected.
Instead the linear actuator was opted as a solution, I'm guessing that the fact that this an MVP prototype and the link-rod solution requires much more calculations to control the flow withing the set parameters.
RE: PLC Ladder Diagram to Arduino Sketch Conversion