Will it cause position overflow if NC axis continuous unidirectional movement?



Q: For conveyor belts, they always move in one direction continuously.Will the NC axis position overflow after a long period of work?
A: There is a mathematical possibility of this, but it is never likely to happen in practice.Here are two ways to analyze the possibility of a position overflow:
1. From the type of location variables.
If the motor continues to move at high speed in one direction, how long will it take for the position to overflow?The answer is: over 10,000 years.
In TwinCAT NC, position is a long real number LREAL, also known as a floating point number.A floating point number consists of three parts: sign bit S, exponent part E (order code), and mantissa part M.
The single-precision floating-point number in TwinCAT is called REAL, which occupies 4 bytes of 32 bits.The mantissa is stored in 23 bits, plus one hidden 1 before the decimal point (IEEE754 convention number representation), 2^(23+1) = 16777216.Because 10^7 < 16777216 < 10^8, the effective number of bits for a single-precision floating-point number is 7.Considering the possible rounding problem in the seventh bit, there are at least 6 significant digits (minimum size) for a single-precision floating-point number.
In TwinCAT, double-precision floating-point numbers are represented as LREAL, which occupies 8 bytes of 64 bits.The mantissa is stored in 52 bits, and 2^(52+1) = 9007199254740992. 10^16 < 9007199254740992 < 10^17, so the effective number of bits for double precision is 16.Considering the possible rounding problem in the 16th bit, there are at least 15 significant digits for double precision.
So, the larger the numerical value of a real number, the lower the resolution.For LREAL, the effective bit is 16 bits, representing 1016, and the resolution is less than or equal to 1.If a value is 1017, the resolution is less than or equal to 10, and so on. Therefore, it is difficult for real numbers to be absolutely equal, and it is only possible to determine the difference within a certain range. For example, in PLC, when the variable value is greater than 1016, it is impossible to recognize increments within 1.0.
Assuming 3000rpm as an example, one circle is 360 degrees.Considering its extreme motion, running at full speed for 24 hours a day, its position increment is: 3000*360*60*24=1.5552*109 degrees.Running at full speed for one year, the distance is: 5.6648*1011 degrees.
The distance that the motor can move at its maximum speed for 100 years is 5.6648*1013 degrees.
At this time, the position resolution can still reach 10-3 degrees, which is more than enough for engineering applications.
2. Analyze the pulse increment from the position feedback.
In the position feedback link, how long will it overflow?The answer is: more than 5000 years.
We know that the position feedback sent back to TwinCAT by either a servo drive through a bus or an encoder module can only be up to 4 bytes (32 bits).With the most common single-cycle 20-bit feedback, the position feedback increment is 220 for one rotation of the motor. After the motor rotates 212 or 4096 cycles, the original value sent by the encoder will overflow.For a 3000rpm motor, it is a full-speed operation for more than a minute.
To avoid overflowing the position in less than a minute, TwinCAT NC uses a 32-bit integer internally to record the number of revolutions of the original feedback value, which can record +-231 revolutions.This allows a maximum feedback increment of +-263, allowing the motor to operate at a speed of 3000 rpm in one direction for 2932027396 minutes without overflowing, equivalent to 5578 years.