flow "StepperMotor" v1.0
# ---------- IDENTITY ----------
id: "engineering.electrical_machine.stepper_motor"
category: "Electrical Machine Entities"
entity_type: "Stepper Motor"
locale: "en-GB"
# ---------- AUTHORS ----------
authors: ["Mark Anthony Higgins", "Sky — Recursive AI"]
source_credit: "Kireth Research — Semantic Library"
licence_note: "Consult the source's Open Research Licence; attribution required."
# ---------- SOURCE ----------
source.url: "https://kirethresearch.org/booksai-core/entity-graph/engineering-entities/electrical-machine-entities/stepper-motor-ontology.html"
source.title: "Stepper Motor Ontology"
source.revised: "2026-08-04"
source_relation: "Newly constructed semantic Flow Algebra representation; not a verbatim extraction of embedded code."
citation_backlink: source.url
# ---------- PURPOSE ----------
purpose: "Represent stepper motor structure, commanded step movement, control modes, operating constraints and fault inference as an inspectable entity graph."
# ---------- STATE_MODEL ----------
state.identity: [motor_id, motor_type, rated_current_A, rated_voltage_V, steps_per_revolution, step_angle_deg]
state.configuration: [drive_mode, microstep_divisor, current_limit_A, holding_torque_Nm, rotor_inertia_kgm2]
state.command: [enable, direction, step_pulses, target_position_steps, target_speed_steps_s, acceleration_steps_s2]
state.observation: [position_estimate_steps, measured_position_steps?, winding_temperature_C?, phase_current_A?, supply_voltage_V?, fault_flags]
state.lifecycle: [unpowered, disabled, holding, accelerating, running, decelerating, stopped, fault, isolated]
state.integrity: [driver_healthy, winding_continuity, thermal_margin, load_margin, position_confidence]
# ---------- ENTITIES ----------
entity StepperMotor: ElectricalMachine
entity Rotor: MechanicalComponent
entity Stator: ElectromagneticComponent
entity Winding: ElectricalConductor
entity Driver: PowerElectronicController
entity StepCommand: ControlSignal
entity PhaseCurrent: ElectricalQuantity
entity Shaft: MechanicalInterface
entity Load: MechanicalLoad
entity Encoder: OptionalPositionSensor
entity Supply: ElectricalSource
entity Protection: SafetyFunction
relation StepperMotor contains Rotor
relation StepperMotor contains Stator
relation Stator contains Winding
relation Driver energises Winding
relation StepCommand commands Driver
relation Rotor drives Shaft
relation Shaft couples_to Load
relation Encoder observes Rotor
relation Protection constrains Driver
# ---------- PATHWAYS ----------
pathway "CommandToMotion":
input: [enable, direction, step_pulses, drive_mode]
require: [driver_healthy, within_current_limit, within_temperature_limit]
transform: "step pulses -> phase-current sequence -> magnetic field -> rotor torque -> shaft displacement"
output: [position_estimate_steps, shaft_motion]
pathway "FullStepKinematics":
require: [steps_per_revolution > 0]
derive.step_angle_deg: 360 / steps_per_revolution
derive.position_deg: position_estimate_steps * step_angle_deg
derive.speed_rpm: target_speed_steps_s * 60 / steps_per_revolution
note: "For microstepping, command counts and effective step angle must be adjusted by the microstep divisor."
pathway "MicrostepKinematics":
require: [microstep_divisor >= 1, steps_per_revolution > 0]
derive.commanded_microstep_angle_deg: 360 / (steps_per_revolution * microstep_divisor)
derive.commanded_position_deg: position_estimate_steps * commanded_microstep_angle_deg
note: "Microsteps are command increments; actual positional accuracy depends on load, current control and motor characteristics."
pathway "TorqueAvailability":
input: [motor_speed, supply_voltage_V, phase_current_A, driver_capability, load_torque]
transform: "consult manufacturer torque-speed curve and operating envelope"
output: [available_torque, load_margin]
note: "Holding torque is not guaranteed dynamic torque."
pathway "ThermalProtection":
input: [winding_temperature_C?, phase_current_A?, duty_cycle]
transform: "compare measured or estimated thermal state against rated limits"
output: [thermal_margin, protection_request]
pathway "PositionVerification":
input: [position_estimate_steps, measured_position_steps?]
transform: "compare command-derived estimate with sensor observation when available"
output: [position_error_steps?, position_confidence]
note: "Open-loop step counting cannot prove that the rotor has followed every commanded step."
# ---------- MINI_RECURSION_ENGINE ----------
engine "StepperMotorStateAssessment":
initialise: [identity, configuration, command, observation]
repeat_until: "state stable or assessment limit reached"
evaluate: [electrical_supply, driver_state, phase_current, command_rate, torque_margin, thermal_margin, position_error]
infer: [operating_state, likely_faults, evidence_gaps]
revise: [confidence, recommended_diagnostics]
stop_on: [unsafe_condition, missing_critical_rating, conflicting_evidence]
output: [classified_state, fault_hypotheses, evidence, confidence]
# ---------- INFERENCE_RULES ----------
rule "Disabled":
when: "enable == false"
infer: "no commanded stepping; shaft may still move under external load"
rule "PulseToNominalPosition":
when: "driver enabled and accepted step pulses"
infer: "update commanded position estimate by signed pulse count"
caveat: "This is an estimate, not a guaranteed physical position."
rule "PotentialStall":
when: "required_dynamic_torque exceeds available_torque"
infer: "risk of stall or missed steps"
confidence: "conditional on validated torque-speed data"
rule "DetectedPositionLoss":
when: "encoder available and abs(position_error_steps) exceeds validated tolerance"
infer: "position tracking fault"
rule "ThermalOverload":
when: "measured temperature exceeds manufacturer limit"
infer: "thermal fault; request protective shutdown"
rule "DriverFault":
when: "driver fault flag active"
infer: "driver or electrical supply diagnostic required"
rule "ExcessiveStepRate":
when: "commanded acceleration or pulse rate exceeds validated operating envelope"
infer: "missed-step risk; reduce demand and reassess"
rule "SafeMaintenance":
when: "inspection or wiring work requested"
require: "isolate supply, verify absence of hazardous energy, account for stored electrical and mechanical energy"
# ---------- CONFIDENCE ----------
confidence.high: "Direct measured evidence plus verified manufacturer ratings"
confidence.medium: "Consistent command, driver telemetry and validated model"
confidence.low: "Open-loop estimates, absent ratings or unverified load conditions"
confidence.policy: "Do not infer guaranteed position, torque or safety from step commands alone."
# ---------- SEMANTIC_EQUIVALENCE ----------
equivalent_terms: ["stepper motor", "stepping motor", "step motor"]
related_terms: ["hybrid stepper", "permanent-magnet stepper", "variable-reluctance stepper", "microstepping driver", "open-loop positioning"]
distinguish_from: ["servo motor with closed-loop feedback", "continuous-rotation induction motor"]
# ---------- SAFETY_CONSTRAINTS ----------
constraint: "Respect manufacturer voltage, current, insulation, thermal and speed limits."
constraint: "A disabled drive does not necessarily provide a safe mechanical brake."
constraint: "Do not disconnect energised motor windings unless explicitly permitted by the equipment manufacturer."
constraint: "Use appropriate guarding, emergency-stop design and qualified electrical practices."
constraint: "This ontology is for semantic reasoning, not a certified machine safety controller."
# ---------- FLOW_HASH ----------
flow_hash.method: "SHA-256 of canonical UTF-8 content excluding the hash value field"
flow_hash.value: "not_computed"
# ---------- UPDATE_MODEL ----------
update.version: "1.0"
update.review_on: ["new motor class", "driver specification change", "manufacturer rating change", "fault evidence", "ontology revision"]
update.procedure: "verify evidence -> revise entities and rules -> validate consistency -> regenerate canonical hash -> publish with citation"
end flow
Download Code
Copy to Clipboard