I.e., Extend, Retract (and Repeats x3), then Steps Down.
void cuttingMovement()
{
Serial.println("====== TEST STARTED ========");
while (layersCounted < 3) //While Loop keeps running the loop until the condition is false.
{
extendActuator(); //Runs the extension function for the actuator.
retractActuator(); //Runs the retraction function for the actuator.
RotateRelativeZ();
layersCounted = layersCounted + 1; //Formula to add 1 for every layer counted.
Serial.print("layersCounted = "); //Prints statement to show that the While Loop has been updated.
Serial.println(layersCounted); //Print the updated statement.
delay(500); //Delay next loop by offTimer which is used to achieved 40% Duty Cycle.
}
Serial.println("Cutting Stopped."); //Prints statement to show that the While Loop has been stopped.
layersCounted = 0;
Serial.println("layersCounted Reset."); //Prints statement to show that layers counted has been reset.
Serial.println("====== TEST END ========");
}
void RotateRelativeZ() //Function to move the Y-Stepper absolutely (+/-).
{
stepperZ.moveTo(stepsRequiredZ); //Sets absolute distance for the Y-Stepper to move.
Serial.println("Z-Axis Position Reached Absolutely."); //Prints statement to show that the Z-Stepper has reached its position.
}