I am trying to use a PID controller to synchronize wheel speeds in an arduino-bot so that I can get it to drive straight. I am unsure how to approach this problem without knowing the physical properties of the servo motors for the disturbance input (i.e., internal friction, moment of inertia, damping ratio). The ultimate goal of the project is to evaluate the gains of the system using transfer functions and then use MATLAB root locus features to evaluate the response & stability.

Could anyone supply me with some direction on how to get started? I have read some information on using step inputs to evaluate different parameters but do not know how exactly to do this. Tools on hand: arduino due, dc servo's with optical encoders and slotted optical wheel, MATLAB, and Simulink. Also have installed the PID & servo libraries for arduino. Thanks.

  • \$\begingroup\$ if the wheels are identical diameter, you can use a shaft encoder or if it is brushed sense RPM from current spikes. \$\endgroup\$ Nov 20 '17 at 0:14
  • \$\begingroup\$ Do you know how to calculate the speed of each motor using the encoder input? If not, start with that. Once you have that, you should work out the Kv of the motor. You can either spin it with a drill while monitoring voltage, or you can spin the motor with no load and just observe the speed and applied voltage. \$\endgroup\$
    – mkeith
    Nov 20 '17 at 1:33
  • \$\begingroup\$ @mkeith Yeah the encoder wheel has 32 slots so I am just doing the time between slots using attachInterupt command in arduino. So you are saying after finding this, I need to vary voltage and see how speed changes? How would this give me my Kv though? \$\endgroup\$
    – NLhere
    Nov 20 '17 at 2:44
  • \$\begingroup\$ In order to estimate Kv you need to know two things simultaneously. Speed and back EMF. Once you know those two things, you can calculate Kv. Ideally, current should be zero or low, because otherwise you will be measuring back emf plus-or-minus series voltage drop. \$\endgroup\$
    – mkeith
    Nov 20 '17 at 2:53
  • \$\begingroup\$ @mkeith not to sound dumb, but how would I measure the back emf across a servo? I am very new to this stuff so sometimes even the obvious things are not so to me :-( \$\endgroup\$
    – NLhere
    Nov 20 '17 at 3:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.