1. Initialize parameters
Initialize the parameters before wiring.
On the control card: Select the control mode; clear the PID parameters; ensure the enable signal is off by default when the control card is powered on; save this state to ensure that the control card is in this state when it is powered on again.
On the servo motor: Set the control mode; enable external control; set the gear ratio of the encoder signal output; set the ratio between the control signal and the motor speed. Generally, it is recommended that the maximum design speed of the servo motor correspond to a control voltage of 9V. For example, Panasonic sets the speed to 1V, with a factory value of 500. If you only intend for the motor to operate below 1000 RPM, then set this parameter to 111.
2. Wiring
Power off the control card and connect the signal lines between the control card and the servo. The following lines are mandatory: the analog output line of the control card, the enable signal line, and the encoder signal line output by the servo. After verifying that the wiring is correct, power on the motor and the control card (and PC). The motor should not move at this point and can be easily rotated with external force. If not, check the enable signal settings and wiring. Rotate the motor with external force to check if the control card can correctly detect changes in motor position; otherwise, check the encoder signal wiring and settings.
3. Try the direction
For a closed-loop control system, if the direction of the feedback signal is incorrect, the consequences will be disastrous. Enable the servo via the control card. The servo should then rotate at a low speed; this is the so-called "zero drift." Control cards typically have instructions or parameters to suppress zero drift. Use these instructions or parameters to see if the motor's speed and direction can be controlled. If not, check the analog wiring and control mode parameter settings. Confirm that a positive value results in the motor rotating forward and the encoder count increasing; a negative value results in the motor rotating backward and the encoder count decreasing. Do not use this method if the motor is under load and has limited travel. Do not apply excessive voltage during testing; below 1V is recommended. If the directions are inconsistent, modify the parameters on the control card or motor to make them consistent.
4. Suppress zero drift
In closed-loop control, zero drift can negatively impact control performance, and it's best to suppress it. Carefully adjust the zero drift suppression parameters on the control card or servo motor to bring the motor speed close to zero. Since zero drift itself has a degree of randomness, it's not necessary to require the motor speed to be absolutely zero.
5. Establish closed-loop control
Re-enable the servo enable signal via the control card. Input a small proportional gain on the control card; what constitutes "small" is subjective and can be determined by feel. If unsure, input the minimum value allowed by the control card. Enable the control card and the servo again. At this point, the motor should be able to roughly perform movements according to motion commands.
6. Adjust closed-loop parameters
Fine-tuning the control parameters to ensure the motor moves according to the control card's instructions is a necessary task, and this part relies heavily on experience, so we'll skip the details here.