-
Notifications
You must be signed in to change notification settings - Fork 667
Description
This is a simplified template, feel free to change it if it does not fit your case.
Describe the bug
Board: b_g431b_esc1
Trying to update from 235 to 240.
Using simplefoc/SimpleFOCDrivers @ 1.0.9
"encoders/as5600/MagneticSensorAS5600.h"
I2C @ 1MHz
FOC executed @ 9khz (ISR) (~80% load on FOC task including i2c comms)
Read 2 adc's:
_readADCVoltageLowSide(A_TEMPERATURE, currentSense.params)
_readADCVoltageLowSide(A_VBUS, currentSense.params)
More noise is also present if motor.PID_velocity.P,I,D are all zero for velocity controller. Though noise increase a lot when it tires to drive.
Sensor alignment sounds normal.
Initializing steps:
MagneticSensorAS5600 encoder;
#define PhaseR 0.091
BLDCMotor motor = BLDCMotor(8, PhaseR, 610.0 * 1.15); // SimpleFOC suggests set KV 10-15% higher than advertized. 15% used. Motor is 610KV
BLDCDriver6PWM driver = BLDCDriver6PWM(A_PHASE_UH, A_PHASE_UL, A_PHASE_VH, A_PHASE_VL, A_PHASE_WH, A_PHASE_WL);
LowsideCurrentSense currentSense = LowsideCurrentSense(0.003f, -64.0f / 7.0f, A_OP1_OUT, A_OP2_OUT, A_OP3_OUT);
Wire.setClock(1000000);
encoder.closeTransactions = false;
encoder.init();
Wire.setClock(1000000);
motor.linkSensor(&encoder);
driver.voltage_power_supply = 12;
driver.init()
motor.linkDriver(&driver);
currentSense.linkDriver(&driver);
currentSense.init()
currentSense.skip_align = false;
motor.linkCurrentSense(¤tSense)
motor.voltage_sensor_align = 1.5;
motor.velocity_index_search = 1;
motor.controller = MotionControlType::velocity;
motor.torque_controller = TorqueControlType::foc_current;
motor.foc_modulation = FOCModulationType::SpaceVectorPWM;
#define VelPID_P 0.05
#define VelPID_I 0.15
#define VelPID_D 0.0008
motor.PID_velocity.P = VelPID_P;
motor.PID_velocity.I = VelPID_I;
motor.PID_velocity.D = VelPID_D;
motor.PID_velocity.output_ramp = 100;
motor.LPF_velocity.Tf = 0.1;
motor.voltage_limit = 5;
motor.current_limit = 13;
motor.velocity_limit = ~4000/ RPMconversion;
motor.init();
motor.initFOC();
Anything obvious that would cause 240 to not work, when 235 is?
Thanks.
Describe the hardware setup
For us it is very important to know what is the hardware setup you're using in order to be able to help more directly
8PP 610kV 4225
b_g431b_esc1
AS5600 I2C
motor.linkCurrentSense(¤tSense);
IDE you are using
- Platformio