SLAA235A February 2005 – August 2018 MSP430F147 , MSP430F147 , MSP430F148 , MSP430F148 , MSP430F149 , MSP430F149
The software performs these operations:
This timeout is needed if the motor is not running, because no capture events would be generated, and the software would wrongly assume that the motor is still running. However, this timeout updates the global variable CurrentSpeed, and the control algorithm continues to work. Timer_A is operated in continuous mode to avoid that any software latency affects the measurements.
Timer_B is operated in up mode and driven by the 8-MHz clock source. With the period register set to 3999, the effective PWM output frequency is 8 MHz / (3999 + 1) = 2 kHz. This frequency gives a fine granularity to adjust the motor power, resulting in a smoother control. For this application, the capture/compare block selection of Timer_A and Timer_B is arbitrary.
For detailed information on timer configuration and operation, see the MSP430x1xx Family User’s Guide.
The two definitions PWM_Min and PWM_Max are used to limit the motor duty cycle and may need to be adjusted depending on the application and load conditions.
For a discussion of the fuzzy algorithms, see Section 1.
Figure 7 and Figure 8 show example motor startup operations using the test setup developed to verify this application report. The motor target speed is set to 50 rotations per second. The graphs show the startup without a mechanical load and with a mechanical load.