misan / dcservo

Position control of DC motors
315 stars 115 forks source link

setting of P, I, D? #49

Open dnshvra opened 6 years ago

dnshvra commented 6 years ago

how can set best value of P, I, D for current motor? and i use gearbox for DC motor, the best place for rotary encoder, connect after gearbox or direct connect to motor?

misan commented 6 years ago

Setting PID can get tricky. Initially focus only on setting P so you get a low error response: error too high, increase P value till it is ok.

If encoder is placed after the gearbox you can compensate for backslash (but it can be more prone to oscillation). If placed in the motor shaft you'll have a higher angular resolution.