davidzwa / advanced-iot-lisat

LISAT code for Avanced IoT course
1 stars 0 forks source link

Build O_robot DiffDrive on TI-Driver level + sysconfig #43

Closed davidzwa closed 4 years ago

davidzwa commented 4 years ago

Goal:

Calibrate tachometers together with setting 'millimeter per second' speed of wheels. Integrate with differentialDrive calculations to drive robot straight ahead.

Formulas:

(Pinout config from O_robot):

davidzwa commented 4 years ago

CCS10 graph of the interrupt time-difference (in timerA 32kHz ticks) showing the range of ticks vs how accurate the estimation vs noise will be (in this graph under 100 ticks the line gets very nice). The speed was not known, but the duty cycle was (based on 10000 us PWM. The reason was we didnt have speed conversion yet) Odometer_isrticks_vs_speed

Python graph ISR period ticks versus speed. image Original graph Odometer_isrticks_vs_speed_lowrange.pdf

davidzwa commented 4 years ago

Duty cycle to speed calibration Speed_mm_per_second => {30, 40, 50, 60, 70, 80, 90, 100, 110, 120}; ISR_ticks_expected => {62, 46, 37, 31, 26, 23, 20, 18, 17, 15}

image Resulting speed duty_cycle LUT for an unloaded battery voltage of 7.76V.

PWM period 9000 us, max width 4500 us.

davidzwa commented 4 years ago

PWM period 7000, max width 4000 image

Lower PWM period is able to push through lower speeds faster/better and more precisely.

With rounding correction: image

Another run: image