fw-v0.5.2 Release Candidate 2
Pre-release
Pre-release
·
11 commits
to fw-v0.5.2rc1
since this release
[0.5.2] - 2021-05-15
Fixed
- spinout error is no longer sticky and doesn't trigger on static torque loads due to I^2*R electrical power
- Step and direction mode resets position when entering closed loop just like
input_posdoes - CAN baud rate setting works
Added
- Added phase balance check to motor calibration and MOTOR_ERROR_UNBALANCED_PHASES to error enums
- Added polarity and phase offset calibration for hall effect encoders
- Mechanical brake support
- Added periodic sending of encoder position on CAN
- Support for UART1 on GPIO3 and GPIO4. UART0 (on GPIO1/2) and UART1 can currently not be enabled at the same time.
- Thermistors now have a 2nd order lowpass filter applied to reduce noise
- 2-norm current clamping is used for AC induction motors
- Added spinout detection to detect incorrect encoder offset and CONTROLLER_ERROR_SPINOUT_DETECTED to error enums.
- Added AARCH64 support to libfibre
- Tuning input mode added to provide sinusoidal position, velocity, or torque stimulus. See INPUT_MODE_TUNING and the controller class for details.
- Added torque mirroring to INPUT_MODE_MIRROR
mechanical_power_bandwidth,electrical_power_bandwidth,spinout_electrical_power_threshold,spinout_mechanical_power_thresholdadded tocontroller.configfor spinout detection.mechanical_powerandelectrical_poweradded tocontroller.
Changed
- Step/dir performance improved! Dual axis step rates up to 250kHz have been tested
- Apply_config is called for encoders after a successful direction find
- Full calibration sequence now includes hall polarity calibration if a hall effect encoder is used
- Modified encoder offset calibration to work correctly when calib_scan_distance is not a multiple of 4pi
- Moved thermistors from being a top level object to belonging to Motor objects. Also changed errors: thermistor errors rolled into motor errors
- Use DMA for DRV8301 setup
- Make NVM configuration code more dynamic so that the layout doesn't have to be known at compile time.
- GPIO initialization logic was changed. GPIOs now need to be explicitly set to the mode corresponding to the feature that they are used by. See
<odrv>.config.gpioX_mode. - Previously, if two components used the same interrupt pin (e.g. step input for axis0 and axis1) then the one that was configured later would override the other one. Now this is no longer the case (the old component remains the owner of the pin).
- New control loop architecture:
- TIM8 update interrupt handler (CNT = 0) runs at a high priority and invokes the system level function
sample_cb()to sample all timing critical inputs (currently only encoder state). - TIM8 update interrupt handler (CNT = 0) raises an NVIC flag to kick off a lower priority interrupt.
- The control loop interrupt handler checks if all ADC measurements are ready and informs both motor objects about the current measurements.
- The control loop interrupt handler invokes the system level function
control_loop_cb()which updates all components (encoders, estimators, torque controllers, etc). The data paths between the components are configured by the Axis threads based on the requested state. This replaces the previous architecture where the components were updated inside the Axis threads inAxis::run_control_loop(). - Meanwhile the TIM1 and TIM8 updates for CNT = 3500 will have fired. The control loop interrupt handler thus reads the new ADC measurements and informs both motor objects that a DC calibration event has happened.
- Finally, the control loop interrupt invokes
pwm_update_cbon both motors to make them update their PWM timing registers.
- TIM8 update interrupt handler (CNT = 0) runs at a high priority and invokes the system level function
- Components that need low level control over PWM timings are implemented by inheriting from the
PhaseControlLawinterface. Three components currently inherit this interface:FieldOrientedController,ResistanceMeasurementControlLawandInductanceMeasurementControlLaw. - The FOC algorithm is now found in foc.cpp and and is presumably capable of running at a different frequency than the main control tasks (not relevant for ODrive v3).
- ACIM estimator was consolidated into a separate component
<odrv>.acim_estimator. - The Automatic Output Enable (AOE) flag of TIM1/TIM8 is used to achieve glitch-free motor arming.
- Sensorless mode was merged into closed loop control mode. Use
<axis>.enable_sensorless_modeto disable the use of an encoder. - More informative profiling instrumentation was added.
- A system-level error property was introduced.
- Added
torque_mirror_ratioand use it to feed-forwardcontroller_.torque_outputinINPUT_MODE_MIRROR - Accumulate integer steps in step/dir to avoid float precision errors
- Circular setpoint mode must be enabled when the step/dir interface is used.
API Migration Notes
axis.config.turns_per_stepchanged toaxis.controller.config.steps_per_circular_rangeodrive.axis.fet_thermistor,odrive.axis.motor_thermistormoved toodrive.axis.motorobjectenable_uartanduart_baudratewere renamed toenable_uart0anduart0_baudrate.enable_i2c_instead_of_canwas replaced by the separate settingsenable_i2c0andenable_can0.<axis>.motor.gate_driverwas moved to<axis>.gate_driver.<axis>.min_endstop.pullupand<axis>.max_endstop.pullupwere removed. Use<odrv>.config.gpioX_mode = GPIO_MODE_DIGITAL / GPIO_MODE_DIGITAL_PULL_UP / GPIO_MODE_DIGITAL_PULL_DOWNinstead.<axis>.config.can_node_idwas moved to<axis>.config.can.node_id<axis>.config.can_node_id_extendedwas moved to<axis>.config.can.is_extended<axis>.config.can_heartbeat_rate_mswas moved to<axis>.config.can.heartbeat_rate_ms<odrv>.get_oscilloscope_val()was moved to<odrv>.oscilloscope.get_val().- Several error flags from
<odrv>.<axis>.errorwere removed. Some were moved to<odrv>.errorand some are no longer relevant because implementation details changed. - Several error flags from
<odrv>.<axis>.motor.errorwere removed. Some were moved to<odrv>.errorand some are no longer relevant because implementation details changed. <axis>.lockin_statewas removed as the lockin implementation was replaced by a more general open loop control block (currently not exposed on the API).AXIS_STATE_SENSORLESS_CONTROLwas removed. UseAXIS_STATE_CLOSED_LOOP_CONTROLinstead with<odrv>.enable_sensorless_mode = True.<axis>.config.startup_sensorless_controlwas removed. Use<axis>.config.startup_closed_loop_controlinstead with<odrv>.enable_sensorless_mode = True.<axis>.clear_errors()was replaced by the system-wide function<odrv>.clear_errors().<axis>.armed_statewas replaced by<axis>.is_armed.- Several properties in
<axis>.motor.current_controlwere changed to read-only. <axis>.motor.current_control.Ibuswas moved to<axis>.motor.I_bus.<axis>.motor.current_control.max_allowed_currentwas moved to<axis>.motor.max_allowed_current.<axis>.motor.current_control.overcurrent_trip_levelwas removed.<axis>.motor.current_control.acim_rotor_fluxwas moved to<axis>.acim_estimator.rotor_flux.<axis>.motor.current_control.async_phase_velwas moved to<axis>.acim_estimator.stator_phase_vel.<axis>.motor.current_control.async_phase_offsetwas moved to<axis>.acim_estimator.phase.<axis>.motor.timing_logwas removed in favor of<odrv>.task_timesand<odrv>.<axis>.task_times.<axis>.motor.config.directionwas moved to<axis>.encoder.config.direction.<axis>.motor.config.acim_slip_velocitywas moved to<axis>.acim_estimator.config.slip_velocity.- Several properties were changed to readonly.
<axis>.encoder.config.offsetwas renamed to ``.encoder.config.phase_offset`<axis>.encoder.config.offset_floatwas renamed to ``.encoder.config.phase_offset_float`<odrv>.config.brake_resistance == 0.0is no longer a valid way to disable the brake resistor. Use<odrv>.config.enable_brake_resistorinstead. A reboot is necessary for this to take effect.<odrv>.can.set_baud_rate()was removed. The baudrate is now automatically updated when writing to<odrv>.can.config.baud_rate.