Motion command (multiple)

With multiple path control, up to 16 position values, 16 velocities (from firmware 3E) and 16 accelerations (from firmware 3E) are specified for the terminal, which are stored internally in different tables. A position is comprised of two registers, which are stored in registers R32 to R63 of register page 2. Each of these position values may only deviate from the current position by up to +/- 231 positions increments. The PLC can read the current position from registers R0 and R1. The velocities are stored in registers R32 to R47, the accelerations in registers R48 to R63 on register page 3.
During an active motion command the controller can parameterize the terminal for the next motion command (except R39 and R40, which are overwritten when the next motion command starts). The new parameters are stored in the RAM section of the terminal (the code word register must be cleared for this purpose!).

A multiple motion command is started by writing into register R7

  • with command 0x0500 (the internal position index is incremented after each motion command until position 15 is reached, i.e. the table is processed in forward direction), or
  • with command 0x0510 (the internal position index is decremented after each motion command until position 0 is reached, i.e. the table is processed backwards).

The start position is specified by adding an offset to command code 0x0500 or 0x0510 (e.g. 0x0504 -> start position 4 forward; 0x0518 -> start position 8 backward). A multiple motion command can be stopped with the command 0x0540. The procedure is described in more detail in the sample below.

Up to 16 possible target positions can be specified in the following registers:

  • RP2.R32: Target position 0 (low-order word)
  • RP2.R33: Target position 0 (high-order word)
  • RP2.R34: Target position 1 (low-order word)
  • RP2.R35: Target position 1 (high-order word)
  • etc.

Up to 16 possible velocities can be specified in the following registers:

  • RP3.R32: velocity 0
  • RP3.R33: Velocity 1
  • etc.

Up to 16 possible accelerations can be specified in the following registers:

  • RP3.R48: Acceleration 0
  • RP3.R49: Acceleration 1
  • etc.

The following registers can be re-parameterized for meaningful and effective motion with multiple positioning:

Sample

In the following sample a multiple motion command is started at index 5, after which three positions are approached (positions 5, 6 and 7). The internal position index is then set to 3 set, and two positions are approached (positions 3 and 2). The multiple motion command is then stopped.

  1. Enter the target positions (max. 16 positions, each 32 bit) in registers RP2.R32 to RP2.R63 using register communication.
  2. Set bit CB.0 of the control byte to 1bin, in order to enable the motor control.
  3. Enter the other parameters in registers RP0.R37, RP0.R38, RP0.R39, RP0.R40 and RP0.R58 (all register page 0) via register communication, if these are to be re-parameterized.
  4. The process output data DataOUT now have to be zero for the motion command to be started.
  5. Enter the start command 0x0505 (0x0500 + offset 5) in register R7 via register communication, in order to set the internal position index to position 5 as the first target position.
  6. In the control byte set bit CB.2 to 1bin to start the first motion command.
  7. The stepper motor terminal will now independently move the motor to the target position. Leave bit CB.2 set to 1bin until the motor has reached the desired position. If the motion command is aborted, reset bit CB.2 to 0bin.
  8. During the active motion command enter the new parameters in registers R37, R38, R39, R40 and R58 via register communication, if they are to be modified.
  9. The terminal now signals reaching of the target position by setting bit SW.3 of the status word to 1bin.
  10. Deleting bit CB.2 in the control byte completes the first motion command.
  11. The terminal acknowledges this by resetting bit SW.3 to 0bin. The position index is automatically incremented by one position (to position 6).
  12. In the control byte set bit CB.2 to 1bin to start the second motion command.
  13. Cancel bit CB.2 in order to complete the second motion command, once the terminal has signaled that position 6 has been reached by resetting bit SW.3 to 0bin.
  14. Set bit CB.2 to 1bin to start the third motion command.
  15. Cancel bit CB.2 in order to complete the third motion command, once the terminal has signaled that position 7 has been reached by resetting bit SW.3 to 0bin.
  16. Enter the start command 0x0513 (0x5100 + offset 3) in register R7 via register communication, in order to set the internal position index to position 3 as the next target position.
  17. Set bit CB.2 to 1bin to start the fourth motion command.
  18. Cancel bit CB.2 in order to complete the fourth motion command, once the terminal has signaled that position 3 has been reached by setting bit SW.3. The position index is automatically incremented by one position (to position 2).
  19. Set bit CB.2 to 1bin to start the fifth motion command.
  20. Cancel bit CB.2 in order to complete the fifth motion command, once the terminal has signaled that position 2 has been reached by setting bit SW.3.
  21. Enter the Stop command 0x0540 in register R7 via register communication to stop the 'multiple' motion command.