fix cpplint errors

fix cpplint again
This commit is contained in:
Игорь Брылёв 2025-02-17 18:53:37 +03:00
parent 631cadca26
commit 365124fd91

View file

@ -61,20 +61,20 @@ void setup_foc(MagneticSensorAS5045 *encoder, BLDCMotor *motor,
motor->linkDriver(driver); motor->linkDriver(driver);
motor->linkCurrentSense(current_sense); motor->linkCurrentSense(current_sense);
motor->useMonitoring(Serial); motor->useMonitoring(Serial);
motor->monitor_downsample = 5000; // default 0 motor->monitor_downsample = 5000; // default 0
motor->controller = MotionControlType::angle; motor->controller = MotionControlType::angle;
motor->torque_controller = TorqueControlType::voltage; motor->torque_controller = TorqueControlType::voltage;
motor->foc_modulation = FOCModulationType::SpaceVectorPWM; motor->foc_modulation = FOCModulationType::SpaceVectorPWM;
//PID start // PID start
motor->PID_velocity.P = 0.75; motor->PID_velocity.P = 0.75;
motor->PID_velocity.I = 20; motor->PID_velocity.I = 20;
motor->LPF_velocity.Tf = 0.005; motor->LPF_velocity.Tf = 0.005;
motor->P_angle.P = 0.5 ; motor->P_angle.P = 0.5;
motor->LPF_angle.Tf = 0.001; motor->LPF_angle.Tf = 0.001;
//PID end // PID end
motor->velocity_limit = 40; // Ограничение по скорости вращения rad/s (382 rpm) motor->velocity_limit = 40; // Ограничение по скорости вращения rad/s (382 rpm)
motor->voltage_limit = 24; motor->voltage_limit = 24;
motor->current_limit = 0.5; motor->current_limit = 0.5;
@ -176,7 +176,7 @@ void setup() {
Can.setBaudRate(1000000); Can.setBaudRate(1000000);
TIM_TypeDef *Instance = TIM2; TIM_TypeDef *Instance = TIM2;
HardwareTimer *SendTimer = new HardwareTimer(Instance); HardwareTimer *SendTimer = new HardwareTimer(Instance);
SendTimer->setOverflow(100, HERTZ_FORMAT); // 50 Hz SendTimer->setOverflow(100, HERTZ_FORMAT); // 50 Hz
SendTimer->attachInterrupt(send_data); SendTimer->attachInterrupt(send_data);
SendTimer->resume(); SendTimer->resume();
setup_foc(&encoder, &motor, &driver, &current_sense, &command, doMotor); setup_foc(&encoder, &motor, &driver, &current_sense, &command, doMotor);