1. Initialize parameters
Before wiring, initialize the parameters.
On the control card: select the control mode, reset the PID parameters to zero, enable the signal off by default when the controller card is powered on, and save this state to ensure that the controller card is powered on again.
On the servo motor: set the control mode, set the enable to be controlled by the external one, the gear ratio of the encoder signal output, and set the proportional relationship between the control signal and the motor speed. In general, it is recommended that the maximum design speed of the servo operation correspond to the control voltage of 9V. For example, if Sanyo sets the speed corresponding to 1V voltage, and the factory value is 500, if you only want the motor to work below 1000 rpm, then set this parameter to 111.
2. Wiring
Power off the control card and connect the signal line between the control card and the servo. The following cables must be connected: the analog output line of the control card, the enable signal line, and the encoder signal line of the servo output. After checking that there are no errors in the wiring, the motor and control card (and PC) are powered on. At this point, the motor should not move and can be easily rotated with external force, if not, check the settings and wiring of the enable signal. Rotate the motor with external force, check whether the control card can correctly detect the change in the position of the motor, otherwise check the wiring and setting of the encoder signal.
3. Test the direction
For a closed-loop control system, if the feedback signal is not oriented correctly, the consequences are certainly catastrophic. Turn on the servo's enable signal via the control card. At this time, the servo should rotate at a lower speed, which is the legendary "zero drift". Generally, there will be instructions or parameters on the control card to suppress zero drift. Use this command or parameter to see if the speed and direction of the motor can be controlled by this command (parameter). If it cannot be controlled, check the parameter settings of the analog wiring and control mode. Confirm that a positive number is given, the motor is rotated forward, and the encoder count is increased, and a negative number is given, and the motor is reversed, and the encoder count is reduced. If the motor is loaded and has a limited stroke, do not use it this way. Do not give excessive voltage for the test, it is recommended to be below 1V. If the orientation is inconsistent, the parameters on the control card or motor can be modified to make them consistent.
4. Inhibit zero drift
In the process of closed-loop control, the existence of zero drift will have a certain impact on the control effect, and it is best to suppress it. Use the parameters on the control card or servo to suppress zero drift and carefully adjust the speed of the motor to close to zero. Since zero drift itself also has a certain randomness, it is not necessary to require the motor speed to be absolutely zero.
5. Establish closed-loop control
Again through the control card to release the servo enable signal, on the control card input a small proportion of gain, as for how small is small, this can only be felt, if you are really not at ease, enter the minimum value that the control card can allow. Turn on the enable signals of the control card and servo. At this point, the motor should be able to roughly act according to the motion commands.
6. Adjust closed-loop parameters
Fine-tune the control parameters to ensure that the motor moves according to the instructions of the control card, which is a work that must be done, and this part of the work, more experience, can only be omitted here.

