so, here Is my setup for D6374+AS5047p (SPI mode)
odrv0.axis0.encoder.config.mode=257
odrv0.axis0.encoder.config.mode.cpr=2**14
odrv0.axis0.encoder.config.abs_spi_cs_gpio_pin=4
odrv0.save_configuration() //YOU MUST SAVE&REBOOT OTHERWISE
odrv0.reboot() //IT WILL NOT WORK ?
odrv0.axis0.requested_state = AXIS_STATE_FULL_CALIBRATION_SEQUENCE
odrv0.axis0.encoder.config.pre_calibrated = True
odrv0.axis0.motor.config.pre_calibrated = True
#adjust gains here:
odrv0.axis0.controller.config.pos_gain=100
#my default gain was 20
#so…default gain x5
#odrv0.axis0.controller.config.vel_gain#leave it
#my default gain was 0.16
odrv0.axis0.controller.config.vel_integrator_gain=3
#my default gain was 0.33333
#default gain x 10
odrv0.axis0.controller.config.control_mode = CTRL_MODE_POSITION_CONTROL
odrv0.axis0.requested_state = AXIS_STATE_CLOSED_LOOP_CONTROL
odrv0.axis0.controller.start_anticogging_calibration()
#after ~1 minute (the motor shaft slowly moves in one direction. when its finished it spins back to initial position?
#adjust gains back to the default values
odrv0.axis0.controller.config.pos_gain=20
odrv0.axis0.controller.config.vel_integrator_gain=0.3
odrv0.axis0.controller.config.anticogging.pre_calibrated = True
odrv0.save_configuration()
odrv0.reboot()
####################
odrv0.axis0.controller.config.anticogging.anticogging_enabled=True
odrv0.axis0.requested_state = AXIS_STATE_CLOSED_LOOP_CONTROL
odrv0.axis0.controller.config.anticogging.anticogging_enabled=True/False - to check if it works
So, it looks like if you do the above sequence (spi encoder), after every boot you can go straight to closed loop control and everything shoud be done. Theres no need to do the motor and encoder calibration. ?