Compared with analog electronic instruments, stepper motor-type instruments have more uniform scale division, better pointer repeatability, faster response speed, less jitter, and a more fundamental guarantee of product quality stability and reliability [1]. Therefore, stepper motor-type automotive instruments are gradually becoming popular in China. These automotive instruments typically use a microcontroller to drive a stepper motor to rotate the instrument pointer. While microcontroller control of stepper motors generally requires an external drive circuit, using a dedicated automotive instrument stepper motor driver integrated circuit can simplify the hardware and software design of the automotive instrument and improve its stability and reliability. This paper introduces and compares the performance characteristics of commonly used domestic drivers, and finally uses the MC33991 produced by Freescale Semiconductor as an example to design a speedometer.
1. Comparison of the characteristics and performance of commonly used instrument motor drive chips
Commonly used stepper motor driver chips for instruments in China include the X12.017 from SWITEC (Sweden), the VID66-06 from Weiying Group, and the MC33991 from Freescale (USA).
Key features of 1.1X12.017 and VID66-06
The SWITEC X12.017 stepper motor is widely used in China and can simultaneously drive four cross-coil stepper motors. The VID66-06 has the same control method as the X12.017, and its performance parameters are also basically the same. Their main characteristics are as follows.
a. Driven by microsteps, each pulse corresponds to a rotation of (1/12)° of the motor output shaft.
b. Each motor only needs two control terminals: speed and direction.
c. All input pins have interference filters; low electromagnetic interference radiation.
d. Operating temperature range: -40℃ to 105℃; operating voltage range: 4.5V to 5.5V.
This type of driver is simple to control. The input signal CW/CCW controls the rotation direction of the stepper motor, and the rising edge of the input signal F(scx) drives the motor to rotate one microstep. The rotation speed of the motor can be controlled by the frequency of the sent pulses.
1.2 Main Features of MC33991
The MC33991 is a separately packaged circuit that communicates via SPI (Serial Peripheral Interface) and can simultaneously control the drive circuits of two stepper motors. This circuit can also mimic the movement of air gap flux, converting ordinary motors into stepper motors for control. It has the following main features [3].
a. There are 4096 static indicator positions, which drive the pointer indication after receiving a position command.
b. Maximum pointer sweep range: 340 degrees; maximum pointer speed: 400 dec/s; maximum pointer acceleration: 4500 dec/s.
c. Apply microstep control technology (each step is subdivided into 12 microsteps).
d. Pointer zeroing calibration ensures accurate zeroing.
e. 16-bit SPI (Serial Peripheral Interface) uses fewer I/O ports for communication.
f. Internal clock calibration function; lower power consumption in sleep mode.
g. Operating temperature: -40~125℃; Power supply voltage range: 6.5~26V.
The MC33991 allows setting the maximum speed of the stepper motor. It features an internal state machine that ensures, during normal operation, the driver receives a position command, reaches the maximum speed with constant acceleration, decelerates at an appropriate time, and ensures that the deceleration does not exceed the maximum deceleration. Upon reaching the designated position, the speed equals zero, preventing pointer jitter. Furthermore, the MC33991 can allow two stepper motors or one of them to operate. Its internal diagnostic functions can diagnose whether a single stepper motor is overheating, whether the battery voltage is too high or too low, the pointer's zero-return state, the driver's internal clock status, and whether the instrument's pointer is rotating. From these performance characteristics, it can be seen that the MC33991 has richer functions than the X12.017 and VID66-06, such as overvoltage and overheat diagnostic functions and zero-return verification functions. Moreover, when using the X12.017 and VID66-06 as drivers, to ensure smooth pointer operation, the stepper motor speed must be subdivided in the microcontroller program; otherwise, overshoot jitter is likely to occur.
2. Car speedometer design using MC33991
During vehicle operation, the vehicle speed sensor generates pulse signals with a frequency proportional to the vehicle speed. These pulse signals are filtered and amplified before being sent to the microcontroller. The microcontroller uses an input capture channel to capture the interval between two pulse signals and calculates the vehicle speed based on this interval. Finally, the microcontroller converts the calculated speed into a position command and sends it to the MC33991, which drives a stepper motor to point to the corresponding scale.
This design uses the MC68HC908GR16 microcontroller as the main control chip and a SWITEC X15.288 instrument stepper motor as the actuator. The MC68HC908GR16 is an 8-bit microcontroller manufactured by Freescale Semiconductor, with 16KB of on-chip FLASH memory and 1KB of RAM. Its internal phase-locked loop (PLL) can upscale the external 32.768kHz crystal oscillator frequency to an internal bus frequency of 8MHz. The microcontroller integrates an enhanced serial communication module (ESCI), an 8-channel 10-bit A/D module, an SPI module, an 8-bit keyboard module, and two independent 16-bit timers, each consisting of a timer/counter and two input/output channels. It also integrates a timer base module, which can periodically wake the microcontroller from STOP mode.
The MC33991 has six internal registers. The microcontroller controls and reads the MC33991's operating status by sending 16-bit SPI commands to these registers. Bits 15-13 of the 16-bit SPI data represent the address. After receiving a command from the microcontroller, the MC33991 compares bits 15-13 of the command with these addresses and places the data into the corresponding register. The addresses and functions of these registers are listed in Table 1. The microcontroller uses these registers to control the motor's maximum speed, pointer position, pointer return to zero, and to read the motor's operating status, whether the coil is overheating, and whether the voltage is too high or too low.
2.1 Hardware Circuit Design
The hardware circuit includes a speed sensor signal conditioning circuit and an interface circuit between the microcontroller and the MC33991.
2.1.1 Velocity Pulse Detection Circuit
The vehicle speed sensor converts the vehicle speed signal into a pulse signal, the frequency of which is proportional to the vehicle speed. This pulse signal is sent to the microcontroller's T1CH0 (TImer1channel0) via a conditioning circuit, as shown in Figure 1. When there is no pulse signal input, the transistor's collector and emitter are off, and the pulse conditioning circuit outputs a high level. When a pulse signal is input, the transistor is on, and the conditioning circuit output switches to a low level.
2.1.2 MC33991 Interface Circuit
The microcontroller MC68HC908GR16 and MC33991 communicate via the Serial Peripheral Interface (SPI). The interface circuit of the microcontroller, MC33991, and instrument stepper motor is shown in Figure 2.
Table 1 MC33991 Internal Registers