1. Initialization parameters
Before wiring, initialize the parameters.
On the control card: select the control mode; clear the PID parameters; let the default enable signal be off 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; set the enable to be controlled externally; the gear ratio of the encoder signal output; set the proportional relationship between the control signal and the motor speed. Generally speaking, it is recommended that the maximum design speed in servo work corresponds to a control voltage of 9V. For example, UIMOTION is to set the speed corresponding to 1V voltage. 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 lines 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 rechecking that there is no error in the wiring, power on the motor and control card. At this point, the motor should not move, and can be rotated easily with external force, if not, check the setting and wiring of the enable signal. Use external force to rotate the motor, check whether the control card can correctly detect the change of the motor position, otherwise check the wiring and setting of the encoder signal
3. Test direction
For a closed-loop control system, if the direction of the feedback signal is incorrect, the consequences must be disastrous. Turn on the enable signal of the servo through the control card. This is the servo should rotate at a lower speed, which is the legendary “zero drift”. Generally, there will be instructions or parameters to suppress zero drift on the control card. Use this command or parameter to see if the speed and direction of the motor can be controlled by this command. If it cannot be controlled, check the analog wiring and the parameter setting of the control mode. Confirm that a positive number is given, the motor rotates forward, and the encoder count increases; when a negative number is given, the motor rotates counterclockwise, and the encoder count decreases. Do not use this method if the motor has a load and limited travel. Do not give too much voltage for the test, it is recommended to be below 1V. If the directions are inconsistent, you can modify the parameters on the control card or motor to make them consistent.
4. Suppress zero drift
In the closed-loop control process, 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 adjust carefully so that the speed of the motor approaches zero. Since the zero drift itself also has a certain degree of randomness, it is not necessary to require the motor speed to be absolutely zero.
5. Establish closed-loop control
Release the servo enable signal through the control card again, and input a small proportional gain on the control card. As for how small it is, it can only be based on feeling. If you are really worried, input the minimum value allowed by the control card. value. Turn on the enable signal of the control card and servo. At this time, the motor should be able to roughly move according to the motion command.
6. Adjust closed-loop parameters
Fine-tuning the control parameters to ensure that the motor moves according to the instructions of the control card is a necessary work, and this part of the work is more about experience, so it can only be omitted here.