mirror of
https://github.com/odriverobotics/ODrive.git
synced 2026-08-19 02:43:27 +08:00
Add FOC_Current timer
This commit is contained in:
@@ -48,6 +48,7 @@ public:
|
||||
TaskTimer total;
|
||||
|
||||
TaskTimer uart_poll;
|
||||
TaskTimer FOC_Current;
|
||||
};
|
||||
|
||||
static LockinConfig_t default_calibration();
|
||||
|
||||
@@ -292,6 +292,7 @@ bool Motor::FOC_voltage(float v_d, float v_q, float pwm_phase) {
|
||||
}
|
||||
|
||||
bool Motor::FOC_current(float Id_des, float Iq_des, float I_phase, float pwm_phase, float phase_vel) {
|
||||
axis_->task_times_.FOC_Current.beginTimer();
|
||||
// Syntactic sugar
|
||||
CurrentControl_t& ictrl = current_control_;
|
||||
|
||||
@@ -404,6 +405,7 @@ bool Motor::FOC_current(float Id_des, float Iq_des, float I_phase, float pwm_pha
|
||||
}
|
||||
}
|
||||
|
||||
axis_->task_times_.FOC_Current.stopTimer();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -479,6 +479,7 @@ interfaces:
|
||||
brake_update: TaskTimer
|
||||
adc_cb: TaskTimer
|
||||
total: TaskTimer
|
||||
FOC_Current: TaskTimer
|
||||
|
||||
ODrive.TaskTimer:
|
||||
c_is_class: False
|
||||
|
||||
Reference in New Issue
Block a user