Correct Way to use UART for S1

I’m trying to get a custom STM32F730 PCB to talk to my S1 controller, but it seems to be ignoring the data. The S1 is running the latest firmware 0.6.10 and seems to respond to orivetool commands via USB.

I’ve performed the following from OdriveTool:

odrv0.config.uart_a_baudrate = 115200
odrv0.config.enable_uart_a = True
odrv0.config.gpio6_mode = GpioMode.UART_A
odrv0.config.gpio7_mode = GpioMode.UART_A
odrv0.save_configuration()

Then I send the following from my STM32 board over UART:

printf("w axis0.controller.config.vel_limit 2\r\n"); 	// Velocity for axis Calibration
HAL_Delay(500);                                        	// 0.5 second delay

printf("w axis0.requested_state 7\r\n");   	// Calibrate axis encoder
HAL_Delay(5000);                                      	// 5 second delay

printf("w axis0.requested_state 8\r\n");          	// Set axis to Closed Loop Control
HAL_Delay(2000);                                      	// 2 second delay

printf("w axis0.controller.config.vel_limit 40\r\n");	// Set axis velocity to 40 RPS
HAL_Delay(500);                                        	// 0.5 second delay

I get no reaction t all.

I’ve tested the output fro the STM32 board to an RS232 interface to my computer and the data is being sent correctly and I’ve checked the signal with an oscilloscope as further confirmation.

My UART interface is as follows:

Tx out from STM32 board goes to pin 8 of J11
Rx In from STM32 board goes to pin 7 of J11
+3.3 VDC goes to pin 9 of J11
GND goes to pin 10 f J11.

I am thinking that the physical connection and timing are correct, but suspect that the semantics for my commands are wrong. I’ve also tried replacing axis0 with odrv0 (as well as 1 for both cases).

Hi! Semantics look fine, wiring looks fine. None of those commands should necessarily result in any output from the ODrive, and if there’s some other error on the ODrive, then it won’t enter closed loop for whatever reason’s causing that error. You can double-check by trying to read some property – e.g. printf("r hw_version_major\r\n");, which should result in a response of 5.

I will try that, thanks!

It’s been a few years, but memory seems to point to the command: w axis0.requested_state 7\r\n should initiate the calibration sequence, but nothing happens.

I agree, w axis0.requested_state 7\r\n should result in putting the ODrive in ENCODER_OFFSET_CALIBRATION. However, the ODrive may be experiencing another error (whether operating or configuration) that prevents it from entering this state. Are you able to configure and run it via ODrivetool or the GUI? Can you share any errors that the ODrive returns, via either dump_errors(odrv0) or the status readout in the GUI (bottom left corner)?

As well, can you share the other calibration and configuration you’ve done on the ODrive? I’m assuming you’ve already set up the motor and encoder configuration, and done motor calibration.

The errors I get are:
THERMISTER.DISCONNECTED
ProcedureResult.NOT.CALIBRATED

I don’t think the thermister is the issue, but maybe I am missing a step with setup?

THERMISTOR_DISCONNECTED means you enabled the thermistor in your configuration but one’s not connected properly. Could you share your wiring and your entire configuration?

Isn’t the thermister internal on the S1?

I wanted to add, I really appreciate you taking the time to help me.

So, disabling the thermister did the trick. I can now control the unit via the UART.