![]() ![]() ![]() ![]() ![]() ![]() |
||
![]() |
||
![]() ![]() ![]() ![]() This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc. |
||
![]() |
![]() |
#1 |
Member
![]() ![]() Join Date: May 2022
Location: Texas
Posts: 3
|
Running motors for 10 seconds
I am a newbie trying to write code to run a motor for 10 seconds and then run a second motor for another 10 seconds. The two motors should never be on at the same time, and the cycle should repeat until power turned off.
Any help would be greatly appreciated. Iceman. |
![]() |
![]() |
#2 |
Member
![]() ![]() Join Date: Oct 2007
Location: Nashville, Tennessee area
Posts: 3,340
|
Welcome to the forum.
what plc are you using? this is what you have stated. 1. start motor1 and run it for 10 seconds. 2. turn off motor1 3. start motor2 for 10 seconds. 4. turn off motor2 5. goto step 1 depending on what you have available, i would also add a cycle start and stop pushbutton. this is a good start for your work. please post your work (zip it first, forum rules) if its the entire program and we will help. no one will do your home work for you. james |
![]() |
![]() |
#3 | |
Lifetime Supporting Member
|
Quote:
Post an image or a PDF as well, as not everyone here will have the same brand PLC and software as you, so they will not be able to look at your code using the manufacturer's IDE, but if they can review an image or PDF, then they may be able to help. Also, a good place to start is @Ron Beaufort's PLC bootcamp videos here, then the Patterns of PLC Programming pages here. The bootcamp video series is especially useful: they take less than 2h to watch the first time, but provide a solid foundation for understanding how PLCs work i.e. the scan cycle, even if you do not use ladder logic. Watching repeatedly until you can think Ron's words before he says them is also not a waste of time. The Patterns of PLC Programming shows patterns the PLC programmers use over and over again in various forms, especially the Seal-In, Start/Stop, and State/Fault patterns. Programming PLCs, and for that matter any programming of digital computers, involves "telling" the PLC what you want it to do. The trick to remember is that while the PLC cares not a whit what you want it to do, if it is not broken it will very faithfully, precisely, and inexorably do exactly what you tell it to do. So the only hard part is making sure you do not tell it to do something other than what you want it to do. And the only diagnostic tools you will have are
Abandon hope, all ye who think otherwise and enter here ... +
__________________
_ Brian T. Carcich i) Take care of the bits, and the bytes will take care of themselves. ii) There is no software problem that cannot be solved with another layer of indirection. iii) Measurement is hard. iv) I solemnly swear that I am up to no good ![]() Last edited by drbitboy; May 21st, 2022 at 11:15 AM. |
|
![]() |
![]() |
#4 |
Member
![]() ![]() Join Date: May 2022
Location: Texas
Posts: 3
|
Thanks James. Yes, that is the logic I am looking to build. I am using an IDEC B12RCC SmartRelay
|
![]() |
![]() |
#5 |
Member
![]() ![]() Join Date: May 2022
Location: Texas
Posts: 3
|
Motor Sequence start stop
Here is what I have so far.
|
![]() |
![]() |
#6 |
Member
|
Side issue:
Hopefully someone has properly considered the duty cycle for the motors. 10 starts per hour might require de-rating depending on the HP size involved. |
![]() |
![]() |
#7 |
Lifetime Supporting Member
![]() ![]() Join Date: Nov 2008
Location: NJ
Posts: 921
|
OP said every ten seconds, is that a typo
__________________
B.Pedersen if you are going to assume, assume you're wrong. |
![]() |
![]() |
#8 |
Lifetime Supporting Member
|
Ah, similar to Siemens LOGO! apparently. Very nice. Could you please explain how you thought the blocks and connections in that diagram are going to interact with each other to accomplish your desired behavior? Cf. here; we are the rubber duck. _
__________________
_ Brian T. Carcich i) Take care of the bits, and the bytes will take care of themselves. ii) There is no software problem that cannot be solved with another layer of indirection. iii) Measurement is hard. iv) I solemnly swear that I am up to no good ![]() Last edited by drbitboy; May 21st, 2022 at 07:38 PM. |
![]() |
![]() |
#9 |
Lifetime Supporting Member
|
@icemaker - that is more than twice as many blocks as are needed to implement that behavior. Look at the Asynchronous Pulse Generator block; I implemented the target behavior with that as one of five blocks total, and three of those five blocks were the input and the two outputs.
Not that the minimum number of blocks (a.k.a. "code golf") is always best, but sometimes concise will be synonymous with clear.
__________________
_ Brian T. Carcich i) Take care of the bits, and the bytes will take care of themselves. ii) There is no software problem that cannot be solved with another layer of indirection. iii) Measurement is hard. iv) I solemnly swear that I am up to no good ![]() |
![]() |
![]() |
#10 |
Member
![]() ![]() Join Date: Jun 2017
Location: Michigan
Posts: 493
|
I would use 4 timers:
T1 = Motor 1 On timer T2 = Motor 1 Dwell timer T3 = Motor 2 On timer T4 = Motor 2 Dwell timer If you really want to make sure they are not both running at the same time, the dwell in between will allow your program time to switch over. In a real world situation you may need to wait for one motor to ramp down before switching the other on. And even if you don't, you just set the dwell timers to something really short like 25 mS so you have the option. |
![]() |
![]() |
#11 |
Member
![]() ![]() Join Date: Jan 2022
Location: Atlanta
Posts: 60
|
I would create a simple state machine. No need to make this harder than it should be.
|
![]() |
![]() |
#12 |
Lifetime Supporting Member
![]() ![]() Join Date: Nov 2011
Location: Corona, CA
Posts: 2,038
|
HOW about single 10 sec timer and use "ON" for motor 1 and "OFF" for motor 2?
Then add a start timer on each motor for dwell.
__________________
****Control Freak**** Net is where I be and Nathan is me. I have a condition called "The Knack". https://www.youtube.com/watch?v=g8vHhgh6oM0&t=2s |
![]() |
![]() |
#13 |
Lifetime Supporting Member
|
Why not a single timer for timing both run and dwell, for both motors?
Seven blocks: four instructions; one input; two outputs. I find the more timers are involved, the harder it is to read the logic. _
__________________
_ Brian T. Carcich i) Take care of the bits, and the bytes will take care of themselves. ii) There is no software problem that cannot be solved with another layer of indirection. iii) Measurement is hard. iv) I solemnly swear that I am up to no good ![]() Last edited by drbitboy; May 22nd, 2022 at 04:05 PM. |
![]() |
![]() |
#14 |
Lifetime Supporting Member
|
However many blocks we end up with, it does not make sense to use unnecessary block that only obfuscate what the code is supposed to be doing:
icemaker_simplifications.pngHere is is simplified: icemaker_simplifications_fixed.png
__________________
_ Brian T. Carcich i) Take care of the bits, and the bytes will take care of themselves. ii) There is no software problem that cannot be solved with another layer of indirection. iii) Measurement is hard. iv) I solemnly swear that I am up to no good ![]() |
![]() |
![]() |
#15 |
Member
![]() ![]() Join Date: May 2013
Location: Northern Snowball
Posts: 561
|
Its a school project. they could say rocket engines if they wanted, its just a sequenced output firing example.
No one in their right mind would cycle motors every ten seconds. thats barley spin up and down time.
__________________
Problems that go away on their own mystically are not solved. They will return. |
![]() |
![]() |
Bookmarks |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Logix Designer Studio 5000v28 Crash when opening Predefined | mwright_00 | LIVE PLC Questions And Answers | 4 | December 30th, 2019 01:03 PM |
Running code every 16 seconds Crimson 3 | secs | LIVE PLC Questions And Answers | 2 | October 23rd, 2015 07:57 PM |
Powerfllex 40 running to motors of different HP | fwagner5 | LIVE PLC Questions And Answers | 12 | October 18th, 2011 10:56 AM |
Can a VFD do magic with motors | Goody | LIVE PLC Questions And Answers | 37 | February 25th, 2004 03:01 PM |
how often should I trigger the PID? | Ron Beaufort | LIVE PLC Questions And Answers | 11 | February 22nd, 2003 11:57 AM |