clearEMGStop()

Description

Clear the emergency stop state of Machine.

Syntax

machine.clearEMGStop();

Parameters

machine: Machine object.

No parameters.

Return

No return value.

Example

Set the basic parameters of the machine and move the machine for one second before entering an emergency stop.

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

48

49

50

51

52

#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 left to (-10, 0).

  machine.line(-10, 0, 0);

 

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

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

 

  // Move down to (0, -10).

  machine.line(0, -10, 0);

 

  // Move 90 degrees counterclockwise with a radius of 10 to (10, 0).

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

 

  // Move left to (0, 0).

  machine.line(0, 0, 0);

 

  // Movement stops after 1 second.

  delay(1000);

  machine.emgStop();

  machine.clearEMGStop();

}

See also

stop()
emgStop()


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.