Author Topic: Brushed DC motor closed loop speed control  (Read 4097 times)

0 Members and 1 Guest are viewing this topic.

Offline MartinnTopic starter

  • Frequent Contributor
  • **
  • Posts: 316
  • Country: ch
Brushed DC motor closed loop speed control
« on: June 09, 2024, 05:11:27 pm »
Hi all,

I just bought a powerfeed unit for my mill https://www.paulimot.de/Maschinen/Maschinenzubehoer/Vorschubmotoren/1121/Vorschubmotor-X-Achse-fuer-SIEG-SX4 which it not really fantastic. Slowest feeds are too fast for milling and speed stability is poor - not sure if it has feedback at all. So I'm thinking of adding a closed loop speed controller (or simply replace the motor with a stepper, but this is not what I'd like to discuss here). The motor is a 24 V brushed DC with 1800 rpm and 1:7.5 reduction gear. No encoder or feedback. The original electronics does some PWM and overload limiting, see PCB photo (LM324, power transistor IRF540. I work on motion and motor control professionally, I just never came across a brushed motor, so I'm asking here if someone has experience with controlling brushed DC motors.
Specifically, I am wondering if closed loop speed control with decent stiffness can be achieved down to a few rpm. This is critical, as it defines the chip load of a milling cutter. Faster speeds (up to 1800 rpm) are for moving the table only and are not critical.

As the motor is now, the only option to get feedback from it would be via back EMF sensing. Not sure how well this would work with the brushes. I guess I would not bother with it.
I think that without a decent encoder, stable low speed performance will be difficult to achieve. Simplest method I could think of would be to add a magnet at the end of the shaft (drill threaded hole in shaft) and put a AS5047 on axis. I have used this sensor for other control projects and it is great when you need high resolution, but only moderate accuracy. Ideal for speed estimation. System options would be going for an STM32 (cascaded PI current and PI velocity control loops), finding a controller chip (Trinamic has some nice ones) or maybe even improving the existing analog control.

Not sure if I am trying to beat a dead horse here. :horse: (and an expensive one at € 383 btw)

Has anyone experience with decent quality (stiffness/dynamic range) control of small brushed DC motors?

Thanks, Martin
 

Offline IanB

  • Super Contributor
  • ***
  • Posts: 12014
  • Country: us
Re: Brushed DC motor closed loop speed control
« Reply #1 on: June 09, 2024, 05:46:49 pm »
No direct experience, but I think speed regulation of brushed DC motors is best done with PWM.

To control the speed, I think you would need an encoder on the output shaft and a feedback loop to adjust the PWM duty cycle.

My guess is you would have to experiment and see what you can achieve.
 

Offline fourtytwo42

  • Super Contributor
  • ***
  • Posts: 1194
  • Country: gb
  • Interested in all things green/ECO NOT political
Re: Brushed DC motor closed loop speed control
« Reply #2 on: June 09, 2024, 07:15:54 pm »
There are three sensorless methods I have used,

One is a current compensated constant voltage, that is the voltage increases by a small amount with increasing current to compensate for Rm.
Another is to AC couple and low pass filter the commutation voltage and count the frequency.
And finally I have tried PWM sampling the back emf during switch off time.

All of course are not as good as a mechanical sensor.

I am guessing that pcb only implements constant voltage OTH the heatsink is quite small so maybe it's a PWM output but with no feedback.
« Last Edit: June 09, 2024, 07:19:11 pm by fourtytwo42 »
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19669
  • Country: gb
  • 0999
Re: Brushed DC motor closed loop speed control
« Reply #3 on: June 09, 2024, 07:34:59 pm »
It's not something I've done before.

How precise does it need to be?

If precision is important, then how about a PLL controller?
https://www.ti.com/lit/an/slua085/slua085.pdf
 

Offline MartinnTopic starter

  • Frequent Contributor
  • **
  • Posts: 316
  • Country: ch
Re: Brushed DC motor closed loop speed control
« Reply #4 on: June 09, 2024, 07:36:38 pm »
Another is to AC couple and low pass filter the commutation voltage and count the frequency.

Great idea! Did that work? Probably pretty messy I'd think?

And finally I have tried PWM sampling the back emf during switch off time.
That would be the straightforward way, I wonder how well that works with the commutation noise?

I am guessing that pcb only implements constant voltage OTH the heatsink is quite small so maybe it's a PWM output but with no feedback.
Yes, it's PWM, you can hear it (few hundred Hz).

So how was your success rate with those methods?
 

Offline MartinnTopic starter

  • Frequent Contributor
  • **
  • Posts: 316
  • Country: ch
Re: Brushed DC motor closed loop speed control
« Reply #5 on: June 09, 2024, 07:42:42 pm »
How precise does it need to be?

It does not need to be precise. Setpoint is from a simple pot anyway. Maybe +-20% at low RPM would be totally fine.
I'm more concerned about practical issues. How well can you get current control to work with the switching of the brushes? After all it's massively varying impedance and resistance.
Also, stick-slip or generally friction from the commutator could be nasty.
If it would be a brushless motor, we'd be back in well established practise. Adding an encoder would make even position control straightforward. Sensorless operation is more difficult, but also possible (probably not for a few rpm).

It's the brushed motor thing that makes me wonder.
 

Online amyk

  • Super Contributor
  • ***
  • Posts: 8330
Re: Brushed DC motor closed loop speed control
« Reply #6 on: June 09, 2024, 08:02:06 pm »
Look at treadmill motor controllers. They're much higher voltage than your application but they use brushed DC motors too.
 

Online Doctorandus_P

  • Super Contributor
  • ***
  • Posts: 3540
  • Country: nl
Re: Brushed DC motor closed loop speed control
« Reply #7 on: June 09, 2024, 11:05:56 pm »
Brushed motors can be quite easily controlled to about 10% of their max PWM, and with some proper tuning to 3% of their maximum RPM or even lower, but there are a bunch of limitations.

First the control algorithm has to be quicker then the time constant of the motor, and you will need a reasonable resolution encoder to get enough speed resolution quick enough at low RPM.

Slip-stick is a bit of a problem, but as long as the motor is moving, static friction and motor load are also important factors. I have made a controller for a heavy movie screen and when unrolling it I had to use different PI parameters then for rolling it up.

Your commutator does not have many contacts. This will result in some torque ripple, and this will also degrade the controlability of the motor a bit.

If you can manage to add a flywheel to the motor to increase it's inertia, it's also easier to control at lower speed.

Motor torque is determined by motor current. For short periods you can overload DC motors significantly (2x nominal torque is quite normal)  but you can't increase torque as with mechanical transmissions.

But overall, with feedback, you can get much better control over your motor, and it is not very difficult to do. You just need some microcontroller FET + FET driver, and the feedback electronics (Hall sensor + magnet). It's a doable project and quite a fun to get to know PID loops and how to do them in software. But it probably will cost you days or weeks of your free time the first time you do it. if that is OK with you, then go for it.

PWM frequency does not matter much. At low RPM, a low PWM frequency (few hundred Hz) is even advantageous. You have to put some effort in the FET driver, because the FET has to switch quick enough. If you connect it directly to a pin of your microcontroller (often used for DC loads) It will not switch quick enough and will overheat because of the many switching cycles of PWM control.

« Last Edit: June 09, 2024, 11:08:01 pm by Doctorandus_P »
 

Offline schmitt trigger

  • Super Contributor
  • ***
  • Posts: 2268
  • Country: mx
Re: Brushed DC motor closed loop speed control
« Reply #8 on: June 09, 2024, 11:36:08 pm »
If you would like to use the back-emf method, just be aware that some motors spark a lot (read: create a  lot of noise), more so under load.
As others have mentioned, the voltage sample should be taken during the PWM’s off time. Even so, the voltage won’t be a straight line but a wobbly one. Most likely you may have to add analog filtering and/or software averaging. 
« Last Edit: June 09, 2024, 11:40:10 pm by schmitt trigger »
 

Offline fourtytwo42

  • Super Contributor
  • ***
  • Posts: 1194
  • Country: gb
  • Interested in all things green/ECO NOT political
Re: Brushed DC motor closed loop speed control
« Reply #9 on: June 10, 2024, 09:57:30 am »
Another is to AC couple and low pass filter the commutation voltage and count the frequency.

Great idea! Did that work? Probably pretty messy I'd think?
The problem is the commutation spikes are similar to brush noise and in my case (model railway) noise from the rolling wheel contact so I would rate it the least successful method.

And finally I have tried PWM sampling the back emf during switch off time.
That would be the straightforward way, I wonder how well that works with the commutation noise?
The commutation noise is easy to remove as it is impulse in nature, the two problems are settling time after turning off the mosfet and ripple that needs removing by a sliding average or similar filter. This was the most successful method, implemented in a small micro-controller.

I am guessing that pcb only implements constant voltage OTH the heatsink is quite small so maybe it's a PWM output but with no feedback.
Yes, it's PWM, you can hear it (few hundred Hz).
So equivalent to constant voltage with no feedback

I never got the Rm compensation method to work stably, it would either not work (motor slowed with increasing load) or go nut's (immediately go to maximum rpm), possibly with additional filtering and hours of tinkering it might work but I prefer something more repeatable. I believe it has been used for some audio turntables but they have a heavy flywheel and almost constant load.

 

Offline Picuino

  • Super Contributor
  • ***
  • Posts: 1013
  • Country: es
    • Picuino web
Re: Brushed DC motor closed loop speed control
« Reply #10 on: June 10, 2024, 11:13:04 am »
The method of measuring EMF voltage works surprisingly well at low revolutions. It is able to keep the motor stopped or at very low speed even though you try to turn it in both directions. The problem is that it is complex to implement.

Switching sensing is also difficult to achieve.

If you don't want very high accuracy, supply current compensation is the simplest thing to implement and good enough. You can even get the motor to speed up a bit when you try to brake it, it depends on the setting you make.
 

Offline Picuino

  • Super Contributor
  • ***
  • Posts: 1013
  • Country: es
    • Picuino web
Re: Brushed DC motor closed loop speed control
« Reply #11 on: June 10, 2024, 11:21:26 am »
If you decide to control it with back EMF, you can take a look at how some brushless motor controllers do it.
A normal control with a single transistor and a freewheel diode is not enough, because it takes a long time to reduce the current through the diode. The ideal is an H-bridge, which can be connected so that the current is reduced quickly and then the back-emf measurement can be made. This ensures that the motor will be without power for as little time as possible.
 

Offline MartinnTopic starter

  • Frequent Contributor
  • **
  • Posts: 316
  • Country: ch
Re: Brushed DC motor closed loop speed control
« Reply #12 on: June 10, 2024, 05:21:53 pm »
Thanks a lot for the very interesting answers! (I love motor control).
Regarding commutation peaks sensing, I found a few interesting references:
https://ww1.microchip.com/downloads/aemDocuments/documents/OTH/ApplicationNotes/ApplicationNotes/Sensorless-Position-Control-of-Brushed-DC-Motor-Using-Ripple-Counting-Technique-00003049A.pdf

https://www.ti.com/lit/ta/sszt984/sszt984.pdf

https://www.ti.com/tool/TIDA-01421  reference design including schematic

Sensorless position feedback appears to be interesting for automotive, like memorizing seat positions. But it's also quite tricky to get to work, it seems.
And while I really enjoy designing around motors, I typically work with BLDC/FOC and this is just a personal side project. And truth be told I mainly want this powerfeed to work - not make a half year project out of it (although it sounds fun). Main problem with collector pulse counting could be the large dynamic range, 1 - 1800 rpm would be a nice target.
With luck there are geared steppers that might just fit: https://www.omc-stepperonline.com/nema-23-stepper-motor-bipolar-l-76mm-w-gear-ratio-10-1-spur-gearbox-23hs30-2804s-sg10
On top, they also make a controller https://www.omc-stepperonline.com/integrated-stepper-motor-controller-1-5-4a-12-40vdc-for-nema-17-23-24-stepper-motor-isc04 which can directly be controlled via a potentiometer, so I wouldn't have to design a pulse generator.
 

Offline Picuino

  • Super Contributor
  • ***
  • Posts: 1013
  • Country: es
    • Picuino web
Re: Brushed DC motor closed loop speed control
« Reply #13 on: June 10, 2024, 05:33:37 pm »
I think it's better to keep the DC motor. It's going to have more torque throughout the speed range and it's going to be more powerful for the same size.

Plus you don't need precise control of POSITION, just SPEED, which is much simpler and can be easily achieved with a DC motor with supply current compensation.
 

Offline Picuino

  • Super Contributor
  • ***
  • Posts: 1013
  • Country: es
    • Picuino web
Re: Brushed DC motor closed loop speed control
« Reply #14 on: June 10, 2024, 05:43:39 pm »
That motor has approximately 3.7 ohms of armature resistance (you can measure it with a multimeter and tell us if this is the case).

Therefore, you only have to add 3.7 volts in the power supply for each ampere consumed, and the motor will run at constant speed.
 

Offline MartinnTopic starter

  • Frequent Contributor
  • **
  • Posts: 316
  • Country: ch
Re: Brushed DC motor closed loop speed control
« Reply #15 on: June 10, 2024, 07:06:40 pm »
That motor has approximately 3.7 ohms of armature resistance (you can measure it with a multimeter and tell us if this is the case).

Therefore, you only have to add 3.7 volts in the power supply for each ampere consumed, and the motor will run at constant speed.
Multimeter says 4.3 ohms.
But would you think that you can reliably run the motor at say 10 rpm? It is rated at 1800 rpm at 24 V, which would give 130 mV @ 10 rpm. I doubt you can control the voltage precisely enough to get that dynamic range.
What dynamic range do you think is realistic for a brushed motor? I am only aware of this for capstan drives on tape decks (or maybe turntables), which are constant speed.

You are right that with a stepper it is more difficult to retain high speed at high rpm. To some degree one can counter that with a low inductance motor and a high supply voltage. Ideally I'd keep the existing 24 V supply though. The geared motor I linked earlier probably won't be able to achieve the necessary speed (like 300 rpm), more likely it would be direct drive with a NEMA24 like this https://www.omc-stepperonline.com/s-series-nema-24-bipolar-1-8deg-4-2nm-594-77oz-in-4-2a-60x60x100mm-4-wires-24hs40-4204s

Main advantage of a stepper would be that it is relatively easy to achieve arbitrarily slow speeds. With my last mill powerfeed
https://forum.zerspanungsbude.net/viewtopic.php?t=50489#p607066
i settled for a speed resolution of 0.01 mm/s, which required a 64 bit position accumulator in the step generation, but was otherwise straightforward. The total effort I put in this design was however gigantic, and this time I am aiming for something simpler.

 

Offline Picuino

  • Super Contributor
  • ***
  • Posts: 1013
  • Country: es
    • Picuino web
Re: Brushed DC motor closed loop speed control
« Reply #16 on: June 10, 2024, 07:29:49 pm »
I don't know the limits of current compensated control, but properly adjusted it can achieve relatively slow constant speeds. In reality the motor will be supplied with higher voltage than 0.13V, because the voltage will increase with the supply current. You can test it with a simple analog control.

According to my tests, the back-emf control can indeed achieve those speeds without problem (from 10 rpm, one revolution every 6 seconds, up to 1800 rpm).
 

Offline Picuino

  • Super Contributor
  • ***
  • Posts: 1013
  • Country: es
    • Picuino web
Re: Brushed DC motor closed loop speed control
« Reply #17 on: June 10, 2024, 07:52:09 pm »
You can try this.


EDIT:
10k Pot = Speed control
1k Pot = Current feedback control

Multimeter says 4.3 ohms.
Is the resistance of the cables already subtracted?
« Last Edit: June 11, 2024, 12:55:07 pm by Picuino »
 

Online Doctorandus_P

  • Super Contributor
  • ***
  • Posts: 3540
  • Country: nl
Re: Brushed DC motor closed loop speed control
« Reply #18 on: June 10, 2024, 08:40:29 pm »
You can try this.

I am guessing something similar is already implemented.
There are a few power resistors near the FET and diode. LM434 has 4 opamps and I see two adjustment pots.

Maybe you can improve it by changing the pots, but start with some reverse engineering to figure out what the potentiometer do.
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19669
  • Country: gb
  • 0999
Re: Brushed DC motor closed loop speed control
« Reply #19 on: June 11, 2024, 07:54:53 am »
You can try this.


EDIT:
Multimeter says 4.3 ohms.
Is the resistance of the cables already subtracted?
Using an N-channel source follower like that will require a 5V or more higher voltage power supply to the op-amp, than the motor. It also appears to be a linear controller, which will dissipate a lot of power.
« Last Edit: June 11, 2024, 09:45:49 am by Zero999 »
 

Offline Picuino

  • Super Contributor
  • ***
  • Posts: 1013
  • Country: es
    • Picuino web
Re: Brushed DC motor closed loop speed control
« Reply #20 on: June 11, 2024, 08:56:26 am »
Digital version.
« Last Edit: June 11, 2024, 09:10:41 am by Picuino »
 

Offline MartinnTopic starter

  • Frequent Contributor
  • **
  • Posts: 316
  • Country: ch
Re: Brushed DC motor closed loop speed control
« Reply #21 on: June 12, 2024, 04:52:25 pm »
I am guessing something similar is already implemented.
Here we go.
A bit messy, not sure if 100% accurate, but the overall principle is clear.
Opamp 3 is a triangle generator, 420 Hz.
OP 1 is a comparator, generating a PWM based on the velocity pot.
Power FET has a 82 mR shunt for current sensing.
OP2  compares the current sense value and triggers the SCR, which displays "overload" and clamps the PWM setpoint to 0.
The OFF switch also sets the PWM setpoint to 0 and resets the SCR

And now it comes, Opamp 4 feeds the amplified current signal back to the PWM setpoint (via the 100 k resistor between output 4 and + input 1).

If you hold the shaft (which is pretty difficult without mill attached to it), you can provoke a slight current rise.

But the problem is the poor low speed performance. The motor starts to rotate at 5% PWM DC, but torque is pretty low and you can easily stall it by hand. PWM then rises with in a few seconds to 6% where you need a firmer grasp, but would still not advance the mill table. Only when you advance the speed knob further the motor turns with reasonable torque, but then it is far too fast for milling.
Not sure if this can be tuned to acceptable performance. Obvious start would be the 100 k current compensating resistor, I'll try to reduce that and see how this goes. What worries me a bit is that this circuit is peppered with filter caps. Obviously they are fitghting PWM noise, but still it looks a bit excessive.
EDIT changing this resistor did not help much...
« Last Edit: June 12, 2024, 05:15:05 pm by Martinn »
 

Offline MartinnTopic starter

  • Frequent Contributor
  • **
  • Posts: 316
  • Country: ch
Re: Brushed DC motor closed loop speed control
« Reply #22 on: June 12, 2024, 04:57:11 pm »
You can try this.

Multimeter says 4.3 ohms.
Is the resistance of the cables already subtracted?
Thanks! Looks interesting. I wonder if the opamp feedback (10k) could be from the motor instead of the FET gate? This way the opamp would remove the GS threshold.
My parts bin should be sufficient to try this out...

Resistance is with cables. But I would expect the motor resistance anyway to vary significantly depending on rotor position.
 

Offline Picuino

  • Super Contributor
  • ***
  • Posts: 1013
  • Country: es
    • Picuino web
Re: Brushed DC motor closed loop speed control
« Reply #23 on: June 12, 2024, 05:15:13 pm »
The problem with the circuit you posted earlier is that the current sense resistor is only connected for a very short time at slow speeds.
Therefore you are not really sensing current, but current multiplied by duty cycle.
For it to work properly you have to place the resistor on the positive side of the supply or sense the peak current.

That is the reason for using a P mosfet in the digital circuit with PWM that I posted earlier.


EDIT:
In addition, the sensed current should not be filtered too much, because then the control loop does not have enough speed to be able to respond to sudden current changes / motor torque changes.

With a good control circuit, it should work much better.
« Last Edit: June 12, 2024, 05:19:15 pm by Picuino »
 

Offline Picuino

  • Super Contributor
  • ***
  • Posts: 1013
  • Country: es
    • Picuino web
Re: Brushed DC motor closed loop speed control
« Reply #24 on: June 12, 2024, 05:22:03 pm »

Thanks! Looks interesting. I wonder if the opamp feedback (10k) could be from the motor instead of the FET gate? This way the opamp would remove the GS threshold.
My parts bin should be sufficient to try this out...

Yes, it could work better.
Anyway the FET resistance can be added to the motor resistance and compensated with the 1K potentiometer.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf