Author Topic: Motor Speed control  (Read 34693 times)

can

  • Full Member
  • Posts: 160
  • I'm a llama!
    • View Profile
Motor Speed control
« on: February 04, 2011, 10:48:41 AM »
Hi. Currently trying to use a MD888 to control the speed of a motor. The motor is connected to a motor driver. MD888 will output a 0-5vdc analogue output to the driver and the driver will adjust the speed of the motor accordingly. When I use hscdef to stop the motor when hscpv[1]=0, the driver indicates an error of overload, meaning the stopping of the motor is too fast. I know this may be a problem of the driver but does anyone know how to implement a function to decelerate the motor accordingly and stop at the correct position with high repeatability? Thanks.

Regards
Ken

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Motor Speed control
« Reply #1 on: February 04, 2011, 11:10:47 AM »
You can set HSCDEF to start decelerate the motor when HSCPV[1] = xxx and then in that custom function you re run HSCDEF at the next decrement (e.g. xxx/2) so that the same function will trigger again and you can SETDAC to yet a lower value. The third time you will HSCDEF so that it triggers when HSCPV[1] = 0 and stop.

Structured properly you can even give it a smooth deceleration by breaking it down to say 5 steps and each step you use the SETDAC to a lower value until it finally stop when HSCPV[1] = 0.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

can

  • Full Member
  • Posts: 160
  • I'm a llama!
    • View Profile
Re:Motor Speed control
« Reply #2 on: April 08, 2011, 01:40:00 PM »
Hi. Had tried the method that you mentioned. Looks ok now. However, I have another problem. HSCPV[1] appears the same for both setdac[1],1000 and setdac[1],3500 but the actual distance travelled by the motor is different. The motor is having good repeatability when set at any speed using the method you mentioned but the distance travelled varies even though high speed counter claims that the motor has travelled the same distance. Any idea how to solve it?

Thanks.

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Motor Speed control
« Reply #3 on: April 11, 2011, 09:23:31 AM »
The HSCPV function should return the correct value with respect to the distance as long as the incoming encoder pulse does not exceed its maximum frequency limit.

Please re check your data and ensure that your program did not reset the HSCPV somewhere during the changing of speed etc.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

can

  • Full Member
  • Posts: 160
  • I'm a llama!
    • View Profile
Re:Motor Speed control
« Reply #4 on: April 12, 2011, 09:34:33 AM »
sorry. Any idea what's the maximum frequency of 888 or fmd88? Will putting in the negative phase of the encoder from the motor helps? The encoder on the motor is currently 1024 pulse per revolution and top speed of 1500rpm. What can i do to get an accurate reading? Thanks
« Last Edit: April 12, 2011, 10:37:51 AM by can »

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Motor Speed control
« Reply #5 on: April 12, 2011, 02:05:22 PM »
The HSCPV should be able to read accurately if the incoming pulses is < 10,000 pps.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

can

  • Full Member
  • Posts: 160
  • I'm a llama!
    • View Profile
Re:Motor Speed control
« Reply #6 on: April 14, 2011, 01:44:38 PM »
Hi. Am I right to say that the 888 does not support a motor encoder that is travelling at 1500rpm that gives a pulse of 1024 per revolution? Any idea what are the options available to me if i need to get the encoder readings accurately? Thanks.

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Motor Speed control
« Reply #7 on: April 14, 2011, 03:25:05 PM »
that means 1500/60*1024 = 25600 pps? That's out of specified range. You may need an encoder that output 1/4 the number of pulses per revolution.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

can

  • Full Member
  • Posts: 160
  • I'm a llama!
    • View Profile
Re:Motor Speed control
« Reply #8 on: May 23, 2011, 01:00:32 PM »
Is there any recommendations on anything that can take in the pulse and tell the PLC the current position if the encoder is 1024 pulse per revolution running at 1500 rpm? Thanks

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Motor Speed control
« Reply #9 on: May 23, 2011, 08:23:28 PM »
Are you able to replace with an encoder that output just 256 pulses per revolution? That would put it within the maximum pps that a T100MD888+ HSC can handle.

You can also try with a FMD88-10 PLC. Although FMD88-10 is also spec at 10KHz maximum but since its CPU runs 3 time faster, my guess is that it may be able to handle the 25KHz incomg pulses (we can't guarantee it so you have to try, but if it works it could be the easiest solution).
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

can

  • Full Member
  • Posts: 160
  • I'm a llama!
    • View Profile
Re:Motor Speed control
« Reply #10 on: May 28, 2011, 12:39:21 PM »
Hi. FMD88 seems to be the same as 888 from what I see after trying them. Maybe you can try and verify in case I'm not doing it correctly? Thanks.

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Motor Speed control
« Reply #11 on: May 30, 2011, 04:13:24 PM »
What if you try compare the HSC readings from slower speed settings (so that the HSC is subject to < 10Kpps) and see if the two settings travel the correct distance?  That way is to check whether it is other factors (noise pulses, mulitple pulses received from encoder etc.

Also if you try to stop the motor when HSCPV[] readings hit a certain value, then the motor may need some distance to stop. What are the readings of the HSCPV[] when the motor come to a complete stop? Does it correspond with the actual distance travelled.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

can

  • Full Member
  • Posts: 160
  • I'm a llama!
    • View Profile
Re:Motor Speed control
« Reply #12 on: June 03, 2011, 02:45:27 AM »
Hi. Will a frequency divider helps?

can

  • Full Member
  • Posts: 160
  • I'm a llama!
    • View Profile
Re:Motor Speed control
« Reply #13 on: June 07, 2011, 12:02:23 PM »
Anyone knows if a frequency divider can help to lower the 1024 pulse per revolution sqaure wave ttl to 400 pulse per revolution? Thanks.

garysdickinson

  • Hero Member
  • Posts: 502
  • Old PLC Coder
    • View Profile
Re:Motor Speed control
« Reply #14 on: June 07, 2011, 03:26:25 PM »
If you are talking about a quadrature encoder (2 outputs: A and B phase) then ignore this reply.  

If you are talking about an encoder that simply generates pulses as the motor turns and does not provide any direction information, then read on..

To go from 1024 pulses / revolution to 400 pulses / revolution is not a simple task.  1024/400 = 2.56... The answer for this problem is way out of your depth.

Why not divide the 1024 by 4 and get 256 pulses per revolution?

Dividing by 4 is pretty simple task using both sections of a CD4013 (dual d flip-flop).

Another device to consider is the CD4040.  It can divide an incoming signal by 2,4,8,16,..4096.  If you picked the divide by 4096 output you would get 1 pulse every 4 revolutions.

Gary D

« Last Edit: June 07, 2011, 03:34:04 PM by garysdickinson »