Skip to content

Struct OpenSkyhawk::StepperConfig

ClassList > OpenSkyhawk > StepperConfig

Full per-instance stepper configuration. Authored per sketch (panel wiring). More...

  • #include <StepperMotor.h>

Public Attributes

Type Name
const AccelPoint * accel = [**kSwitecDefaultAccel**](namespaceOpenSkyhawk.md#variable-kswitecdefaultaccel)
acceleration curve (not owned)
uint8_t accelN = [**kSwitecDefaultAccelN**](namespaceOpenSkyhawk.md#variable-kswitecdefaultacceln)
entries in accel[]
bool autoRecal = false
re-zero to homePosition when the sensor next asserts
uint8_t deadband = 1
ignore target changes within this many steps
HomeMode home = HomeMode::STALL
homing strategy
int16_t homePosition = 0
step index assigned at the home reference
bool homeSeekClockwise = false
direction to seek the home reference
uint16_t homeStepUs = 0
homing seek rate µs/step; MUST stay under the motor start-stop rate or the seek slips. 0 → library default (2000)
int16_t maxPos = 945
upper travel clamp for moveTo (ignored if wrap); default = rangeSteps
int16_t minPos = 0
lower travel clamp for moveTo (ignored if wrap)
int16_t parkPosition = 0
step to rest at after homing
StepPattern pattern = StepPattern::SWITEC\_6STATE
coil drive sequence
uint16_t rangeSteps = 945
mechanical stop-to-stop travel in steps; STALL home drives this (+margin). 945 = X27.589 ~315°; 0 → stepsPerRev
uint32_t recalDebounceMs = 0
minimum interval between auto-recals
HomeSensor sensor = { true, 5, 2000 }
SENSOR-mode params (ignored for STALL)
uint16_t stepsPerRev = 1080
steps per full revolution (X27/BKA datasheet, 1/3°/step; calibrate empirically)
bool wrap = false
continuous-rotation gauge (shortest-path, no clamp)

Detailed Description

Every field has a default — the X27 / VID-29 / BKA-30 air-core family's — so a sketch sets only what differs, by name (#295):

const OpenSkyhawk::StepperConfig OIL_MOTOR = { .maxPos = 960, .rangeSteps = 960 };  // 320° BKA-30
Fields are only ever appended, each with a default, so a new setting never breaks a sketch; a positional {…} initialiser that stops early gets the defaults for the rest.

Note:

accel must point at storage that outlives the StepperMotor (e.g. a static const table). homePosition / parkPosition / minPos / maxPos are in steps; a sketch may compute them from degrees as round(deg*stepsPerRev/360).

Public Attributes Documentation

variable accel

acceleration curve (not owned)

const AccelPoint* OpenSkyhawk::StepperConfig::accel;


variable accelN

entries in accel[]

uint8_t OpenSkyhawk::StepperConfig::accelN;


variable autoRecal

re-zero to homePosition when the sensor next asserts

bool OpenSkyhawk::StepperConfig::autoRecal;


variable deadband

ignore target changes within this many steps

uint8_t OpenSkyhawk::StepperConfig::deadband;


variable home

homing strategy

HomeMode OpenSkyhawk::StepperConfig::home;


variable homePosition

step index assigned at the home reference

int16_t OpenSkyhawk::StepperConfig::homePosition;


variable homeSeekClockwise

direction to seek the home reference

bool OpenSkyhawk::StepperConfig::homeSeekClockwise;


variable homeStepUs

homing seek rate µs/step; MUST stay under the motor start-stop rate or the seek slips. 0 → library default (2000)

uint16_t OpenSkyhawk::StepperConfig::homeStepUs;


variable maxPos

upper travel clamp for moveTo (ignored if wrap); default = rangeSteps

int16_t OpenSkyhawk::StepperConfig::maxPos;


variable minPos

lower travel clamp for moveTo (ignored if wrap)

int16_t OpenSkyhawk::StepperConfig::minPos;


variable parkPosition

step to rest at after homing

int16_t OpenSkyhawk::StepperConfig::parkPosition;


variable pattern

coil drive sequence

StepPattern OpenSkyhawk::StepperConfig::pattern;


variable rangeSteps

mechanical stop-to-stop travel in steps; STALL home drives this (+margin). 945 = X27.589 ~315°; 0 → stepsPerRev

uint16_t OpenSkyhawk::StepperConfig::rangeSteps;


variable recalDebounceMs

minimum interval between auto-recals

uint32_t OpenSkyhawk::StepperConfig::recalDebounceMs;


variable sensor

SENSOR-mode params (ignored for STALL)

HomeSensor OpenSkyhawk::StepperConfig::sensor;


variable stepsPerRev

steps per full revolution (X27/BKA datasheet, 1/3°/step; calibrate empirically)

uint16_t OpenSkyhawk::StepperConfig::stepsPerRev;


variable wrap

continuous-rotation gauge (shortest-path, no clamp)

bool OpenSkyhawk::StepperConfig::wrap;



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