helicalXY()

Description

Draw a spiral using a clockwise arc or counterclockwise arc. The direction is from the positive direction of the Z axis where the circular motion occurs.
This method uses the center of circle mode to control the spiral path, and uses the positive and negative values ​​of the rotation angle to select clockwise or counterclockwise.
For more information about various motion methods, please see the Motion Method Explanation

Syntax

machine.helicalXY(cX, cY, dstZ, theta); machine.helicalXY(cX, cY, dstZ, theta, feedrate);

Parameters

machine: Machine object.

cX: The X coordinate of the center of the circle in the circle center mode.

cY: The Y coordinate of the center of the circle in the circle center mode.

dstZ: The target Z coordinate, that is, the axis is moved to the target coordinate when performing arc motion.

theta: The angle to be rotated. Use positive values ​​for clockwise and negative values ​​for counterclockwise.

feedrate: Feedrate. If no parameter is passed, the last recorded feedrate will be used.

Return

bool:

true: The machine exists and is created successfully.
false: The machine does not exist or fails to be created.

Example

Set the basic parameters of the machine and make the machine spiral 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

#include "Motion86.h"

 

// Generate machine objects. You can use up to three machines, machine 0~2, each with three axes.

Machine machine(0);

 

// Stepper motor enable pin.

int EnablePin = 4;

 

void setup() {

  while (!Serial);

  pinMode(EnablePin, OUTPUT);

 

  // If necessary, you can reverse the direction of the motion axis.

  // In this example, you need to reverse the direction of the x-axis and y-axis.

  machine.config_ReverseDirection(AXIS_X);

  machine.config_ReverseDirection(AXIS_Y);

 

  // PPU (pulse per unit) is a virtual length unit, depending on different needs.

  // In this example, the unit length of the x-axis is set to 80 pulses, which corresponds to 1 mm in actual application.

  machine.config_PPU(AXIS_X, 80.0);

  machine.config_PPU(AXIS_Y, 80.0);

  machine.config_PPU(AXIS_Z, 1600.0);

 

  // Before controlling, the machine must be started.

  machine.machineOn();

  machine.setDefaultFeedrate(400);

 

  // Start the stepper motor.

  digitalWrite(EnablePin, LOW);

}

 

void loop() {

  // Move the two circles clockwise from the center (0, 10, 0) to (0, 0, 10).

  machine.helicalXY(0, 10, 10, TWO_PI * 2, true);

 

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

  machine.helicalXY(0, 10, 0, TWO_PI * 2, false);

   

  // Wait until the planned motion is completed.

  while (machine.isMoving());

}

See also

helicalYZ()
helicalXZ()


Library Reference

The text of the 86Duino reference material follows the Creative Commons Attribution-ShareAlike 3.0 License. The code examples in the reference material have been released to the public domain.