The lowest level of motor control implements a digital feedback loop that ensures that each amplifier generates the desired current in response to a torque command from the servo code. This motor current feedback loop must be tuned for a given type of motor. Fortunately, this tuning is very simple (easier than tuning a PID loop) and the tuning is indifferent to the load placed on the motor or the operating speed of the motor. In fact, in some instances, it is more convenient to current loop tune a motor when it is sitting on a bench before it is installed in a mechanism.
The purpose of the current loop tuning is to ensure that the current flowing through the motor rises quickly, with minimum overshoot, in response to a current command. The rise time and current magnitude are a function of the electrical properties of the motor (e.g. its inductance and resistance) and not of the mechanical properties of the total drive system (e.g. motor payload and motor speed). So, once the current loop tuning parameters are established for a type of motor, the same settings can be applied to all motors of the same type independently of how they are being used.
If the motor current loop tuning parameters are set properly, the current and torque generated by a motor will rise quickly in response to a motion command. If the current loop tuning is poor, the motor can react sluggishly or the current command can significantly over-shoot the desired command and cause amplifier faults when a motor is rapidly accelerated or driven at high speed.
For each amplifier, a single set of current tuning parameters are applied to two independent current control loops, Iq and Id. For standard brushless motors, the Iq loop corresponds to the torque output of the motor. The Id loop is provided for other types of motors and typically has a set point command of 0 amps.
The current loop tuning is specified by two values in the Parameter Database as described in the following table.
Parameter Database ID | Parameter Name | Description |
---|---|---|
10656 |
Current loop proportional gain, Kp |
For both the Iq and Id control loops, the error between the commanded current and the actual current (as determined from the current feedback) is multiplied times the "Current loop proportional gain" to correct the output of the amplifier. This value is normally specific to a motor and independent of the axis in which the motor is utilized. Typical values for this parameter range from .004 to 0.04 but values outside of this range are also possible. |
10657 |
Current loop damping gain, Kv |
For both the Iq and Id control loops, the rate of change in the error between the commanded current and the actual current (as determined from the current feedback) is multiplied times the "Current loop damping gain" to correct the output of the amplifier. If this gain is increased in magnitude, the current loop becomes more stable but at the expense of having the current loop more slowly react to changes in the current command. This value is normally specific to a motor and independent of the axis in which the motor is utilized. Typical values for this parameter range from .004 to 0.4 but values outside of this range are also possible. |
To facilitate tuning the current loop for a type of motor, the controller web interface includes a special panel. This panel permits a single phase of a motor to be driven with a square wave current command at a specified % of its maximum permitted motor current. During this test, the actual current verses the commanded current is automatically captured by the Datalogger. After the test, the results can be plotted by pressing a button.
When current loop tuning a motor, it is highly recommended that the output shaft of the motor not move during the test. If the motor moves, the motor commutation compensation will generate a sinusoidal output to each motor phase. This variation in the current amplitude can mask the motor's true response to a current command. If the motor is not subject to gravity loading, the rotor and stator of the motor can be driven to align a single phase using the "twang" command. During subsequent executions of the twang command, the motor will not move since the same phase of the rotor and stator will continue to be forced into alignment. If the motor is subject to gravity loading or some other bias force, after the first twang command is executed, the motor should be locked into position using its brake or some other physical device to ensure that the motor remains stationary during the tuning process.
To tune the current loop for a type of motor, the following procedure should be executed.