Firmware > Motor control
Contents
Clock source and Fan Control | Pulse-Width Modulation (PWM) Usage | START/STOP mechanism | Direction Control
Basic Overview:
The blimp’s motor system included three fans: the vertical fan (attached right below the blimp board), the left fan (attached on the left side of blimp board), and the right fan (attached on the right side of the board). The left and right fans both operated simultaneously to control the forward, backward, and turning direction of the board while the vertical fan operated to control the height of the blimp. These fans were connected via a data channel to the motor driver (IC). The different values of the two given inputs sent to the motor IC allowed the blimp to enter four different phases: Standby, Reverse, Forward, and Brake (see IC Truth Table for detail).
Fan Speed Control
Clock source and Fan Control:
With PWM, it is generally important to maintain an accurate clock frequency that allows for fast, adequate timing intervals. Unfortunately, by default, the frequency of the basic clock on the microprocessor was both unstable and quite low. To remedy this, the internally trimmed and accurate reference output frequency (REFO) running at 32,768 Hz was used as the source of ACLK for the TimerA0 and TimerA1 modules to adequately set the PWM duty cycle and period. While this removed the frequency as a method of controlling fan speeds, it allowed the use of accurate PWM settings to change the fan settings, with each fan speed number mapped to a certain speed range. Also, in terms of selecting the fan settings, the user could select a certain fan (with the protocol defined later on) as well as the directionality of the fan (using negative numbers). | Back to contents |
Pulse-Width Modulation (PWM) Usage:
In order to toggle the motor IC input between the four different states (explained above) and regulate fan speed, the PWM duty cycle was altered to achieve the desired functionality. In order to achieve this, the TimerA0 module conveniently built into the MSP430F5510 was utilized to alter the input of the motor IC (as the microprocessor and the IC are directly connected). Two of the “Capture and Control Registers” (TA0CCR2 and TA0CCR4) were used to produce the PWM signal when the blimp was in the rest/set mode to control the left and right fan. However, this approach could not be used for the vertical fan as there was no direct output pin connecting the motor IC to the fan. To get around this, the extra timer module TimerA1 and, more specifically, its timer interrupts for the CCRs (TA1CCR1 and TA1CCR2), were used to set and reset the output pins (P1.0 and P1.1) at controlled intervals. | Back to contents |
START/STOP mechanism:
For the START and STOP commands, the motor IC settings were changed so that the speed of the fans correspond to a certain number, respectively changing the PWM settings and the fan speed of each motor. For our implementation, these settings were set by simply making the PWM value 0 for all the fans (no value set for PWM results in no motor control). Conversely, the START command was achieved by setting the fan speed to a non-zero number for each fan. | Back to contents |
Direction Control:

The command sent to control the speed and direction of blimp was controlled by a visual display on the computer as well as by the Directional Control (D-Pad) on a separate gamepad (e.g. controllor D-pad, racing steering wheel). Controllers were chosen specifically for controlling the blimp as they correspond to a change in position (position maps to a respective x-value and y-value). While the directional graph mapped to the fans were slightly different from a regular x-y graph, the x and y values were multiplied by two different matrices (mapping the graph shown above) and added together based on its directional area. More specifically, the first matrix mapped to the the index of the left motor while the second mapped to the right. As a result, the direction and speed of the fans are converted into a desired two-dimensional plane. | Back to contents |