beautypg.com

Testing the motor, Testing basic feedback, Tuning the pid constants – Pololu Jrk USB User Manual

Page 42

background image

1. Turn off power.

2. Connect your motor wires to the jrk’s A and B motor outputs. If possible, connect them so that positive
voltage at A causes the motor to drive forward.

3. Turn on power.

Testing the motor

1. If possible, drive your motor with feedback disabled. To do this, make sure that the Feedback mode is set to
none and use the controls on the Input tab to apply different duty cycles. Of course, this requires you to have a
system that does not destroy itself when run without feedback.

2. On the Error tab, click “Clear Errors” to remove the errors caused by turning off the power.

3. On the Motor tab, click the “Detect Motor Direction” button. This will apply some power to the motor and
measure the direction that feedback moves in response. If the motor is connected “reversed” with respect to your
feedback sensor, then Invert motor direction will be checked.

4. Click “Apply settings to device” to apply any changes.

Testing basic feedback

1. In the PID tab, choose a Proportional Coefficient of 1 and leave the other two constants at zero. This will
probably drive your motor at its maximum duty cycle, so make sure that this and other motor parameters are
configured correctly.

2. Click “Apply settings to device”.

3. Use the slider on the Input tab to send various input values to your jrk, and see how it behaves.

If you did everything correctly, your feedback system should now be active, approximately following the target value.

Tuning the PID constants

Tuning PID constants is a complicated process that can be approached in many different ways. Here we will give a
basic procedure that works for some systems, but you will probably want to try various different methods for finding
the best possible values. You will want to have the Plots window open, displaying a nice view of the Error, Target,
Scaled Feedback, and Duty Cycle. When setting the Integral Coefficient, it will also be useful to look at the value of
the Integral.

1. Increase your Max. duty cycle, Max. current, and other limits to reasonable values for high-performance
operation of your system.

2. Try increasing the Proportional Coefficient until you reach a point where the system becomes unstable. Note
that the stability could be different at different target positions, so try the full range of motion when hunting for
instability.

3. Decrease the value from the point of instability by about 40-50%. This is the first step of the

Ziegler-Nichols

Method

[http://en.wikipedia.org/wiki/Ziegler%E2%80%93Nichols_method]

.

Pololu Jrk USB Motor Controller User's Guide

© 2001–2014 Pololu Corporation

5. Setting Up Your System

Page 42 of 45