pub struct Stepper {
pub teeth: f64,
pub detent: f64,
pub microstep: f64,
pub current: f64,
}Fields§
§teeth: f64Rotor teeth N (50 for a 1.8 degree motor): 4 N full steps a turn.
detent: f64effects.detent_torque: the detent torque’s amplitude, N m; 0 off.
microstep: f64One microstep at the motor, rad.
current: f64The current vector’s amplitude the drive sets, A: sqrt 2 times a phase’s current in a full step.
Implementations§
Source§impl Stepper
impl Stepper
pub fn from_config(cfg: &Config) -> Result<Self, ConfigError>
Sourcepub fn torque(&self, p: &DriveParams, [ia, ib]: [f64; 2], e: f64) -> f64
pub fn torque(&self, p: &DriveParams, [ia, ib]: [f64; 2], e: f64) -> f64
The torque of phase currents at the rotor’s electrical angle e.
Sourcepub fn holding_torque(&self, p: &DriveParams) -> f64
pub fn holding_torque(&self, p: &DriveParams) -> f64
The holding torque: kt times the current the drive sets.
Sourcepub fn detent_potential(&self, angle: f64, origin: f64) -> f64
pub fn detent_potential(&self, angle: f64, origin: f64) -> f64
The detent torque’s potential at the rotor angle angle, J: the torque is -T_d sin 4e (e = N (angle - origin)), so
U = -T_d cos(4e) / (4 N), whose angle derivative is T_d sin 4e. It is the magnets’ energy (the torque is
conservative), enabled or not: the detent’s work is part of the shaft’s, and what the magnets give for it, the
change of U, is booked as it happens (Drive::detent_moved, Drive::emf_loss), never stored, so that nothing of
it appears or vanishes at an enable or a disable.
Sourcepub fn detent_torque(&self, angle: f64, origin: f64) -> f64
pub fn detent_torque(&self, angle: f64, origin: f64) -> f64
The detent torque at the rotor angle angle, N m: -T_d sin 4e, the magnets’ alone, with the drive enabled or not.
Sourcepub fn pull_out(&self, p: &DriveParams, speed: f64, supply: f64) -> f64
pub fn pull_out(&self, p: &DriveParams, speed: f64, supply: f64) -> f64
The pull-out torque at a speed, motoring, with the supply supply (infinite: no limit): the most torque a
steady run at that speed can have from currents within the drive’s amplitude I and voltages within the supply.
In phasors at the electrical frequency N w, with the back-EMF E = kE w as the real axis and Z = R + j N w L, the
torque is kt Re(I) and V = Z I + E: Re(I) at its highest over the intersection of the disc |I| <= I and the disc
|I + E / Z| <= U / |Z|. Without detent torque, cold winding.
Sourcepub fn braking(&self, p: &DriveParams, speed: f64, supply: f64) -> f64
pub fn braking(&self, p: &DriveParams, speed: f64, supply: f64) -> f64
The braking counterpart of pull_out: the back-EMF helps the current.
Sourcepub fn torque_curve(
&self,
p: &DriveParams,
speed: f64,
supply: f64,
) -> (f64, f64)
pub fn torque_curve( &self, p: &DriveParams, speed: f64, supply: f64, ) -> (f64, f64)
(lowest, highest) torque at a speed, as DriveParams::torque_curve: the pull-out curve and its braking side.