Skip to content

File StepperMotor.h

FileList > Drivers > StepperMotor > StepperMotor.h

Go to the source code of this file

Non-blocking 4-wire stepper driver on PinRef coils.More...

  • #include <PanelGroup.h>
  • #include <Drivers/MotorDriver/MotorDriver.h>

Namespaces

Type Name
namespace OpenSkyhawk

Classes

Type Name
struct AccelPoint
One point on the acceleration curve (SwitecX25 form).
struct HomeSensor
Home-sensor parameters ( HomeMode::SENSOR only).
struct StepperConfig
Full per-instance stepper configuration. Authored per sketch (panel wiring).
class StepperMotor
Non-blocking instrument-gauge stepper driven through PinRef coils.

Detailed Description

A control-agnostic MotorDriver for instrument gauge steppers. Drives four coils through PinRef, so the coils may be native STM32 GPIO or an MCP23017 expander with no code change. The motion engine is ported from Guy Carpenter's SwitecX25 library: an integer (no-FPU) table-driven trapezoidal accel/decel — a vel proxy ramps up one step at a time and decelerates once the steps remaining to target fall below vel, giving smooth acceleration into and out of every move.

One drive profile (StepPattern::SWITEC_6STATE) covers the air-core instrument stepper family on hand — X27.589 / VID-29 / BKA-30 are the same motor electrically; a coil that runs reversed is corrected by swapping two constructor pins, not a new profile. StepPattern::FULL_4STATE is reserved for generic geared 4-wire steppers.

Homing: HomeMode::STALL drives into a mechanical end-stop (no sensor); HomeMode::SENSOR seeks a debounced digital home sensor — a micro switch, reed, hall, or opto-interrupter all read identically through one PinRef + an active-level flag.

Version:

0.1.0

Copyright:

GPL-2.0-only — see Firmware/LICENSE


The documentation for this class was generated from the following file Firmware/Libraries/PanelGroup/Drivers/StepperMotor/StepperMotor.h