# cia402
Motors and Drives over a bus network
The cia402 standard lays out the datastructures that are used for communicating with a drive over a bus network. It originally came from CAN but is now used in many other field bus networks, including EtherCAT. It defines a state machine that is used to control the motor and drive. You use the control word to initiate transitions through the state machine and use the status word to view the current state.
[Explanation from KEB drives](https://www.kebamerica.com/blog/using-cia-402-drive-profile-motion-control-applications/)
## Control Word
6, 7, 15
### Status Word
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Common Numbers | | |
| ------------ | --- | ------------- | ------------- | -------------- | -------------- | -------------- | --- | ------- | --------------- | ---------- | --------------- | ----- | ------- | ----------- | ----- | -------------- | ------ | ------------- |
| Origin Found | NA | Mode Specific | Mode Specific | Internal Limit | Target Reached | Remote Control | NA | Warning | Not Operational | Quick Stop | Voltage Enabled | Fault | Enabled | Switched On | Ready | Decimal | Hex | |
| 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 1 | 1 | 1 | 1000 | 0x03E8 | Drive running |
| 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 1 | 1 | 1 | | 0x0237 | |
## Modes of operation
| Value | Abbreviation | Name | Description |
| ----- | ------------ | ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| 1 | PP | Contour Position | Point to point positioning. You need to provide the target position, speed, acceleration and deceleration and the drive calculates a trajectory. |
| 3 | PV | Profile Velocity | Speed control. You provide a target speed, acceleration and deceleration and the drive calculates the torque and speed ramps. |
| 4 | PT | Profile Torque | |
| 6 | HM | Return to Zero | |
| 8 | CSP | Cyclic Synchronized Position | |
| 9 | CSV | Cyclic Synchronized Velocity | |
| 10 | CST | Cyclic Synchronized Torque | |
## PP Point to Point Positioning
You need to
- Select the PP operation mode by writing a value of 1 to the "Mode of Operation" (0x6060) parameter
- make the drive operational using the control word. Giving it values of 6, 7 and then 15 so that it will put voltage onto the motor.
- Set the motion parameters
- 0x607A Target Position → absolute or relative target (counts or user units).
- 0x6081 Profile Velocity → how fast it ramps.
- 0x6083 Profile Acceleration
- 0x6084 Profile Deceleration
- Choose Absolute vs Relative move (Object 0x607A (Target position) is interpreted based on bit 6 in the control word)
- 0 = absolute
- 1 = relative
- Trigger the move
• Write the target position to (0x607A).
• Then toggle the New Set-point bit in the control word (bit 4). Write 31 to 0x607A.
• Set bit 4 = 1, then back to 0 (edge-trigger).
• Optionally set bit 5 (“Change Set Immediately”) depending on how you want buffering to behave.
The drive should then calculate a motion profile and move to the target position.
## PV Speed mode