feat(tools): add ESP32 ADC calibration and LUT linearization utility - #150
Conversation
|
Tick the box to add this pull request to the merge queue (same as
|
286cc78 to
029f703
Compare
029f703 to
f4f9316
Compare
|
Thanks for this. I tested it on a Sparkfun Thing Plus with ESP32 WROOM. It seems to work as expected. This is an "expert" tool - you need to have a good hardware understanding. You need to connect pin 25 to whatever your battery pin is, and either disconnect the battery sense electronics, or be confident that the DAC pin can overdrive the battery sense electronics, or else you may get erroneous results. In order to use the results, you need to insert the generated table into the LUT section of the config file. These are the sorts of in-depth documentation notes that really need to be in a documentation section that describes how to use the config file. I have in mind what that should look like, but at some point I want to organize the lower section of the config files a bit better by separating and commenting the sections like "syslog config" and I2C config and Lidar config. But I think that should be done in concert with documentation that tells how to customize the config file for your robot - which is something that doesn't really exist at the moment - what's in your wiki is the closest thing to that, but it doesn't go to this level of detail. |
Summary
Adds the
adc_calibratestandalone diagnostic firmware utility:BATTERY_PINacross 500 calibration iterations.ADC_LUT[4096]) over serial (115200baud).extra_configs = ../firmware/platformio.inisourcing matchingtest_sensors,test_motors, andtest_acc.Verification
esp32,esp32s2,esp32s3,gendrv.