You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

Reply
 
Thread Tools Display Modes
Old January 4th, 2014, 05:32 AM   #1
Jieve
Member
United States

Jieve is offline
 
Join Date: Feb 2012
Location: USA
Posts: 242
Controlling Brushed DC Motor Speed using PWM

Hello Guys,

I have a project that I will be attempting for the first time, and need some help in implementing it. I have a 0.5HP Rotomag 110V Brushed DC Motor whose speed I would like to control using the PWM output (adjustable between 2Hz and 100kHz) of a Siemens S7-1214C PLC. Speed will be measured using a sensor measuring a high signal at a single notch in a secondary geared shaft, meaning 1 pulse per revolution. My idea is to wire the sensor into an edge triggered digital input and use an interrupt routine to calculate the time between pulses to obtain the speed. Max shaft speed is 2250RPM or 26ms/rev. PLC cycle time is around 10ms. Speed would be fed back and pulse width controlled using PID. I would like to be able to simply enter a speed value on the HMI and have the system run up to this speed. Available mains voltage is 230/400V.

Questions: 1) Iím not sure what component I need to interface the PWM signal with the motor. Are there power amplification modules for this purpose that take in a PWM signal and output an analog voltage? Or can I somehow amplify the PWM signal directly and run it into the motor? What PWM frequency would you recommend? The motor max speed will be around 800RPM and low load, this speed is obtained under no-load conditions by applying ~55V DC to the motor.

2) Is the cycle time fast enough for this operation? It seems like interrupting the cycle every 26ms with a 10ms cycle time may affect something (there is of course the PID instruction and some data logging which may be interrupted by the routine). Haven't worked much with PLC interrupts. Any pitfalls here?

3) Any input regarding other pitfalls, hardware that might make things easier or calculation methods that might make things easier? Again itís the first time Iím attempting a project like this, seems entirely doable but need to figure out how to implement everything.

Btw, this project is for an educational environment. Any input would be greatly appreciated!! Thanks!!
  Reply With Quote
Old January 4th, 2014, 06:11 AM   #2
L D[AR2,P#0.0]
Lifetime Supporting Member
United Kingdom

L D[AR2,P#0.0] is offline
 
Join Date: Nov 2006
Location: UK
Posts: 6,420
Can you clarify the end purpose - for example is it to gain an understanding of how to switch transistors to control the voltage required to run the motor at a required speed?
  Reply With Quote
Old January 4th, 2014, 02:43 PM   #3
Jieve
Member
United States

Jieve is offline
 
Join Date: Feb 2012
Location: USA
Posts: 242
Thanks for the reply. This is the drive setup for a machine used to demonstrate vibration phenomena in rotating machinery to be used at a technical school. The motor has already been designed into the system, need to get it controlled and running.
  Reply With Quote
Old January 4th, 2014, 02:44 PM   #4
Vic
Member
Canada

Vic is offline
 
Join Date: Jun 2002
Posts: 246
This is not a project for a beginner. You cannot power the motor directly from the PLC. Unless you have considerable experience designing power electronic circuits, purchase something already made. Most DC drives use SCR phase control for converting mains AC to DC for a motor, not PWM control. You will also need to include a current limit circuit to prevent high current from damaging the electronic switching devices.

Purchase a small DC drive such as one made by KB Electronics and control it with an analog output from the PLC. The drive will have its own speed feedback for controlling the speed but you could use the sensor for displaying the speed on a HMI. If the speed is just for display purposes, it may be better to count the pulses for a fixed time period, say 1 second, and calculate the speed from that value.
  Reply With Quote
Old January 4th, 2014, 04:52 PM   #5
Jieve
Member
United States

Jieve is offline
 
Join Date: Feb 2012
Location: USA
Posts: 242
Vic, thanks for the reply. Couple things:

Quote:
This is not a project for a beginner.
Not a beginner, just never done a project of this type before.

Quote:
You cannot power the motor directly from the PLC. Unless you have considerable experience designing power electronic circuits, purchase something already made.
This I am aware of, this is why I was posting the question. I'm not sure what components are available, I was envisioning some type of converter with a power amp connected to 230VAC main, that takes a DC 0-24V PWM signal as input, and varies the power out based on the input. But I don't know if something like this exists. If I can control the drive somehow with a 0-10V analog signal that's fine too, probably even easier. I have some EE colleagues that could build something, but I'd FAR prefer something off-the-shelf, as it just makes things a lot easier.

Quote:
Purchase a small DC drive such as one made by KB Electronics and control it with an analog output from the PLC.
Looks like KB has a number of drives, both PWM and analog controlled that might fit the bill. Will check them out, thanks for the tip.

Quote:
If the speed is just for display purposes, it may be better to count the pulses for a fixed time period, say 1 second, and calculate the speed from that value.
The speed measurement is for feedback, to make sure the motor is running at the correct speed. Unfortunately the motor has no encoder or tacho built onto it, nor can one be easily adapted as far as I can tell (I'll research this further, maybe I can get a tacho or encoder for this), hence the single pulse method described above.

I considered the count method, however since there is only 1 pulse/rev, the speed resolution is quite low using that method. If I were to count pulses per second, at slow speeds 1 pulse/sec = 60RPM, 2 pulses/sec = 120RPM. If possible I'd like resolution higher than 60 RPM per pulse. Measuring the time between pulses also results in some error at high speed, with 26ms/rev at max speed, and a 1ms error (since PLC clock resolution is 1ms) this would result in ~28RPM error. Also not entirely ideal, but better than the other way.

Ideally I'd like to get it within a couple RPM, but maybe I'm just dreaming if I'm not using an encoder or tacho. Just would like to keep the signal stable enough prevent the PID from hunting to find the desired speed.

I am flexible on the PLC although I only have Siemens to work with, I have S7-315F's or a S7-1516 PLC available as well. I liked the compact 1200 with built-in PWM though, haven't done much research as to what built-in options are available with the 1500. Scan time would be greatly reduced though, just seemed a little overkill for this project.

Last edited by Jieve; January 4th, 2014 at 05:03 PM.
  Reply With Quote
Old January 4th, 2014, 06:06 PM   #6
Peter Nachtwey
Member
United States

Peter Nachtwey is offline
 
Peter Nachtwey's Avatar
 
Join Date: Apr 2002
Location: The land of the woke and the home of the broke
Posts: 7,976
Quote:
Originally Posted by Jieve View Post
Not a beginner, just never done a project of this type before.
So you are a beginner.

You can buy cheap drives that will convert an analog output to a PWM signal to the motor. This should solve the output problem.

If position control is not required then try mount a tachometer on the motor. Usually I recommend and encoder for position feed back and I want 10000 pulses or 40000 counts per revolution minimum.

If you do use a tachometer then make sure the analog input card does not have a low pass filter on the input. You must have noise free and timely velocity feedback.

This would be easy with a real motion controller.
__________________
"Living is easy with eyes closed, misunderstanding all you see...." Strawberry Fields Forever, John Lennon
  Reply With Quote
Old January 4th, 2014, 10:05 PM   #7
Vic
Member
Canada

Vic is offline
 
Join Date: Jun 2002
Posts: 246
Quote:
This I am aware of, this is why I was posting the question. I'm not sure what components are available, I was envisioning some type of converter with a power amp connected to 230VAC main, that takes a DC 0-24V PWM signal as input, and varies the power out based on the input.
Typically PWM controllers are only used when the power supply is batteries as you need a smooth, stable source of DC to be able to pulse width modulate it. You want SCR phase control if your power source is AC as you can convert directly from AC to variable voltage DC.

A typical DC drive has a speed control loop and a current control loop. These are similar to PID loops but need to be much faster than what can be done in a PLC. Use an off-the-shelf DC drive controlled with an analog output. If the drive speed control is not good enough for your needs (typically 2% using armature voltage for speed feedback) use an external speed sensor connected to the PLC and vary the analog output accordingly. It is doubtful if you will be able to get better than 2% speed regulation if the speed sensor only gives 1 pulse per revolution.
  Reply With Quote
Old January 4th, 2014, 10:57 PM   #8
Peter Nachtwey
Member
United States

Peter Nachtwey is offline
 
Peter Nachtwey's Avatar
 
Join Date: Apr 2002
Location: The land of the woke and the home of the broke
Posts: 7,976
Quote:
Originally Posted by Vic View Post
Typically PWM controllers are only used when the power supply is batteries as you need a smooth, stable source of DC to be able to pulse width modulate it.
Not true, PWM is used because it is more efficient than using analog signals where there are more resistance losses.

Quote:
You want SCR phase control if your power source is AC as you can convert directly from AC to variable voltage DC.
DC motors do not require phase control.

Quote:
A typical DC drive has a speed control loop and a current control loop.
These is speed control loop and a position control loop.

Quote:
These are similar to PID loops but need to be much faster than what can be done in a PLC.
This part is very true and why this is ONE of two reasons project will fail.

Quote:
Use an off-the-shelf DC drive controlled with an analog output.
No, use a cheap drive with an analog input and PWM output to the DC motor.

Quote:
If the drive speed control is not good enough for your needs (typically 2% using armature voltage for speed feedback) use an external speed sensor connected to the PLC and vary the analog output accordingly. It is doubtful if you will be able to get better than 2% speed regulation if the speed sensor only gives 1 pulse per revolution.
If he is lucky.

What is possible with a motion controller. The speed control is much better than %2. The PID can control the current directly. You can see in the graphs that the output or current is proportional to the acceleration and not the velocity. There is no need for a velocity or speed loop if you know how to control the current directly.
http://deltamotion.com/peter/Videos/AutoTuneTest2.mp4
__________________
"Living is easy with eyes closed, misunderstanding all you see...." Strawberry Fields Forever, John Lennon
  Reply With Quote
Old January 5th, 2014, 01:02 AM   #9
Vic
Member
Canada

Vic is offline
 
Join Date: Jun 2002
Posts: 246
Peter,

We are talking about two different things here. I am talking about a simple DC drive speed controlling a regular DC motor and you are talking about a servo drive controlling a servo motor. The KB Electronics drives I previously referred to are phase controlled with a speed and current loop. One suitable for the motor in question is available for less than $100. The drives you referred to cost many times that amount and are overkill for this project.
  Reply With Quote
Old January 5th, 2014, 01:48 AM   #10
Peter Nachtwey
Member
United States

Peter Nachtwey is offline
 
Peter Nachtwey's Avatar
 
Join Date: Apr 2002
Location: The land of the woke and the home of the broke
Posts: 7,976
Quote:
Originally Posted by Vic View Post
Peter,

We are talking about two different things here. I am talking about a simple DC drive speed controlling a regular DC motor and you are talking about a servo drive controlling a servo motor. The KB Electronics drives I previously referred to are phase controlled with a speed and current loop. One suitable for the motor in question is available for less than $100. The drives you referred to cost many times that amount and are overkill for this project.
No, I am talking about a small DC motor with encoder feed back. The encoder is 2000 PPR which yields 8000 counts per revolution. The output of the motion controller to the drive is -10 to +10 volts. The drive is a small amplifier that converts voltage to a PWM current output. When the motor is tuned you can see the control output is proportional to the acceleration/current for torque.

http://deltamotion.com/peter/Videos/AutoTuneTest2.mp4


Unless there is a velocity loop in Jieve's system his control will be similar to mine except he cannot hope to get the feedback resolution or close the loop as fast.
__________________
"Living is easy with eyes closed, misunderstanding all you see...." Strawberry Fields Forever, John Lennon
  Reply With Quote
Old January 5th, 2014, 02:15 AM   #11
Jieve
Member
United States

Jieve is offline
 
Join Date: Feb 2012
Location: USA
Posts: 242
Quote:
So you are a beginner.
Ok, I'll concede.

Quote:
Not true, PWM is used because it is more efficient than using analog signals where there are more resistance losses.
This is the original reason I wanted to use PWM to control the motor as opposed to direct conversion/regulation of AC to DC.

Quote:
No, use a cheap drive with an analog input and PWM output to the DC motor.
This sounds like what I am looking for. The motor only needs to rotate in one direction, and I don't need position control. Only velocity control. I will see if I can find an encoder or tacho for the motor. What I gather from this is you're saying use a cheap drive (analog-in PWM-out) with built-in feedback control to regulate the speed. From a hardware standpoint, essentially wire up the tacho/encoder and go. Are there cases or limitations in which PWM should NOT be used to control specific DC motor types, such as winding type, etc?

An additional beginner question: the Motor is rated for 115V, the mains voltage I am working with is 230V. Will I need to step this down and get a drive with a 110-120V main input to be compatible with (not burn up) the motor? Or are there drives that can take 230V in and limit the output to 115V DC?

Quote:
This part is very true and why this is ONE of two reasons project will fail.
I assume what you are trying to say with this, is that speed controlling the motor using a PID loop in the PLC itself will not be nearly as fast as it needs to be for accurate control. Is this correct?

Thanks Peter and Vic so much for the input.
  Reply With Quote
Old January 6th, 2014, 02:34 PM   #12
shooter
Member
Netherlands

shooter is offline
 
shooter's Avatar
 
Join Date: Sep 2002
Location: duketown
Posts: 2,711
pwm needs special output cards, expensive **** (siemens is very expensive.
As the voltage is only 110 DC try to find a speedcontroller for a racing car they can handle 40 amps so way enough.
a better choice would be a arduino.
and yes you will need a power supply or transformer. But hey for a start begin with a VAriac and a bridgerectifier, that is enough as the load does not change.
db pruftechnik has good vibration equipment.
__________________
shooter@home.nl
skype shooter paul.deelen
Computer Shooter
Paul Deelen
J. Wassenaerstraat 29
NL 5224 GG 's-Hertogenbosch
+31653300739
  Reply With Quote
Old January 6th, 2014, 03:40 PM   #13
Peter Nachtwey
Member
United States

Peter Nachtwey is offline
 
Peter Nachtwey's Avatar
 
Join Date: Apr 2002
Location: The land of the woke and the home of the broke
Posts: 7,976
Quote:
Originally Posted by shooter View Post
pwm needs special output cards, expensive **** (siemens is very expensive.
That is only if you buy a PWM card that fits in the PLC. The amplifiers we use have -10 to +10 analog inputs. The amplifier has PWM current outputs. The amplifier simplifies things and it only costs a few hundred dollars. What one doesn't get is the inner velocity or torque control loops. These inner loops must be relatively fast which is why I doubt the system can be controlled well from just a PLC.
__________________
"Living is easy with eyes closed, misunderstanding all you see...." Strawberry Fields Forever, John Lennon
  Reply With Quote
Old January 6th, 2014, 07:42 PM   #14
Jieve
Member
United States

Jieve is offline
 
Join Date: Feb 2012
Location: USA
Posts: 242
Thanks again for the responses.

I've found a DC Drive thanks to Vic's recommendation at KB electronics, it takes a potentiometer 0-5V or PLC 0-5V analog in and outputs a PWM signal. The motor I have is PMDC and designed for either PWM or SCR control, and is rated for 0.5HP and 110V. The drive is designed to take either 120V main in or 230VAC main in, and output is selectable for use with 90V or 180V PMDC Motors. Max inrush, max speed, min speed are all adjustable ny potentiometers on the device. Current ratings should handle the motor fine. We will only be running the motor to half of it's max so speed should be fine.

Unfortunately as Peter has mentioned, the Drive has no closed loop speed or torque control. The motor was from a set donated to us and seems to have been a custom design from the Indian company Rotomag, I have not been able to find any way to adapt a tacho or encoder to the casing. We could adapt one to one of the other shafts and run it into the PLC, and I am considering doing this rather than the single pulse method i mentioned at the beginning of this post.

Is there a rule of thumb as to how fast the feedback loop for SPEED control only actually needs to be?
  Reply With Quote
Old January 6th, 2014, 08:54 PM   #15
keithkyll
Member
United States

keithkyll is offline
 
Join Date: Jul 2005
Location: Heath, TX
Posts: 2,033
Post the model number of the drive so we can be sure of a couple of things.
1) The lower cost drives use a 5K pot. The voltages on the pot are at line potential. Make sure it has isolated input.
2) Selectable 115/230V still means you have to use a 90 VDC motor with 115VAC, and a 180VDC motor with 230VAC. Make sure this control does a conversion. I suspect you'll need a stepdown transformer/autoformer.

Last edited by keithkyll; January 6th, 2014 at 08:57 PM.
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
Water meter & PLC hashem LIVE PLC Questions And Answers 14 April 30th, 2013 12:56 AM
DC Volt drop Alan Case LIVE PLC Questions And Answers 3 May 13th, 2011 07:54 PM
How to control duty cycle in PWM from signal control u to controlling dc motor zeta LIVE PLC Questions And Answers 3 September 6th, 2007 11:58 AM
PWM for DC motor Paulmatrix LIVE PLC Questions And Answers 6 February 3rd, 2005 08:25 PM
Why PWM? Peter Nachtwey LIVE PLC Questions And Answers 16 July 28th, 2004 06:27 PM


All times are GMT -4. The time now is 07:17 AM.


.