arcXY()

Description

Uses clockwise or counterclockwise arcs. The direction is from the positive Z-axis where the arc motion occurs.
This method controls the arc path in two different ways depending on different input parameters.
1. Center mode – Calculates the arc path by specifying the center and end point positions.
2. Radius mode – Calculates the arc path by specifying the radius and end point positions.
※ Please note that no matter which arc motion method is used, if the parameters are incorrect, the target may not be on the arc and the machine may move unexpectedly.
If you want to know about various practice methods, please see the Practice Methods Explanation page.

Grammar

machine.arcXY(r, dstX, dstY);
machine.arcXY(r, dstX, dstY, revDir);
machine.arcXY(r, dstX, dstY, revDir, feedrate);
machine.arcXY(cX, cY, dstX, dstY);
machine.arcXY(cX, cY, dstX, dstY, revDir);
machine.arcXY(cX, cY, dstX, dstY, revDir, feedrate);

Parameters

machine: A Machine object.

r: The radius of the arc in radius mode.

cX: The center X coordinate in center mode.

cY: The center Y coordinate in center mode.

dstX: The target X coordinate.

dstY: The target Y coordinate.

revDir: Reverses the direction. True for counterclockwise, false for clockwise. Default is clockwise.

feedrate: The feedrate. If no parameters are passed, the last recorded feedrate is used.

Return Value

bool:

true: the machine exists and was created successfully.
false: the machine does not exist or creation failed.

Example

Set the basic parameters of the machine and move it in two modes on the XY plane.

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

#include "Motion86.h"

 

// Create a machine object. You can use up to three machines, 0 to 2, with three axes each.

Machine machine(0);

 

// Valid pins for stepper motor.

int EnablePin = 4;

 

void setup() {

  while (!Serial);

  pinMode(EnablePin, OUTPUT);

 

  // You can invert the axis direction if you want.

  // In this example, the X and Y axis directions need to be inverted.

  machine.config_ReverseDirection(AXIS_X);

  machine.config_ReverseDirection(AXIS_Y);

 

  // PPU (Pulse Per Unit) is a virtual unit of length for different needs.

  // In this example, the unit length of the X-axis is set to 80 pulses, which corresponds to 1mm in real applications.

  machine.config_PPU(AXIS_X, 80.0);

  machine.config_PPU(AXIS_Y, 80.0);

  machine.config_PPU(AXIS_Z, 1600.0);

 

  // The machine must be started before it can be controlled.

  machine.machineOn();

  machine.setDefaultFeedrate(400);

 

  // Start the stepper motor.

  digitalWrite(EnablePin, LOW);

 

 

void loop() {

  // Move clockwise to (10, 10, 0) with a radius of 10.

  machine.arcXY(10, 10, 10, true);

 

  // Move Move counterclockwise with radius 10 to (0, 0, 0).

  machine.arcXY(10, 0, 0, false);

 

  // Move the circle from (0, 0, 10) clockwise to (10, 10, 0).

  machine.arcXY(0, 10, 10, 10, true);

 

  // Move counterclockwise from center (0, 0, 10) to (0, 0, 0).

  machine.arcXY(0, 10, 0, 0, false);

e>

 

 

  // Wait for planned movement to complete.

  while (machine.isMoving());

 

Reference

arcYZ()
arcXZ()
arcXY_Theta()
arcYZ_Theta()
arcXZ_Theta()


Function Library Reference

The text of the 86Duino reference is licensed under a Creative Commons Attribution-ShareAlike 3.0 License. Code samples in the reference are released into the public domain.