Thursday, July 2, 2009

Deciding torque adjustments


The main purpose of a traction control system is to maintain wheel grip. In order to do this we must detect when a wheel is moving faster than the car. We use two references to control the duty cycle of the PWMs sent to the wheels. First, the car has a desired speed. In order to make calculations as simple as possible we refer everything to the inverse of velocity, which once distance is normalized out, are simply our timed pulse widths. Our desired speed is therefore recorded as a pulse width and all wheels accelerate or decelerate in order to stay within a defined margin of the desired speed. If a wheel is moving significantly slower than the desired speed, then we ensure that no wheel is moving faster than a different pre-defined margin of this slowest wheel. This process allows the car to quickly reach its desired speed without slipping.

Below is a timing diagram for our PWM signal. We programmed the TCNT1 and TCNT2 registers to count from 0 to 256. When we wanted to increase the speed of the wheel and thus the increase the duty cycle on the PWM signal, we would increment the OCRnx register by a fixed value. This was true for the inverse. When we decremented the OCRnx register, the duty cycle of the PWM would decrease. Also note that the frequency of the pulses is identical no matter the duty cycle. We used a frequency of about 31 kHz to optimize the H-bridge functionality.

No comments:

Post a Comment