Shop OBEX P1 Docs P2 Docs Learn Events
encoder and motor control — Parallax Forums

encoder and motor control

Jen HJen H Posts: 3
edited 2006-07-19 22:31 in BASIC Stamp
This is my first project so I need a little help with the connections.
·
I am using an encoder to generate pulses to the bs2.· Then, I am using the count instruction to count the incoming pulses.
·
I have a motor control connected to the stamp as well.· I am using the PWM instruction to send out the correct voltage to the motor.·
·
Based on the number of pulses, I want to be able to adjust the motor speed.· The problem I am having is the PWM output that controls the motor is connected to a capacitor and resistor (like the one in the help guide).· So in order to send a steady voltage to the motor, I would have to refresh the PWM quite often.· Since I am getting pulses from the encoder, is there a way I can send those pulses to the motor control so that the motor can stay on?· I guess this is some kind of feedback loop, but I am having trouble with the connections.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2006-07-19 22:31
    The PWM command (and the Stamp in general) is not designed to provide power to something like a motor. The PWM can, with the filter (resistor and capacitor), control the voltage on the capacitor. The trick is that you need a voltage controlled amplifier that senses the voltage without putting a drain on the capacitor and puts out a corresponding voltage with plenty of drive capability (current output). Typically an op-amp is used to drive a power transistor which provides the power switching for the motor itself. If you have some experience in electronics, go for it. If not, you might be better buying a motor controller. There is one in the Parallax Store. There are others available from hobby robotics suppliers. A lot depends on the power requirements of your motor.
Sign In or Register to comment.