mirror of
https://github.com/odriverobotics/ODrive.git
synced 2026-09-21 07:14:22 +08:00
rename psu current fault levels
This commit is contained in:
@@ -174,11 +174,11 @@ bool Axis::do_checks() {
|
||||
}
|
||||
}
|
||||
|
||||
if (Ibus_sum > board_config.power_supply_max_current) {
|
||||
if (Ibus_sum > board_config.dc_max_positive_current) {
|
||||
error_ |= ERROR_DC_BUS_OVER_CURRENT;
|
||||
}
|
||||
if (Ibus_sum < board_config.power_supply_min_current) {
|
||||
error_ |= ERROR_DC_BUS_UNDER_CURRENT;
|
||||
if (Ibus_sum < board_config.dc_max_negative_current) {
|
||||
error_ |= ERROR_DC_BUS_OVER_REGEN_CURRENT;
|
||||
}
|
||||
|
||||
// Sub-components should use set_error which will propegate to this error_
|
||||
|
||||
@@ -24,7 +24,7 @@ public:
|
||||
ERROR_MIN_ENDSTOP_PRESSED = 0x1000,
|
||||
ERROR_MAX_ENDSTOP_PRESSED = 0x2000,
|
||||
ERROR_ESTOP_REQUESTED = 0x4000,
|
||||
ERROR_DC_BUS_UNDER_CURRENT = 0x8000, // too much current pushed into the power supply
|
||||
ERROR_DC_BUS_OVER_REGEN_CURRENT = 0x8000, // too much current pushed into the power supply
|
||||
ERROR_DC_BUS_OVER_CURRENT = 0x10000, // too much current pulled out of the power supply
|
||||
ERROR_HOMING_WITHOUT_ENDSTOP = 0x20000, // the min endstop was not enabled during homing
|
||||
};
|
||||
|
||||
@@ -101,8 +101,8 @@ struct BoardConfig_t {
|
||||
//!< The closer the voltage approaches dc_bus_overvoltage_trip_level,
|
||||
//!< the more power is sunk into the resistor.
|
||||
//!< This feature is disabled if dc_bus_overvoltage_trip_level <= nominal_voltage.
|
||||
float power_supply_max_current = INFINITY; // Max current [A] the power supply can source
|
||||
float power_supply_min_current = -INFINITY; // Max current [A] the power supply can sink
|
||||
float dc_max_positive_current = INFINITY; // Max current [A] the power supply can source
|
||||
float dc_max_negative_current = -INFINITY; // Max current [A] the power supply can sink
|
||||
PWMMapping_t pwm_mappings[GPIO_COUNT];
|
||||
PWMMapping_t analog_mappings[GPIO_COUNT];
|
||||
};
|
||||
|
||||
@@ -167,8 +167,8 @@ static inline auto make_obj_tree() {
|
||||
make_protocol_property("enable_ascii_protocol_on_usb", &board_config.enable_ascii_protocol_on_usb),
|
||||
make_protocol_property("dc_bus_undervoltage_trip_level", &board_config.dc_bus_undervoltage_trip_level),
|
||||
make_protocol_property("dc_bus_overvoltage_trip_level", &board_config.dc_bus_overvoltage_trip_level),
|
||||
make_protocol_property("power_supply_min_current", &board_config.power_supply_min_current),
|
||||
make_protocol_property("power_supply_max_current", &board_config.power_supply_max_current),
|
||||
make_protocol_property("dc_max_negative_current", &board_config.dc_max_negative_current),
|
||||
make_protocol_property("dc_max_positive_current", &board_config.dc_max_positive_current),
|
||||
#if HW_VERSION_MAJOR == 3 && HW_VERSION_MINOR >= 3
|
||||
make_protocol_object("gpio1_pwm_mapping", make_protocol_definitions(board_config.pwm_mappings[0])),
|
||||
make_protocol_object("gpio2_pwm_mapping", make_protocol_definitions(board_config.pwm_mappings[1])),
|
||||
|
||||
@@ -32,7 +32,7 @@ class errors:
|
||||
ERROR_MIN_ENDSTOP_PRESSED = 0x1000
|
||||
ERROR_MAX_ENDSTOP_PRESSED = 0x2000
|
||||
ERROR_ESTOP_REQUESTED = 0x4000
|
||||
ERROR_DC_BUS_UNDER_CURRENT = 0x8000
|
||||
ERROR_DC_BUS_OVER_REGEN_CURRENT = 0x8000
|
||||
ERROR_DC_BUS_OVER_CURRENT = 0x10000
|
||||
ERROR_HOMING_WITHOUT_ENDSTOP = 0x20000
|
||||
|
||||
|
||||
Reference in New Issue
Block a user