Linear control of universal motor

greencardigan

Senior Member
Hello,

I have a triac phase controller circuit where I have replaced the control potentiometer with a 500K light dependent resistor coupled to a LED in a sealed tube.

I am PWMing the led to change the LDRs resistance and the universal motor's speed.

The problem is a linear change in the PWM duty cycle doesn't result in a linear change in the motor speed. I assume the sine wave, LDR and LED are all contributing to the problem.

I've experimented with some code to make linear motor speed changes with linear duty cycle changes but only had limited success.

What to do? Some sort of lookup table?
 

Dippy

Moderator
You have a number of 'variables' in addition to the motor characteristics wrt power.
Non-linearity of the LDR.
Temperature effects on LDR.
Depending how hard you are driving LED there may be some non-linearity.
I don't how good your code PWM calcs are?
What sort of frequency for your PWM ? Are you getting some funny effects at low duty.
Basically, it's not a very stable method, but should be reasonable.

Do you have feedback for speed stability or is your speed controller more of a torque/power controller?
 

greencardigan

Senior Member
No feedback from the motor. It's a very basic phase controller.

I was trying various pwm frequencies with the same result. Big motor speed changes for small duty cycle changes at low duty cycle values.

And very small motor speed changes at higher duty cycles. Virtually no speed change between 80 and 100% duty cycle.

If I can get it approximately linear I'll be happy.
 

inglewoodpete

Senior Member
Before you can move somewhere, you have to know where you are now. Ie. What are the transfer characteristics of the current setup?

My suggestion would be to add a display to the current configuration: either an LCD or the PE terminal. Configure some code to step the PWM up (Eg 0%, 5%, 10%, 15% etc) each time an input pushbutton switch is pressed. You will need some method of measuring the output power or speed of the motor: whatever the motor performance is currently measured by.

For each input value, measure the output value (performance). Then graph the transfer characteristic: spreadsheet programs make this easy.

Once plotted, you can see where you are now. As a result of the exercise, is the variation in output crowded at one end of the PWM scale? What can you then do with the software to get the performance you want?
 

papaof2

Senior Member
A universal motor is inherently a non-linear device - there is a minimum voltage+current to overcome inertia and get it to turn initially (even with no load). Once started, it will run on a lower voltage+current than the starting value.

The only way to get "linear" control is with some type of feedback (motor speed).

John
 

greencardigan

Senior Member
I have no means of accurately measuring the motor speed. I have just been listening to the motor speed.

Based on this inaccurate method, I suspect I have this relationship between PWM duty cycle and motor speed.

Code:
|                                                                           . 
|                                            .
|                           . 
|                   .
|              .
|          .
|       .
|     .
|   .
|  .
_______________________________________________________
 

ciseco

Senior Member
You could use the counter on another picaxe to count the revs, bound to be a posting where someones done it. Something like the 50p TCRT 5000 infrared sensor and a blob of tipex on the shaft would probably suffice with the lights off.

Miles
 
Assuming that the horizontal axis shows increasing duty cycle, it seems that there current in your LED might be too high. A larger series resistor will remedy that.
The nonlinearity might be somewhat counteracted by keeping the dutycycle parameter constant while varying the pwm period in the pwm-command. I haven't tried it here and now, but it might be worth trying ...
 

greencardigan

Senior Member
I have tried a series resistor ranging from 330 to 4K7.

4K7 limits the maximum motor speed. ie. the LDR resistance does not get low enough. But 4K7 does help with the low duty end.

330 gives the full range of motor speeds but with the duty cycle to motor speed relationship above.

I found about 1K gave the best compromise with minimal limiting of the max motor speed. Still nowhere near linear control though.

I'll try varying the period instead of the duty.
 

Jaguarjoe

Senior Member
Part of the problem could be from the LDR circuit. If the LDR is in series with a fixed resistor to create a voltage divider, it will be inherently non linear.

Without speed feedback everything gets tossed out the window as soon as the load changes. Sometimes there is enough noise across the armature brushes to pluck out motor speed with simple signal conditioning.
 

Janne

Senior Member
If you have spare pins on the picaxe, you could consider using the extra pins to swith between resistor values.. 4k7 for precise low range control, and 330r for full dynamic range.

If your axe is capable of bi-directional pins, then it's easy as you only need to turn the inactive resistor pins as inputs when not active. Otherwise, you will need to poke the sfr registers to turn the pins into inputs or use a transistor with the resistors to make it an open collector output.
 

greencardigan

Senior Member
The nonlinearity might be somewhat counteracted by keeping the dutycycle parameter constant while varying the pwm period in the pwm-command. I haven't tried it here and now, but it might be worth trying ...
I gave this idea a shot and it worked surprisingly well!

Control seemed fairly linear. My minimum speed was limited as changing the pwm period alone limits the duty cycle.
 

hippy

Ex-Staff (retired)
Part of the problem could be from the LDR circuit. If the LDR is in series with a fixed resistor to create a voltage divider, it will be inherently non linear.
I would suggest that is probably the main issues. How the motor responds is probably secondary to how the LED/LDR matches what the pot would be set at.

The first question would be; what was the original pot circuit, is it a linear or logarithmic pot, wired as a potential divider or a variable resistance, and what is the exact circuit which replaces it ?

I would guess all that needs to be done is create a suitable transfer function, as suggested earlier, so the software control 0%..100% produces the correct resistance as the pot would have at all the settings along the way. If the LED/LDR has a log response then an inverse-log transfer function should correct that.
 

hippy

Ex-Staff (retired)
Thanks for the circuit.

The next step is probably to connect your LED/LDR to a meter and determine what PWM is required to give it 0%, 25%, 50%, 75%, 100% resistance values, draw the graph, determine what the mathematical equation is of PWM to %, then determine the inverse.

Ideally, if the pot/1M controls 0% to 100%, you'd probably want to create a LED/LDR/whatever to allow resistances of 0R to xK which directly replaces the pot/1M, but if what you have gives the range you want and it's only the non-linearity that's perhaps not a problem.
 

Jaguarjoe

Senior Member
If you scroll down a bunch of paragraphs in that epanorama article you'll find a circuit for a voltage controlled dimmer that uses an LDR just like the circuit you have. In the "how it works" paragraph it says its not linear. If you always do what you did, you will always get what you got.

A reverse biased photodiode has an almost perfect linearity and they're cheap too. Using one of them for a reference you'll be able to graph the response of the LED and the CDS cell. Futurlec used to sell an LLS05 CDS cell substitute linear light sensor that put out a current (or voltage w/resistor) that was easy to work with. Maybe other vendors sell them. Otherwise for a bare photodiode you'll probably need an op-amp to boost its output.

Also in that epx article it says that simple dimmers should not be used with inductive loads like a motor. They recommend a 100w lamp be placed across the motor in an effort to make it work.
 
Last edited:
An LDR exhibits a very non-linear light vs. resistance characteristic, so I am delighted to hear about your progress. And some interesting ideas put forward here, might give even further improvements. Jaguarjoe's idea :
.. Sometimes there is enough noise across the armature brushes to pluck out motor speed with simple signal conditioning.
was particularly interesting, as I tried that ages ago with my old Black&Decker. And it worked quite well in an all-analogue circuit. But it took some hrs of trial-and-error to come up with a good enough filter circuit.

A completely different approach to obtain better linearity and even a simpler circuit, could be to just (bridge)rectify the AC and use a MOSFET to directly PWMfeed the motor itself. I would probably do that myself..
 

greencardigan

Senior Member
The charts below show the resistance of the LDR in parallel with the 1M pot. The 500K pot is in series with the LDR but is set to minimum resistance.

I have the 1M pot set so the maximum parallel resistance is approx 140K which gives the practical minimum motor speed.

The LDR has an 8K minimum resistance so I can't quite get to max motor speed but close enough.

So ideally, I want the parallel resistance to vary linearly from 8K to 140K with a linear change to the PWM assuming this will give a linear change in motor speed.




 
Last edited:
Top