PWM Help

Andrei IRL

Senior Member
Hello everyone.

I have the need to accurately control the speed of a DC Motor.

I'll be using PICAXE at 4Mhz.

The motor itself is rated for 5.3 RPM @24V through the use of a gearbox.

I need to run the motor at 3 RPM, so 56.6% duty cycle.

Is the code below correct to achieve that?

Many thanks in advance.

Code:
 PWMOUT C.2, 254, 580

Scrap that lads, i have found Wizard in Picaxe editor.
 

hippy

Technical Support
Staff member
While motor speed should be proportional to PWM duty; that may not be entirely linear so you might have to tweak things depending on how accurate you want it.

Because you may have to adjust frequency to suit the motor and the way PWM works anyway, you may not get the exact desired duty so it may be necessary to switch between two or more different duties to get things to average out.

It might be worth adding some opto-feedback and some primitive PID functionality so you can adjust PWM to give the desired output.

For such slow rotation a stepper motor would probably be more suitable.
 

Andrei IRL

Senior Member
While motor speed should be proportional to PWM duty; that may not be entirely linear so you might have to tweak things depending on how accurate you want it.

Because you may have to adjust frequency to suit the motor and the way PWM works anyway, you may not get the exact desired duty so it may be necessary to switch between two or more different duties to get things to average out.

It might be worth adding some opto-feedback and some primitive PID functionality so you can adjust PWM to give the desired output.

For such slow rotation a stepper motor would probably be more suitable.
Thanks very much hippy.

I am considering a stepper motor as well at the moment to be honest.

Thanks very much for the advice.

Its very much appreciated as always.
 

goom

Senior Member
Even if you calibrate the PWM to speed at a single point in time, I think that you may see drift in speed over time. Such things as motor temperature, ambient temperature, brush wear, bearing wear, load variation and power supply stability could all affect motor speed. You did not specify the required RPM accuracy, so some drift may be acceptable to you.
I agree with Hippy, a stepper motor or DC motor with speed feedback would be the way to go.
 

hippy

Technical Support
Staff member
Could i use Oscilloscope to precisely adjust the PWM hippy?
You can, but the main problem there comes in not knowing exactly what the PWM duty has to be in the first place to get a particular output rotation rate.
 
Top