Posts: 186
Joined: Wed Nov 26, 2014 5:13 pm

solid pwm for motor

Sat Oct 20, 2018 11:57 pm

Hello, I need a rock-solid (hardware PWM) for precise motion control, at only 1800-1980 Hz at the pin. Really it only needs to be 50% at all times.
My understanding is just using some random I/O pin for PWM may give a lot of jumping (I have seen it myself) due to creating it in software, rather than a timer register. It appears I/O 12 is good for hardware/solid pwm, but what library will drive it as a hardware wave (rather than software)? Which packages are software only? I haven't seen it stated one way or the other.

Also I have another PWM device on GPIO22...what is the best I can do there? need about 1500Hz, 50%

User avatar
Posts: 8045
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: solid pwm for motor

Sun Oct 21, 2018 6:33 am

Have a look at the pigpio library. http://abyz.me.uk/rpi/pigpio/

The developer/maintainer is a regular contributor to these forums and is very well informed about this topic.

User avatar
Posts: 289
Joined: Mon Nov 12, 2012 10:22 pm
Contact: Website

Re: solid pwm for motor

Sun Oct 21, 2018 11:34 am

The atmega2560 has no problem running 10 hardware PWMs at a time. (I have used these to run several DRV8833 at a time)

If you are looking for a half/full h-bridge driver, than the pic18f4550 has a special pwm that handles this task (10bit precision if I recall).

Best of luck,

Return to “General discussion”