update pid default parameters
This commit is contained in:
parent
5fa3db6e6c
commit
10c7da1107
1 changed files with 6 additions and 4 deletions
|
@ -45,13 +45,15 @@ void setup_foc(MagneticSensorAS5045 *encoder, BLDCMotor *motor,
|
|||
motor->foc_modulation = FOCModulationType::SpaceVectorPWM;
|
||||
|
||||
// PID Configuration
|
||||
motor->PID_velocity.P = 0.75f;
|
||||
motor->PID_velocity.I = 20.0f;
|
||||
motor->LPF_velocity.Tf = 0.005f;
|
||||
motor->PID_velocity.P = 0.5f;
|
||||
motor->PID_velocity.I = 2.0f;
|
||||
motor->PID_velocity.D = 0.0f;
|
||||
|
||||
motor->LPF_velocity.Tf = 0.01f;
|
||||
motor->P_angle.P = p;
|
||||
motor->P_angle.I = i;
|
||||
motor->P_angle.D = d;
|
||||
motor->LPF_angle.Tf = 0.001f;
|
||||
motor->LPF_angle.Tf = 0.02f;
|
||||
|
||||
// Motor limits
|
||||
motor->velocity_limit = 40; // Speed limit in rad/s (382 rpm)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue