File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -42,11 +42,12 @@ void BLDCMotor::init() {
42
42
// current control loop controls voltage
43
43
PID_current_q.limit = voltage_limit;
44
44
PID_current_d.limit = voltage_limit;
45
+ }
46
+ if (_isset (phase_resistance) || torque_controller != TorqueControlType::voltage){
45
47
// velocity control loop controls current
46
48
PID_velocity.limit = current_limit;
47
- }else if (!current_sense && _isset (phase_resistance)){
48
- PID_velocity.limit = current_limit;
49
49
}else {
50
+ // velocity control loop controls the voltage
50
51
PID_velocity.limit = voltage_limit;
51
52
}
52
53
P_angle.limit = velocity_limit;
Original file line number Diff line number Diff line change 28
28
#define DEF_CURR_FILTER_Tf 0.005f //!< default currnet filter time constant
29
29
#endif
30
30
// default current limit values
31
- #define DEF_CURRENT_LIM 0.2f //!< 2Amps current limit by default
31
+ #define DEF_CURRENT_LIM 2.0f //!< 2Amps current limit by default
32
32
33
33
// default monitor downsample
34
34
#define DEF_MON_DOWNSMAPLE 100 //!< default monitor downsample
You can’t perform that action at this time.
0 commit comments