Version: 1.0.0
1. Introduction
Modbus gives read/write access to all Cool Muscle registers such as K-parameters, positions, speeds and accelerations. A CML program needs to reside in the motor to execute functions depending on the status of these registers. Below you will find an example program that is used in all Modbus-TCP motors. It uses a control word in the R1 register to execute a number of functions. This code is useful for point-to-point motion and speed control. An application may require a significantly more complex program which can replace the example program. The CML is written to be compiled and sent from Control Room. The user does not need to understand the code but only how to use it. The full program code is supplied for those users wanting to change or get a better understanding of how the program works. Modbus-TCP motors come standard with the Modbus program loaded.
2. Running the motor
The following list of holding registers can be used to the read and write move data to the motor.
Holding Register | Parameter | Description | R/W |
---|---|---|---|
40201 | P1 | Target position | R/W |
40605 | S1 | Target speed | R/W |
40637 | A1 | Target acceleration | R/W |
40301 | R1 | Control Word | R/W |
40003 | Motor Position | Motors current position in pulses | R |
40009 | Motor Status | Motors current status | R |
2.1. Position, Speed and Acceleration
The default setting for the motor is K37=3 which sets the following units. This can easily be changed by modifying the value of K37.
Register | Unit/Resolution |
---|---|
P1 | 1000 pulses/revolution |
S1 | 100 pulse/s |
A1 | 1K pulses/s2 |
2.2. Control Word
The R1 register is used for the Control Word. It has the following value options
R1 Value | Description |
---|---|
0 | Do nothing |
1 | Start the position move |
2 | Stop the motor |
3 | Enable the motor |
4 | Disable the motor |
5 | Home the motor |
Some things to note when using the control word
- Changing the value of the control word immediately executes the operation
- If the Control Word is left with the value 1 then changing the position once the motor has come to a stop will execute the next move. This allows the Modbus master to only change the position and not need to also toggle the control word to execute the next move.
- The home routine is by default set to a hardstop search in the CCW direction. Please see K42 to K48 for home routine options.
3. CML