motor speed control using potentiometer
coderbad
Posts: 29
Hi Friends
I want to make a motor speed control using a potentiometer, only the speed of the motor
someone know how I can do it?
Thanks
I want to make a motor speed control using a potentiometer, only the speed of the motor
someone know how I can do it?
Thanks
Comments
Reading the value of a potentiometer is easy. You can use it as a voltage divider and read the voltage using two I/O pins and a couple of capacitors and fixed resistors ... look at the application note on the cog counters (AN001) which discusses this and includes code examples. You can also use a capacitor with the potentiometer and measure the charge / discharge time. Look at the BS2 Functions object in the Propeller Object Exchange for the RCTIME method which shows how to do this.
Look in the Motor Control section of the Propeller Object Exchange for a variety of motor drivers for DC motors, stepper motors, and even servo motors. Read their description (usually at the beginning of their source code) and pick one or more to try.
http://www.ebay.com/itm/Multi-Servo-Tester-3CH-ECS-Consistency-Master-Checker-Speed-Controler-CCPM-SS-/321463863858
If your motor isn't a continuous rotation servo but a DC motor you could still control it with the same device if you use a HB-25 motor controller.
https://www.parallax.com/product/29144
As I mentioned earlier, this will control the power to the motor. The speed of the motor will depend on both the power to the motor and the load on the motor. In order to control the speed of a DC motor you really need encoders of some sort.
As Mike said, you'll need some way of controlling the power to the motor. I have a tutorial about using L298N h-bridges here:
http://forums.parallax.com/showthread.php/156410-How-To-Use-a-L298N-Dual-H-Bridge-with-a-Microcontroller-(QuickStart-Board)
I used the inexpensive L298N h-bridges in the tutorial but the principles apply to other H-bridges.
I posted a video of my robot using encoder feedback to post #41 of the OPP#8 thread:
http://forums.parallax.com/showthread.php/158030-Open-Propeller-Project-8-Eddie-Firmware-Ported-to-Propeller-Activity-Board?p=1308338&viewfull=1#post1308338
It shows and example of controlling speed using encoder feedback.