A stepper motor is a device that converts electrical pulse signals into angular or linear displacement. Under normal operating conditions, the speed and distance traveled by a stepper motor depend on the frequency and number of control electrical pulses.
Its control accuracy is mainly determined by two factors:
1. Step accuracy of a stepper motor : Taking a 2-phase hybrid stepper motor as an example, a 200-step stepper motor without microstepping has a single step distance of 360°/200 = 1.8°. This means the minimum distance the stepper motor can travel in a single step is 1.8°. However, in practical applications, the step size is usually subdivided. For example, with 2 microsteps, two steps are equivalent to one step previously, so the single step distance is now 360°/(200*2) = 0.9°. Similarly, with 4 microsteps, the single step distance is 360°/(200*4).
=0.45°; with 8 microsteps, the single step distance is: 360°/(200*8)=0.225°; with 16 microsteps, the single step distance is: 360°/(200*16)=0.1125°; with 32 microsteps, the single step distance is: 360°/(200*32)=0.05625°. Therefore, the formula for calculating the single step angle of a stepper motor under microstepping is: 360/(stepper motor's inherent number of steps * microsteps).
Therefore, to reduce the step angle of a stepper motor to achieve higher precision, two approaches are needed: first, improve or use stepper motors with a higher inherent step count to obtain a smaller step angle, such as 0.9°; second, increase the degree of step subdivision.
2. Calculation Accuracy: When controlling a stepper motor, the calculation system must ensure that the accuracy of converting the angular or linear displacement into the number of steps is higher than the accuracy per step of the stepper motor. For example, if the step angle of each stepper motor step is 0.1125°, and the required angular displacement is 143.45°, the number of steps should be 143°/0.1125°, resulting in 1275.11... steps. The actual result is 1275 steps, and the movement error is 0.11111 * 0.1125.
=0.0125°. However, if the angular displacement is calculated in units of 1°, then 143.45° = 143°, and the decimal part is discarded. 143/0.1125 = 1271.1111 steps. Therefore, comparing the previous movement, the error is: (1275 - 1271) * 0.1125°
=0.45°. The reason for this is that in embedded systems, due to data type limitations, if float or double is not used for calculations, the decimal part is generally discarded, resulting in a large calculation error.