Best way to control rotation of motor?
dustya65
Posts: 2
I am using an electric motor for a school project and am tyring to figure out how to control the rotation of a motor. I want it to rotate half a rotation. I have an encoder already wired into the basic stamp, and have a program that reads the position of the motor. I have a couple of h-bridges available that have brake, dir, pwm commands on them. Anyone have any ideas to help me out?
Comments
forward pin 5
reverse pin 6
go_forward:
low pin6 'disables reverse pair
high pin 5 'enables forward pair
return
go_reverse
low pin5 'disables forward· pair
high pin·6 'enables reverse pair
return
Make sure to buffer the stamp pins to the hbridge I use 2N3904
after the motor starts moving read the encoder until 1/2 rotations. you have to know where the motor is starting from.