Precise control of DC Motor

Any hardware type questions or problems for all other Phidget devices.
Fresh meat
Posts: 1
Joined: Sun Feb 12, 2012 6:56 am

Precise control of DC Motor

Postby valban » Sun Feb 12, 2012 7:19 am


I've a 1065 controller with 3530 encoder and a 3268 motor.
Everything is connected and working...

Is it possible to control the motor position with the encoder?
I would like to chose the position precisely (like a stepper)

Is the setVelocity method the only one way to make the motor turning?

Thanks for the answer.

Posts: 32
Joined: Sun Jun 05, 2011 5:15 am

Re: Precise control of DC Motor

Postby mrbencowell » Mon Feb 13, 2012 8:15 am


I'm currently working on a controller for my DC motor. As the manual states you can create a PID controller, which can be used to control position and / or velocity. I'm moving fairly slowly as I want to be sure I don't over complicate the solution .. so I started out by setting the velocity and then running a while loop that watches the encoder position and then stops the motor once it has reached it's position. This obviously overshoots the position everytime.

So I'm now building on what I discovered and building a trapezoidal motor controller that accelerates, slews and then decelerates the motor. Read this link for the details :

I'm hoping this motion planning technique might be enough for my situation. If not then I'll work on a PID controller .. for which there's quite a lot of information on the web :

If you find any other solutions then please share, as it seems to be a topic that many people including myself are struggling with.

My issue is that I'm running two servos at the same time as the DC motor, and I need them all to work in tandem and sync .. which is stretching my abilities !.


Return to “All Other Phidgets”

Who is online

Users browsing this forum: No registered users and 1 guest