Driver.voltage_power_supply value isn't used

Hi All,

When experimenting in torque FOC current mode, I noticed that the Voltage.d would only increase to exactly 12.0 despite me setting driver.voltage_power_supply to 20 and driver.voltage_limit to 19.
After a bit of hunting I can see that this is due to the following line located at line 197 in FOCMotor.h (i am using the genericSTMF405RG variant):
PIDController PID_current_d{DEF_PID_CURR_P,DEF_PID_CURR_I,DEF_PID_CURR_D,DEF_PID_CURR_RAMP, DEF_POWER_SUPPLY};//!< parameter determining the d current PID config

The final parameter to the function is a default voltage value of 12 which is defined in defaults.h.

Am I missing something to override the defaults?


You mean voltage.q ?
Have you set motor.voltage_limit ? That’s different then driver.voltage_limit.
Anyway don’t expecting to reach 19v:

Yep sorry i mean voltage.q :slight_smile:
Cool ill have a look at the motor voltage limit shortly