The calibration utility does not work on esp32. Please use test_motors and test_sensors.
Before proceeding, ensure that your robot is elevated and the wheels aren't touching the ground. 5.1
Go to calibration folder and upload the firmware:
cd linorobot2_hardware/calibration
pio run --target upload -e <your_teensy_board>
Available Teensy boards:
- teensy31
- teensy35
- teensy36
- teensy40
- teensy41
Some Linux machines might encounter a problem related to libusb. If so, install libusb-dev:
sudo apt install libusb-dev
sudo apt remove brltty (conflict with some UART adaptor)
Start spinning the motors by running:
screen /dev/ttyACM0
On the terminal type spin
and press the enter key.
The wheels will spin one by one for 10 seconds from Motor1 to Motor4. Check if each wheel's direction is spinning forward and take note of the motors that are spinning in the opposite direction. Set MOTORX_INV constant in lino_base_config.h to true
to invert the motor's direction. Reupload the calibration firmware once you're done. Press Ctrl
+ a
+ d
to exit the screen terminal.
cd linorobot2_hardware/calibration
pio run --target upload -e <your_teensy_board>
Open your terminal and run:
screen /dev/ttyACM0
Type sample
and press the enter key. Verify if all the wheels are spinning forward. Redo the previous step if there are motors still spinning in the opposite direction.
You'll see a summary of the total encoder readings and counts per revolution after the motors have been sampled. If you see any negative number in the MOTOR ENCODER READINGS section, invert the encoder pin by setting MOTORX_ENCODER_INV
in lino_base_config.h to true
. Reupload the calibration firmware to check if the encoder pins have been reconfigured properly:
cd linorobot2_hardware/calibration
pio run --target upload -e <your_teensy_board>
screen /dev/ttyACM0
Type sample
and press the enter key. Verify if all encoder values are now positive. Redo this step if you missed out any.
On the previous instruction where you check the encoder reads for each motor, you'll see that there's also COUNTS PER REVOLUTION values printed on the screen. If you have defined MOTOR_OPERATING_VOLTAGE
and MOTOR_POWER_MEASURED_VOLTAGE
, you can assign these values to COUNTS_PER_REVX
constants in lino_base_config.h to have a more accurate model of the encoder.