olivier123

Using PTO's to control multiple stepper motors?

24 posts in this topic

Hello everyone,

I am currently working with a CP1L-EM Omron PLC and I must control 7 stepper motors with encoders with a (not yet determined) stepper driver, but probably a hybrid stepper driver, because they allow encoders... (https://www.damencnc.com/nl/closed-loop-stepper-drive-es-d808-80v-8-2a-2phase/a922?c=123). To control the motor driver I should send a pulse to the PUL+ input or is it also possible to send a very high-frequency signal to the input, so a 200 Hz signal (or more) 5V - 0V - 5V - 0V. If no, the CP1L-EM only has 4 PTO's, but I should control 7 motors, so I need 7 PTO's... I thought that it might be possible to use 1 PTO and send a pulse to a motor driver and then use a relay to send a pulse to another motor driver, is that possible? If no, what is the best way to control the motors?

Kind Regards,

Olivier

Edited by olivier123

Share this post


Link to post
Share on other sites

You cannot use relays for high speed pulse outputs.  They not even close to fast enough and will not last very long as the mechanical life of a relay is short.  To be able to independently control 7 steppers you will need 7 pulse outputs.  

Share this post


Link to post
Share on other sites

Michael, agreed on the mechanical being to slow.  But any shot with a solid state relay?  Still might not be fast enough?

Share this post


Link to post
Share on other sites

well what is the application?

there are electromechanical relays switching GHz signals. that does not mean that relay is actuating at those speeds.

are you planning to move ONE motor at the time? as long as you don't send pulses while relays are switching, you can use them. for example relay response with bounce time is on the order of 10ms. if you keep PTO low, then (de)energize relays, wait long enough (say 100ms) the send pulses, this is doable. so if using single PTO for 7 motors it would need 3 SPDT relays or 7 SPST relays.

using 4 PTO and a single output with one 4PDT relay you can control up to 4 motors at once. 

note: solid state outputs (transistors, optocouplers and SSR) do not have "bounce" but still exhibit latencies - although much shorter than electromechanical relay.

also you mention encoders but don't say what type. are you sure you can monitor 7 feedbacks?

Share this post


Link to post
Share on other sites

Ah, I did not think that he meant switching the pulse output over to a different motor using a relay (although now rereading the post, this is rather apparent).  That would work if he did not need to move them all at once.  Motors 1-4 could all be moved into position, then switch 3 relays and move motors 5-7.  This makes more sense.  I did not interpret the first question correctly.  I thought Oliver wanted to somehow piggy back a relay on one of the pulse output signals.....

Share this post


Link to post
Share on other sites

Take a look at G3RV-SR from Omron.

Share this post


Link to post
Share on other sites
1 hour ago, Michael Walsh said:

You cannot use relays for high speed pulse outputs.  They not even close to fast enough and will not last very long as the mechanical life of a relay is short.  To be able to independently control 7 steppers you will need 7 pulse outputs.  

No, but I won't use a relays to 'generate' a pulse. As you can see in the image below (I know that it has some mistakes), I connect (in this image) 3 relays in series. If I want to control the first motor I activate the first relays. If I want to control the second motor I deactivate the first relay and I activate the second relay. The relay is only used as a simple switch.

4td3ki1kg6ia9.jpg

 

Edited by olivier123

Share this post


Link to post
Share on other sites

Yes, I noted my misunderstanding above.  

Share this post


Link to post
Share on other sites

There are ONLY two pulse train outputs available on a CP1-EM PLC. Switching PTO output references to different motors with relays would work, , however if you ALSO need PULSE + DIRECTION you will need to switch two signals [PULSE + DIRECTION]. For relays specs I highly recommend you use a bifurcated contact type for to accomodate such low voltage/current signals to each drive. Example here: - http://us.idec.com/Common/Download.aspx?d=310933

Share this post


Link to post
Share on other sites

@all Thanks for the answers!

In that case, I have another question. I will probably use this drive:  https://www.damencnc.com/nl/closed-loop-stepper-drive-es-d808-80v-8-2a-2phase/a922?c=123
I should connect a PTO (or PLS2) to the PUL+ input, right? Should I connect a 'normal' output (0 or 1) to the DIR+ input or? I've never worked with PTO's before, so that's why I'm asking. Thanks!

Share this post


Link to post
Share on other sites

PTOs are like normal outputs but can operate faster. hardware manual of your product shows detailed connections for both PNP/NPN type I/O.

 

 

1 person likes this

Share this post


Link to post
Share on other sites
15 hours ago, olivier123 said:

@all Thanks for the answers!

In that case, I have another question. I will probably use this drive:  https://www.damencnc.com/nl/closed-loop-stepper-drive-es-d808-80v-8-2a-2phase/a922?c=123
I should connect a PTO (or PLS2) to the PUL+ input, right? Should I connect a 'normal' output (0 or 1) to the DIR+ input or? I've never worked with PTO's before, so that's why I'm asking. Thanks!

Whenever you execute ANY pulse output instruction in the PLC it will always assign two outputs. Either {PULSE + DIRECTION} or {PULSE CW and PULSE CCW] depending on the configuration you use in the output instruction. Even if you are only moving in one direction using just PULSE or PULSE CW the second output is NOT available as a standard output.

If your PLC is model CP1L-EM**DT-D then outputs will be Sinking Transistor. If model is CP1L-EM**DT1-D then outputs will be Sourcing Transistor.

Since only two pulse train outputs are available on this PLC and you are trying to control 7 axes it will be quite the challenge to manage all of them using relays to switch PTO signals to each drive.

 

GOOD LUCK.

Pulse outputs.jpg

1 person likes this

Share this post


Link to post
Share on other sites

Hi.... Folks

Is there any difference in the program instructions (PULS, SPED, INI, ORG... etc) for closed loop stepper & servo motor controls? Can we control the closed loop stepper motors as we used to control the servo motors or vise versa ? Can we use the same registers (identical) in both stepper & servo controls?

Thanks

Share this post


Link to post
Share on other sites

sure, instructions do not care what is attached to the I/O. imprtant part is that wiring is correct (polarity, level) and that signal type and I/O are compatible.

Share this post


Link to post
Share on other sites

Okay, I'm back with another question. I am quite sure that I use the CP1L-EM40DT1-D PLC (PNP --> sourcing transistor output) and I am using a Leadshine DM556 ( http://damencnc.com/userdata/file/1750-1_DM556_datasheet.pdf ) motor driver. When I wire the driver with the 'active high' (page 5, figure 2) connections to the PLC, the PLC always has a ~24V output. Is this because you cannot connect active high to a PNP PLC? Which means that I need to wire the driver to the plc according to figure 3?

 

Share this post


Link to post
Share on other sites

Fig 3 is correct for PNP. i would use common value resistor 2k2 1/4w resistors to ensure about 10mA through optocoupler LEDs in DM556 inputs.

 

fig3_pnp.png

1 person likes this

Share this post


Link to post
Share on other sites

@panic mode Resistor has to be connected if drive works on zero potential & PLC output is PNP type, Is it right? Is there any purpose of considering mA current signal for drive, or only we have to go through the Electrical specifications mentioned in manual and connect resistors accordingly? 

What should be our main purpose?

Edited by Abdul Wajid

Share this post


Link to post
Share on other sites

it does not matter what path you choose, result will be the same... if not you have a problem. btw. following manual is never a bad idea (unless there is a typo :-) )

this has nothing to do with polarity of I/O. this device would still need resistor if driven by NPN outputs since that does not change 24V. if the NPN outputs were open drain (with no internal pullups or RC suppression ) then it would be possible to power positive rail from diffreent voltage such as 5V.

But this is getting ugly for sevefal reasons and one of them is reference potential that is not standard. 

 

Btw. in spirit of "no exercercise is too small":

most common LEDs (not power devices) can tolerate up to 20mA... but this is the max current that they can survive. for practical use, it is common to use half of that or 10mA. it would be fine to bring it down to 5mA too but most people are conservative and concerned with leakage current and sensitivty to interference, larger current reduces sensitivity.

forward voltage drop of LED is related to emitted spectrum. red devices have lower Vf (about 1.6-2.2V) , blue have higher Vf (about 3-3.8V). since optocouplers are sealed devices, they are using infrared and Vf is on the order of about 1-1.2V. and UV LEDs have larger Vf too since on the other side of spectrum. 

in industry standard control voltage is 24V. voltage drop across outputr is usually very low, specially at such low current (few mA).

then you get for current something like (24V - 1.2V)/Rtotal

if external resistore is 2k2, and internal is 270ohm, that would get LED current to about 9.23mA which is just where we want it.

manual states 2k... this is not a problem to find today although such value is still less common than older series value 1.8k or 2k2. resistor values come in certain values depending on tolerance or "number of values per decade". for example 2.2 is standard value in every series since E3.

on the other hand value. 2.0 value is only available in series E96 or E192. that is fine if such tight value is necessary but this is absolutely not the case here.

btw if you don't know what i'm taling about:

https://en.wikipedia.org/wiki/E_series_of_preferred_numbers#E48

 

and with 2k, Rtotal is 2.27k and If is 10mA. 

using 1.8k one would get 11mA.

all of these are very close and all three choices are fine (this is not critical). 

but actual current will depend on exact vlaues of components and their tolerance but for sake of the argument, lets neglect those.

lets' check power as well. power is I^2*R

1/4W is 0.25W and it is good to have some resereves (10-20% at least)

using above examples we get

Rextern (Ohm) Rcurrent(A) Rpower(W) ReservePower
1800 0.011 0.2178 12.88%
2000 0.01 0.2 20.00%
2200 0.00923 0.18742438 25.03%

 

yes, there are larger resistors like 1/3W, 1/2W etc. again 1/4W used to be very common. and 2k2 collors bands match so less confusion for person doing actual wiring. also it is easier to fit clear heatshrink tubing over the resistor. btw. tubing is great to reduce chance of accidental shorts when fidlding with circuit (troubleshooting etc.).. and the tubing is not just electrical insulation - it is also thermal insulation so the margins you have there may be gone.

 

just my $0.02

 

besides, how else do you whip juniors into shape, get them to read, do math and compete? they have to practice and reinforce what they learned. one of my favourite interview question is just such simple DC circuit but with low voltage incadescant light bulb instead of LED. it is pathetic that less than 5% of candidates are able to solve it for resistance. only maybe 1% actually also considers power and usually still get it wrong. (sigh) ... power is everything... just watch Apolo13 movie for a good example.

it is embarassing to watch somone browse DigiKey or Mouser website to select 0.1W SMT resistor which is two orders of magnitude too little. but this is why such question is a great filter to weed out unwanted candidates early on, long before we get to more interesting topics. 

likely doing some interview later this week so... hope he/she finds this thread. 

2 people like this

Share this post


Link to post
Share on other sites

@panic mode wow... what a great explanation... Really appreciate it.... :-2

By your post, seems like you had a good experience in automation and in depth clarification in low voltage system. It's really good to share these type of knowledge... I have to go through it little bit deep to understand so am still in the initial stage of this field and have to learn more so on. Thanks one again....

1 hour ago, panic mode said:

just watch Apolo13 movie for a good example.

Seems little bit funny for me in this forum... :-D just kidding

Anyway everyone here is to gain & give something and and have to follow thoroughly to be perfect in something....

Thanks

Share this post


Link to post
Share on other sites
4 hours ago, panic mode said:

Btw. in spirit of "no exercercise is too small":

Nice job Mr. Mode! I like that spirit as well. I sometimes catch a little grief from the kids at our plant but I believe that knowing the basics can aid exponentially in solving difficult problems.

Share this post


Link to post
Share on other sites

I got the stepper motor working! :) However, I want to turn the motor driver off (HIGH), because my motor won't get any pulses in that way. Is there a possibility that a bit will get 0 or 1 when the PLS2 is done? So I will turn my driver on, then I will send the pulse train, then the PLC makes a workbit 0 or 1 and then it turns the driver off.

Edited by olivier123

Share this post


Link to post
Share on other sites

Section 5-2 of the operation manual W462 describes the Pulse Output function in detail. Here is a snip of the Auxiliary data area with the flag you are looking for:

Mr_PLC_CP1L_A_Area.thumb.JPG.f8a1fd5f0a0

Share this post


Link to post
Share on other sites
1 hour ago, olivier123 said:

I got the stepper motor working! :) However, I want to turn the motor driver off (HIGH), because my motor won't get any pulses in that way. Is there a possibility that a bit will get 0 or 1 when the PLS2 is done? So I will turn my driver on, then I will send the pulse train, then the PLC makes a workbit 0 or 1 and then it turns the driver off.

You can make a standard output for the Enable signal to your drive and just program it in ladder.  You can make sure the pulse output is complete using the bit highlighted above (A280.03) before turning off the drive enable output.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now