Motion and Position Control¶
The CLN17 utilizes the Trinamic TMC2209, a high-performance motor driver especially designed for low and mid power range stepper motors.
It operates at a supply voltage in the range of 4.75V to 29V, meeting different power requirements and delivers a continuous output current up to 1.4A per coil. It supports numerous micro-stepping control options, ranging from full-step to 1/256 of a full step resolution for precise and smooth motion. The driver can operate at high PWM frequencies up to 50kHz, enabling high-speed and silent operations while maintaining energy-efficient performance.
Moreover, it provides more precise control and tuning of the motor working conditions by supporting the following features:
- StallGuard: detects when the motor is about to stall or has already stalled, allowing the system to take appropriate actions, such as reducing motor current or triggering an alarm.
- CoolStep: dynamically adjusts the motor current based on the load, ensuring that the motor uses only the necessary amount of energy, resulting in energy-efficient operation
- StealthChop and SpreadCycle: dynamically adjusts the operating PWM frequencies and microstepping, making the motor virtually silent and reducing noise and vibration during low and high speed operations.
- MicroPlyer: achieves high-resolution micro-stepping with lower resolution input signals using micro-stepping interpolator, resulting in smoother motion and improved positioning accuracy.
The key advantage of using the specialized driver lies in the ability to improve control performance and reduce the processing load on the microcontroller, compared to the classical scheme using only a 4-channel half-bridge circuit controlled with the MCU's own power.
The CLN17 utilizes the Infineon TLE5012B - a high-speed magnetic angle sensor that offers precise angular measurement with maximum total angle error of 1.0° over sensor lifetime and temperature-range. It also features a digital interface, internal filtering options and a minimal update delay of 50µs. The key reasons that make it the best option:
- High precision: The TLE5012B provides accurate angular measurement with a 15-bit resolution of up to 0.01 degrees, ensuring precise control of motor position, even when microstepping is enabled.
- Contactless sensing: This encoder uses magnetic sensing technology, allowing it to operate without any physical contact between the sensor and the motor.
CLN17 incorporates the LSM6DSO IMU designed for high-rate (up to 6kHz) data updates with high accuracy and stability. The 3-axis accelerometer and gyroscope measure linear acceleration and rotational velocity respectively, offering a comprehensive motion monitoring. Thus, it can identify and potentially cancel vibrations that could impair system accuracy and performance and significantly contribute to safety by providing control algorithm feedback, capable of identifying and responding to emergency scenarios like unexpected motion or collisions.
Interaction of motor and position sensor¶
The motor and encoder interaction uses a 6mm diameter diametrically magnetized magnet, which is placed on the rotor shaft of the NEMA17 motor. The TLE5012B measures the magnetic field orientation and then calculates the rotor orientation relative to the chip orientation in a range of 0-360 degrees.
Failure in aligning the shaft, magnet and encoder can greatly affect the accuracy of the motor shaft position measurement.
The distance between the magnet and the chip should be within a range of 1 to 3mm. This requirement is due to the fact that the shaft of the NEMA 17 motor can move along its axis in a range of 1mm under loads applied along the shaft towards the motor's flange.
Theoretical and real positioning accuracy¶
The motor driver allows for position control down to a microstep of 1/256 (<0.01°), while the encoder has a maximum resolution of 15 bits (0.01°). Although theoretical accuracy should be close to 0.01°, it is not achievable in practice due to four factors:
- Motor imperfections: The construction of stepper motors commonly causes step size deviations of 2-5% in the degree measure.
- Step interpolation non-linearity: Increased difficulty in positioning is caused by a significant torque decrease with interpolation increase, in combination with the mechanical nonlinearities of the mechanical construction.
- Encoder imperfections: The effective resolution may be less than 15 bits due to nonlinearity of encoder measurements, variations in operating temperature, or interference with external magnetic fields.
- Magnet imperfections: The magnetic field profile created by the magnet may not rotate correspondingly to the encoder's center because of potential misalignment of the magnet and the shaft or manufacturing defects of the magnet itself.
To achieve optimal motor performance at the maximum effective resolution, it is not recommended to exceed an interpolation of 1/64 of a full step, with an optimal limit of 1/32. Exceeding these limits can lead to a significant loss in torque without any improvement in positioning accuracy, due to mechanical nonlinearities. To maintain the encoder's linearity and minimize noise, the minimum usable resolution should not exceed half of the full resolution, resulting in a maximum resolution of 14 bits.
As a result, the maximum approximately linear actual positioning resolution is 12,800 positions per revolution, and the actual position control resolution is 16,384 positions per revolution (0.02° step). Assuming this, the closed-loop system operates as expected and is capable of error-free shaft position correction.
Resolution at high speeds and loads
For high-speed or high-torque applications, it is not recommended to exceed a positioning resolution of 1/32 of a full step or 6,400 steps per revolution.