Other Libraries might be interesting. Here are some stepper motor control library example simulations:
Stepper.h
- https://www.arduino.cc/reference/en/libraries/stepper/
- GitHub - arduino-libraries/Stepper: Stepper Library for Arduino
Examples
- MotorKnob Simulation -- Stepper position follows a potentiometer reading
- stepper_oneRevolution Simulation -- Stepper bounces back and forth 200 steps.
- stepper_oneStepAtATime Simulation -- Stepper moves slowly at 2 steps/sec
- stepper_speedControl simulation -- Stepper speed varies with potentiometer reading
MobaTools MobaStepper
This library moves steppers with acceleration in the background, and supplies a lot of other functionality (Servos, Buttons, LEDs, timers)
Simulations
- Example 2 -- bounce a stepper back and forth between extremes with acceleration and a Finite State Machine
- Example 3 -- Stepper jog buttons and speed control
- Stepper Button Example -- Move stepper to five different absolute positions based 5 different buttons.
- Stepper Reference Example: Set a reference position with a limit switch and move to specific positions with button presses.
- Stepper Reference_2 Example: Three axis steppers with X,Y homing cycle
- Stepper Slider: Use buttons to set end locations and initiate a travel.
- Other Examples: MobaTools/examples/_Stepper at master · MicroBahner/MobaTools · GitHub
AccelStepper
This non-blocking library uses a smooth acceleration scheme to move steppers.
Examples
- AFMotor_ConstantSpeed
- AFMotor_MultiStepper
- Blocking
- Bounce -- Simulation: Bounces +/-500 steps
- ConstantSpeed -- Simulation: one stepper at 50steps/sec, 15RPM
- DualMotorShield -- Simulation: two steppers bounce back and forth at different speeds.
- MotorShield
- MultiStepper -- Simulation: two steppers in coordinated motion to multiple positions (no acceleration)
- MultipleSteppers -- Simulation: Three steppers with acceleration
- Overshoot -- Simulation: Demonstrate overshooting past 300 and smoothly returning to 0.
- ProportionalControl -- Simulation: Follow potentiometer position with acceleration.
- Quickstop -- Simulation: Accelerate towards +/- 500 but stop ASAP after +300&0 subject to acceleration limits. (With an improved simulation)
- Random -- Simulation: accelerate to random positions with random speeds and accelerations.
FastAccelStepper
Examples
- StepperDemo -- Simulation
- examples directory](FastAccelStepper/examples at master · gin66/FastAccelStepper · GitHub)
Servo
Examples
- Knob -- Simulation: Servo motion follows the movement of a potentiometer knob.
- Sweep -- Simulation: Servo sweeps back and forth at controlled speeds without intervention.