AN-024: A Tool for Calculating the Motion Parameters Used with TMC428/TMC429 Based Modules.
Many ADI Trinamic stepper motor control modules are equipped with a powerful hardware motion controller chip: the TMC428 or the TMC429. All ADI Trinamic modules use TMCL, the ADI Trinamic Motion Control Language as interface to the user. TMCL provides easy access to all TMC429 motion parameters, but does not do any conversion between the internal units of the motion controller and real world units. For this purpose, a Parameter Conversion Tool is provided, which will be explained in detail in this application note.
This tool cannot be used for modules that use the TMC457 (like the TMCM-142 and the PD-146) motion controller or software ramp generation (like the TMCM/PD-1060 or the TMCM/PD-1021). But with such modules the motion parameters can be entered directly in physical units and hence a conversion tool will not be needed then.
An overview of the tool
The Parameter Calculation Tool is included in the TMCL-IDE and is also available as a stand-alone tool. Both tools do the same parameter conversions. Both parameter calculation tools can be used for all TMC428/TMC429 based modules and also for TMC454 based modules like the Monopack 2, so one has to choose the module type when starting the tool. Both nearly look the same:
Choose the first tab for TMC428/TMC429 base modules. The stand-alone tool can be started by double clicking the file ParamCalcTool.exe, and the tool included in the TMCL-IDE can be started via the main menu (Setup/Parameter Calculation Tool).
Parameter Conversions
Motor parameters
The only (and most important) motor parameter used in this tool is the number of full steps per revolution. Most motors have 200 full steps per revolution (1.8°). This parameter is needed for many of the parameter conversions provided by this tool, e.g. converting between micro step frequency and full step frequency or converting between step frequency and revolutions per minute. This means that an incorrect value at this place will lead to many incorrect conversion results. All PANdrives are shipped with a motor with 200 full steps per revolution. Please counter-check this value with the data sheet of your motor if you are using a different motor.
TMCL Axis Parameters
In this area the parameters that can be set using the SAP command in TMCL can be entered. The TMCL parameter numbers are also given so that one can easily find the parameters. The following TMCL parameters are provided here:
- Pulse divisor (axis parameter 154): This selects the velocity range. On most modules the default value is 3. Higher values here result in lower maximum speed, but finer resolution of the velocity range.
- Velocity (axis parameter 2, 3, 4 or parameter value of ROL/ROR command): This is the motor speed, with a range of 0..2047. A higher value results in a higher speed.
- Ramp divisor (axis parameter 153) This selects the acceleration range. On most modules the default value is 7. Higher values here will result in a lower maximum acceleration, but finer resolution of the acceleration range.
- Acceleration (axis parameter 5): This is the acceleration to be used, with a range of 0..2047. A higher value results in a higher acceleration (and thus in a shorter time and way to reach the desired speed).
- Microsteps (axis parameter 140): This parameter selects the number of microsteps per full step to be used. This also influences the resulting speed and acceleration.
Conversion from TMCL to Physical Units
Clicking the Calculate button after changing any TMCL value triggers the unit conversion. For a first try, fill in the values in the TMCL Axis Parameters section. Then click the button and have a look at the conversion results in the Physical Units section. For example, leave the pulse divisor, ramp divisor and microstep parameters at their default values, but fill in the velocity and acceleration values and then click the button. Change the values, click the button again and see how the physical values behave then.
Physical Values
In the Physical Units area, the following values are shown:
- Microstep frequency (Hz): This is the motor velocity shown as microsteps per second.
- Fullstep frequency (Hz): The motor velocity shown as full steps per second.
- Revolutions per sec.: The motor velocity shown as revolutions per second.
- Revolutions per min.: The motor velocity shown as revolutions per minute.
All of these four values represent the same parameter in different units.
- Acceleration microsteps (Hz/s): This is the acceleration parameter shown as microsteps per s^2.
- Acceleration full steps (Hz/s): The acceleration parameter, given in full steps per s^2.
- Acceleration (RPS/s): The acceleration parameter, given in rounds per s^2.
- Acceleration (RPM/s): The acceleration parameter, given in rounds per minute per second.
All of these four values represent the same parameter in different units.
The last three values show a combination of velocity and acceleration.
- Time to reach velocity: This is the time needed (in seconds) to accelerate from standstill to the given velocity using the given acceleration. The same value also is the time needed to decelerate from the given velocity to standstill using the given acceleration.
- Full steps to reach velocity: The number of full steps the motor will have rotated (starting from standstill) until the given velocity has been reached using the given acceleration. The same number of full steps will also be needed to decelerate from the given velocity to standstill using the given acceleration.
- Microsteps to reach velocity: The number of microsteps needed to reach the given velocity using the given acceleration starting from standstill. The same number of microsteps will also be needed to decelerate from the given velocity to standstill, using the given acceleration.
These three values also represent the same parameter but in different units.
Conversion from Physical Units to TMCL
The velocity and acceleration parameters in the Physical Units section can also be changed. When clicking the Calculate button right after changing a Physical Units parameter, the program will convert from physical units to TMCL internal units.
But when doing so, the program will in most cases not only change the TMCL velocity and acceleration parameter but also the pre-dividers (pulse divisor and ramp divisor). It will choose a combination of pulse divisor, ramp divisor, velocity and acceleration parameter that will fit best for reaching the physical parameters chosen in the Physical Units section.
If you would not like the pre-dividers to be changed it is better to try different TMCL parameters (and convert from TMCL to physical units) until the desired physical parameters are reached.