Struct sstep_ctx¶
Driver state behind the opaque sstep .More...
#include <sstep_internal.h>
Public Attributes¶
| Type | Name |
|---|---|
| struct sstep_gain | adc_i Current per ADC count [pu]. |
| struct sstep_gain | adc_v Bus voltage per ADC count [pu]. |
| uint16_t | adv Angle increments applied since the hand-off. |
| sstep_angle_t | angle_offset Electrical angle of position 0. |
| uint8_t | angle_shift 14 - log2(microsteps). |
| struct sstep_config | cfg Copy of the configuration. |
| uint16_t | compare Last compare values. |
| struct sstep_setpoint | cur Setpoint in use. |
| sstep_integ_t | emf Filtered back-EMF, d and q axis [pu V]. |
| struct sstep_gain | emf_a L / Ts + R / 2 [pu V / pu A]. |
| struct sstep_gain | emf_alpha Ts / tau of the back-EMF filter. |
| struct sstep_gain | emf_b L / Ts - R / 2 [pu V / pu A]. |
| int64_t | emf_off Mean back-EMF at rest, d and q [mV * 2^16]. |
| volatile uint16_t | faults Active faults. |
| sstep_real_t | ff_cmd Back-EMF of vel_cmd [pu V]. |
| struct sstep_gain | ff_gain Feed-forward per microstep/s [pu]. |
| bool | hold_active Hold current applied. |
| uint32_t | hold_ticks Slow periods at standstill before hold. |
| sstep_real_t | i_hold Hold current [pu]. |
| sstep_real_t | i_meas Last measured phase currents [pu]. |
| sstep_real_t | i_prev Phase currents of the previous period [pu]. |
| sstep_real_t | i_run Run current [pu]. |
| uint16_t | i_trip_counts Overcurrent trip [ADC counts from zero]. |
| sstep_integ_t | integ PI integrators [pu V]. |
| struct sstep_gain | inv_vbus Last V_base / bus voltage. |
| struct sstep_gain | kb Anti-windup gain Ts / Tt. |
| struct sstep_gain | ki Integral gain per fast loop period. |
| struct sstep_gain | kp Proportional gain [pu V / pu A]. |
| struct sstep_motion | mo Motion generator. |
| struct sstep_gain | r_pu Phase resistance [pu] (voltage drive). |
| uint16_t | ratio Fast loop periods per slow loop period. |
| uint32_t | ready SSTEP_READY after a successful sstep_init() . |
| struct sstep_setpoint | sp Setpoints; the fast loop owns sp[sp_active]. |
| volatile uint8_t | sp_active Buffer in use by the fast loop. |
| volatile uint8_t | sp_pending 1: sp[1 - sp_active] is complete and new. |
| uint32_t | stall_count Stall detector up/down counter. |
| int32_t | stall_emf_mv Back-EMF of stall_speed [mV]. |
| uint32_t | stall_hold Slow periods the condition stays true after a reversal. |
| uint32_t | stall_ticks Slow periods of stall to trip; 0 = detection off. |
| enum sstep_state | state Driver state. |
| uint32_t | still Slow periods at standstill. |
| sstep_acc_t | v_hist Applied phase voltages computed 1 and 2 periods ago [pu V]. |
| uint16_t | vbus_max_raw Overvoltage trip [ADC counts], 0 = off. |
| uint16_t | vbus_min_raw Undervoltage trip [ADC counts], 0 = off. |
| volatile uint16_t | vbus_raw Last bus voltage [ADC counts]. |
| int32_t | vel_cmd Commanded velocity of the period in use [microsteps/s]. |
Detailed Description¶
Its layout may change in any release.
Public Attributes Documentation¶
variable adc_i¶
Current per ADC count [pu].
variable adc_v¶
Bus voltage per ADC count [pu].
variable adv¶
Angle increments applied since the hand-off.
variable angle_offset¶
Electrical angle of position 0.
variable angle_shift¶
14 - log2(microsteps).
variable cfg¶
Copy of the configuration.
variable compare¶
Last compare values.
variable cur¶
Setpoint in use.
variable emf¶
Filtered back-EMF, d and q axis [pu V].
variable emf_a¶
L / Ts + R / 2 [pu V / pu A].
variable emf_alpha¶
Ts / tau of the back-EMF filter.
variable emf_b¶
L / Ts - R / 2 [pu V / pu A].
variable emf_off¶
Mean back-EMF at rest, d and q [mV * 2^16].
variable faults¶
Active faults.
variable ff_cmd¶
Back-EMF of vel_cmd [pu V].
variable ff_gain¶
Feed-forward per microstep/s [pu].
variable hold_active¶
Hold current applied.
variable hold_ticks¶
Slow periods at standstill before hold.
variable i_hold¶
Hold current [pu].
variable i_meas¶
Last measured phase currents [pu].
variable i_prev¶
Phase currents of the previous period [pu].
variable i_run¶
Run current [pu].
variable i_trip_counts¶
Overcurrent trip [ADC counts from zero].
variable integ¶
PI integrators [pu V].
variable inv_vbus¶
Last V_base / bus voltage.
variable kb¶
Anti-windup gain Ts / Tt.
variable ki¶
Integral gain per fast loop period.
variable kp¶
Proportional gain [pu V / pu A].
variable mo¶
Motion generator.
variable r_pu¶
Phase resistance [pu] (voltage drive).
variable ratio¶
Fast loop periods per slow loop period.
variable ready¶
SSTEP_READY after a successful sstep_init() .
variable sp¶
Setpoints; the fast loop owns sp[sp_active].
variable sp_active¶
Buffer in use by the fast loop.
variable sp_pending¶
1: sp[1 - sp_active] is complete and new.
variable stall_count¶
Stall detector up/down counter.
variable stall_emf_mv¶
Back-EMF of stall_speed [mV].
variable stall_hold¶
Slow periods the condition stays true after a reversal.
variable stall_ticks¶
Slow periods of stall to trip; 0 = detection off.
variable state¶
Driver state.
variable still¶
Slow periods at standstill.
variable v_hist¶
Applied phase voltages computed 1 and 2 periods ago [pu V].
variable vbus_max_raw¶
Overvoltage trip [ADC counts], 0 = off.
variable vbus_min_raw¶
Undervoltage trip [ADC counts], 0 = off.
variable vbus_raw¶
Last bus voltage [ADC counts].
variable vel_cmd¶
Commanded velocity of the period in use [microsteps/s].
The documentation for this class was generated from the following file src/sstep_internal.h