Motor Commands – TML Programming Details

You can apply one of following commands to the motor:

Activate/deactivate the control loops and the power stage PWM output commands (AXISON / AXISOFF)
Stop the motor with deceleration set in TML parameter CACC
Issue an update command, immediate (UPD) or when a previously programmed event occurs (UPD!)
Change the value of the motor position and position reference

The AXISON command activates the control loops and the PWM output commands.  After power on, the AXISON command has to be executed after the ENDINIT (end of initialization) command.

Remark: You may set the first motion mode either before or after the AXISON command. If the first AXISON is executed before setting the motion mode, the drive/motor enters in the default motion mode: voltage external online with voltage reference zero. Therefore, the drive gets zero voltage commands, until you’ll set a new motion mode. If you first set a motion mode, followed by update UPD and then activate control with AXISON, the drive/motor enters directly in the desired motion mode.

The AXISON command may be used to restore the normal drive operation following an AXISOFF command. Typically, this situation occurs at recovery from an error, following the fault reset command FAULTR, or after the drive/motor ENABLE input goes from status disabled to status enabled.

When AXISON is set after an AXISOFF command, the reference generator resumes its calculations from the same conditions left when the AXISOFF command was executed.  As consequence, the values of the target position and speed provided by the reference generator may differ quite a lot from the actual values of the load position and speed which continue to be measured during the AXISOFF condition. In order to eliminate these differences:

Set the motion mode, even if it is the same. The motion mode commands, automatically set the target update mode zero (TUM0), which updates the target position and speed with the actual measured values of the load position and speed
Execute update command UPD
Execute AXISON command

Example: A motor controlled in speed with a trapezoidal profile, was stopped with an AXISOFF command. In order to resume the normal operation, with the same parameters, the TML program can be:

// Resume speed profile operation from AXISOFF

MODE SP;        // set speed profile mode

UPD;                // update immediate

AXISON;        // motion starts.

//The initial value for target speed is 0 because was

//updated with the actual motor speed which is 0

//because the motor is still

The AXISOFF command deactivates the control loops, the reference generator and the PWM output commands (all the switching devices are off). However, all the measurements remain active and therefore the motor currents, speed, position as well as the supply voltage continue to be updated and monitored. If the AXISOFF command is applied during motion, it leaves the motor free running. Typically, the AXISOFF command is used when a fault condition is detected, for example when a protection is triggered.

Fault conditions trigger TML interrupts. Each drive/motor has a built-in set of TML interrupt service routines (ISR), which are automatically activated after power-on. In these routines, the default action for fault conditions is an AXISOFF command. If needed, you may replace any built-in ISR with your own ISR and thus, adapt the fault treatment to your needs.

Remark: The AXISOFF command is automatically generated when the Enable input goes from enabled to disabled status. If the Enable input returns to the enabled status, the AXISON command is automatically generated if

ACR.3 =1, or
ACR.1 = 1 i.e. the drive/motor is set to start automatically after power-on with an external

Remark: SRL.15 shows the AXISON/AXISOFF condition and SRH.15 shows a fault condition

The STOP command stops the motor with the deceleration rate set in TML parameter CACC. The drive/motor decelerates following a trapezoidal position or speed profile. If the STOP command is issued during the execution of an S-curve profile, the deceleration profile may be chosen between a trapezoidal or an S-curve profile (see S-curve dialogue settings). You can detect when the motor has stopped by setting a motion complete event ( !MC )and waiting until the event occurs ( WAIT! ). The STOP command can be used only when the drive/motor is controlled in position or speed.

Remarks:

In order to restart after a STOP command, you need to set again the motion mode. This operation disables the stop mode and allows the motor to move
When STOP command is sent via a communication channel, it will automatically stop any TML program execution, to avoid overwriting the STOP command from the TML program

If an error requiring the immediate stop of the motion occurs (like triggering a limit switch or following a command error), the drive/motor enters automatically in the quick stop mode. This mode stops the motor with a trapezoidal profile, using the deceleration rate set in the TML parameter CDEC.

When an immediate update command UPD is executed, the last motion mode programmed together with the latest motion parameters are taken into consideration. During motion execution, you can freely change the motion mode and/or its parameters. These changes will have no effect until an update command is executed.

If you intend to perform an update when a specific condition occurs, you can set an event which monitors the condition, followed by an update on event command UPD!. When the monitored condition occurs, the update will be automatically performed. Once you have set an update on event UPD!, you can either wait for the monitored event to occur, or perform other operations.

The TML command SAP offers you the possibility to set / change the referential for position measurement by changing simultaneously the load position APOS and the target position TPOS values, while keeping the same position error.

You can specify the new position either as an immediate value or via a 32-bit long variable. SAP command can be executed at any moment during motion. When SAP command is executed, the following operations are performed:

Under TUM1, i.e. if TUM1 command has been executed after the last motion mode setting and before the last UPD, the target/reference position TPOS is set equal with the new position value and the actual motor position APOS is set equal with the new position reference minus the position error (POSERR)

TPOS = new_value;

APOS = TPOS – POSERR;

Under TUM0, i.e. if TUM1 command has not been executed after the last motion mode setting and before the last UPD, the actual load position APOS is set equal with the new position value and the target/reference position TPOS is set equal with the new position plus the position error (POSERR)

APOS = new_value;

TPOS = APOS + POSERR;

The TML command STA sets the target position equal with the actual position: TPOS = APOS.

See also:

Motor Commands – Related TML Instructions and Data

TML Description