How exactly would I make a motor act like a servo in EasyC? I know I would need to use some kind of sensor like a potentiometer or an encoder. Also does anyone know how to wire a potentiometer to a PWM?
-Dustin
How exactly would I make a motor act like a servo in EasyC? I know I would need to use some kind of sensor like a potentiometer or an encoder. Also does anyone know how to wire a potentiometer to a PWM?
-Dustin
You would need to use a potentiometer or encoder depending on your use.
A potentiometer can only go so many turns and are good for arms and such.
An encoder is for continuous rotation, like drives.
Hopefully someone else can help you with the wiring.
Plug a Motor into a PWM Port.
Connect a Potentiometer between 10-100k to a Analog Input.
Wiring doesn’t matter as long as the wiper goes to the White Wire (signal)
and you connect power and ground to the other remaining pins.
Then you have to link them mechanically and write in easyC a P.I.D. loop to control the whole deal. Check the White papers in CD Media under P.I.D. .
yeah we did the same thing and it works SO WELL. it’s really awesome.
i remember talking about the programming with the team mentor and you have to use a potentiometer to input the values that you want the motor to move to. i’m pretty sure you can do it with any motor. we did it with a globe first and then a window.