Closed davidzwa closed 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)
Python graph ISR period ticks versus speed. Original graph Odometer_isrticks_vs_speed_lowrange.pdf
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}
Resulting speed duty_cycle LUT for an unloaded battery voltage of 7.76V.
PWM period 9000 us, max width 4500 us.
PWM period 7000, max width 4000
Lower PWM period is able to push through lower speeds faster/better and more precisely.
With rounding correction:
Another run:
Goal:
Formulas:
Interrupt edges per REV:
gear_ratio * tacho_lines = 120 * 32 = 3840
My TICKS_PER_REV define https://github.com/davidzwa/advanced-iot-lisat/blob/dc2fbd62b001cd7e7f69eb4d5c7fa3c4a3760171/src/MSP432LISAT/MSP432P401R_LISAT_ccs/Robot/robot.h#L18 Seems to mismatch with O_robot (https://github.com/amjadmajid/O_Robot/blob/d5debd43177ae3c0aecf9000c0d1a12346192689/RobotModel/include/differentialRobot.h#L13)Wheel circumference:
pi * diam = pi * 70mm
Distance per rising edge (interrupt):
wheel_circumference / interrupt_edges_per_rev
Delta distance (tacho):
num_interrupts * distance_per_risingedgeinterrupt
(Pinout config from O_robot):