dzid26 / StepperServoCAN

Closed loop stepper motor controller with CANbus capabilities. This Project open source hardware and code, support platformio build and upload firmware.
https://shop.retropilot.org/product/stepperservocan
19 stars 5 forks source link

Calibrate Chip Temp Vsense on startup #19

Open dzid26 opened 11 months ago

dzid26 commented 11 months ago

The temperature sensor output voltage changes linearly with temperature. The offset of this line varies from chip to chip due to process variations (up to 45 °C from one chip to another). This is extreme but possible. In reality those chips seem pretty consistent

Nevertheless, calibration can be performed using temperature values from TLE5012 on startup stash@{4}

Later TLE5012 temperature could be read all the time and compared against the STM32 temperature or maximum taken, but this has to be handled properly so that extra SPI usage doesn't cause conflict or delays.

To calibrate STM32 VSENSE these variables have to be adjusted https://github.com/dzid26/StepperServoCAN/blob/7d2c3d215a03a12c1cfb366de8165aa6e4476de9/firmware/src/BSP/board.c#L326-L327

image