Changed initial motor setpoint to the current angle, so that motor doesn't make a violent move on startup
This commit is contained in:
@@ -265,7 +265,10 @@ uint8_t configureFOC(void)
|
||||
// SERIALPORT.printf("Current Sense init result: %i\n", ret);
|
||||
// motor.linkCurrentSense(¤tsense);
|
||||
|
||||
motor.target = 10;
|
||||
sensor.update();
|
||||
float start_angle = motor.shaftAngle();
|
||||
motor.target = start_angle;
|
||||
SIMPLEFOC_DEBUG("Setting Motor target to current position");
|
||||
|
||||
motor.zero_electric_angle = NOT_SET;
|
||||
motor.sensor_direction = Direction::UNKNOWN;
|
||||
@@ -333,4 +336,4 @@ void userButton(void)
|
||||
jump_to_bootloader();
|
||||
else
|
||||
digitalToggle(LED_FAULT);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user