12#include "TMCStepper.h"
99 void move(
float targetSpeed,
float acceleration,
float position,
int steps_revolution);
112 void move(
float targetSpeed,
float acceleration,
float position,
int steps_revolution,
STEPPER* stepper2,
int stepper2_ratio);
123 void absoluteMove(
float targetSpeed,
float acceleration,
float angle,
int steps_revolution);
136 void absoluteMove(
float targetSpeed,
float acceleration,
float angle,
int steps_revolution,
STEPPER* stepper2,
int stepper2_ratio);
float getCurrentPosition()
Get the current position of the motor in degrees.
int enable_pin
Pin that is connected to the enable pin of the driver.
uint8_t getHoldCurrent()
Get the actual hold current currently applied by the stepper driver.
STEPPER(int address, int step_pin, int enable_pin)
Construct a new STEPPER object.
void setup()
Set up the stepper driver and configure it.
void move(float targetSpeed, float acceleration, float position, int steps_revolution)
Move the motor a given angle with a given acceleration and distance.
void updateHoldCurrent()
Update the hold current of the stepper driver from the current flash value.
int address
SPI address of the stepper driver.
void updateRMSCurrent()
Update the RMS current of the stepper driver from the current flash value.
void updateMicrosteps()
Update the microsteps of the stepper driver from the current flash value.
float current_position
This stores the current position of the motor in degrees.
float steps_remainder
This stores the fractional step that needs to be carried over to the next move.
int step_pin
Pin that is connected to the step pin of the driver.
void step()
Step the motor one step.
TMC2209Stepper stepper
Stepper driver object. This is the object that interfaces with the stepper driver library.
uint16_t getRMSCurrent()
Get the actual RMS current currently applied by the stepper driver.
void SetDirection(bool dir)
Set the direction of the stepper motor.
bool GetDirection()
Get the current direction of the stepper motor.
void runStepperSCurve(float targetSpeed, float maxJerk, int distance)
Run the stepper motor using an S-curve profile.
void absoluteMove(float targetSpeed, float acceleration, float angle, int steps_revolution)
Move the motor to a target location based on an absolute angle with a given speed and acceleration.
bool direction
Direction of the motor. This is used to set the direction of the motor.
Configuration file for the entire project.