# Circle move

```
{"cmd":"cmove", ...}
```

This command moves the robot toolhead on a circle from a starting point to a final point by passing through a midpoint, for a number of turns with a certain velocity, acceleration, and jerk. An optional parameter `space`

, specifies whether the circle is drawn in Cartesian space (default) or in joints space. Another optional parameter `dim`

, defines the dimension of the circle. If `dim`

is set to a number `k`

, only the first `k`

coordinates will form the circle and the remaining coordinates will move on a line that connects the initial point and final point. As a result, only the first `k`

dimensions are important for the midpoint of the circle. The default value of `dim`

is 3, which draws a planar circle in `x,y,z`

space.
Positions of a the initial point and midpoint of a circle can be given in joints space or in Cartesian space regardless of the space where the circle is defined in. Also the coordinates can be either relative or absolute as defined by parameter `rel`

. In relative mode, all positions are relative to the starting point of the circle.

## Key, value pairs

Key | Value | Required | Description |
---|---|---|---|

"cmd" | "cmove" | Yes | Moves the robot toolhead on a circle in XYZ space. |

"id" | Int (>0) | No | Similar to `jmove` command |

"j0", "j1", …, "j7", or "x", "y", "z", "a", "b", "c", "d", "e" | Double | Yes | The target point of the circle expressed either in joints coordinates or Cartesian coordinates |

"mj0", "mj1", "mj2", "mj3", "mj4", "mj5", "mj6", "mj7" or "mx", "my", "mz", "ma", "mb", "mc", "md", "me" | Double | Yes | The coordinates of a midpoint on the circle. The circle will connect the current position to the target position by passing through the midpoint. Note that only the first `dim` (default = 3) coordinates of the midpoint matter in making the circle. The midpoint can be either presented in joints space by "mj0", "mj1", "mj2", "mj3", "mj4", "mj5", "mj6", "mj7" or in Cartesian space by "mx", "my", "mz", "ma", "mb", "mc", "md", "me". If a coordinate is not present in the description of the midpoint, it will be set to the initial point of the circle. |

"turn" | Int (>=0) | No | Number of turns of the circle. If not present, the default value of 0 is used. For any number of turns larger than 0, the robot will make the additional complete turns before stopping at the target point. |

"dim" | Int (>0 and <= 8) | No | Specifies the dimension of the circle. If it is not present the default value of 3 is used. |

"space" | 0 / 1 | No | If `space` is 0, the circle will be in joints space. If the space is 1, the circle will be in Cartesian space. If it is not present the default value of 1 is used. |

"rel" | 0 / 1 | No | If `rel` is set to 0, both midpoint and target point are interpreted as absolute coordinates. If `rel` is set to 1, both midpoint and target point values are treated relative to the initial point of the circle. If this field is not present, the last given value will be used. |

"vel" | Double (>0) | No | The maximum velocity on the circle in the space that the circle is defined in. If this field is not present, the last given value for a move command in the same space will be used. |

"accel" | Double (>0) | No | The maximum acceleration on the circle in the space that the circle is defined in. If this field is not present, the last given value for a move command in the same space will be used. |

"jerk" | Double (>0) | No | The maximum jerk on the circle in the space that the circle is defined in. If this field is not present, the last given value for a move command in the same space will be used. |

## Example

```
{"cmd":"cmove", "id":15, "x":10, "y":10, "mx":6 , "my":8, "mz":130, "turn":2, "rel":0}
```

This command will move the toolhead, on a circle that starts from the current position and passes through `mx = 10, my = 8 and mz = 130`

, and stops at `x = 10`

, `y = 10`

. Final `z, a, b, c, d, e`

values will be the same as the initial point. The robot will make two extra full turns since `turn = 2`

.

## Error codes

Same as `jmove`

command.