Willard is a senior design engineer with Motorola's Advanced Microcontroller Technologies Group. He can be contacted at wild@amcu-tx.sps.mot.com.
Irregular road conditions such as wet or icy roads are a major factor in automobile accidents. Between 1978 and 1983, for instance, auto-related deaths averaged more than 50,000 per year in the United States alone. A substantial number of those accidents were directly attributed to wet pavement, which significantly reduced tire traction, leading to poor braking efficiency. Consequently, maintaining braking efficiency regardless of road conditions--thereby saving lives--has been a major goal of automotive engineers over the last couple of decades. As a result, antilock braking systems are now commonplace in most passenger cars.
Antilock brake systems (ABSs) prevent car wheels from locking when you abruptly slam the brakes on a slippery or wet road by applying consistent and even pressure to all four wheels, assuring that each wheel rotates at the same speed during braking. This prevents the loss of vehicle control that usually follows brake lock.
From a system designer's perspective, an ABS is a complex, embedded-control application requiring control units, sensors, modulators, and software that ties everything together. In this article, I'll describe an ABS designed around Motorola's 68HC05B6 (B6) microcontroller. This article is not intended as a blueprint for ABS implementation, but rather as a set of concepts that will enable you to use the B6 microcontroller in other embedded-system applications.
An ABS can be a separate subsystem (see Figure 1) or it can be integrated into a conventional braking system. In either case, ABSs consist of four major components: the brake modulator, the hydraulic pressure unit, wheel sensors, and the electronic control unit (microcontroller).
A wheel sensor at each wheel continually monitors the wheel's speed during braking. Mismatched wheel speeds are corrected by the brake modulator so that all four wheels continue rotating at the same speed during braking. The modulators typically consist of hydraulic valves, each with a displacement-measurement device, oil reservoir, piston pump (mounted with an electronic motor), and power source.
Wheel sensors are typically either electro-optical semiconductors or electromagnetic mechanical devices. Electro-optical semiconductors track the wheel speed by detecting a light transmission from an LED through a hole at each rotation or partial rotation of the wheel. This light is received by a photo diode that generates a train of pulses to the control unit. Finally, the control unit determines the rate and number of pulses to calculate the speed of a given wheel.
Although electro-optical type sensors are low in cost and resistant to electro-magnetic radiation, they are vulnerable to mud, temperature, and high humidity. Therefore, most ABSs use electromechanical devices, which offer high environmental resistance. The electromagnetic device determines wheel velocity by measuring variations in the induced frequencies caused by road-speed variations. Therefore, wheel speed is determined through the relationship between voltage, frequency, and the rate at which the wheel is turning. As the rate at which the wheel turns increases, so does the frequency of the induced signal and hence the magnitude of the induced voltage. A side effect of inductive sensors is the variation in output voltage to input frequency, and thus, road speeds. This can be compensated for by placing conditioning circuits between the sensor and the microcontroller.
Typical ABS pressure modulation takes place in the auxiliary circuit through a control valve. In this example, a 3-way/3-position valve with functions of pressure build-up, pressure holding, and pressure reduction can apply metered pressure to the auxiliary piston from a hydraulic accumulator. If a wheel is about to lock, pressure is initially supplied to the auxiliary piston so that the ball-seat valve closes. Pressure in the wheel-brake cylinder is thus kept constant. If it is necessary to reduce pressure in the wheel brake to avert wheel locking, further pressure can be applied to the auxiliary piston. This causes the smaller plunger to move to the right so that the plunger-space volume is increased. As a result, wheel-brake pressure decreases. The energy supply and the auxiliary piston space are separate from the plunger space. If the energy supply fails, ABS operations are no longer possible, and a warning lamp must indicate this.
The ABS I'll describe here consists of an electronic control unit (microcontroller), wheel sensors, brake modulators, and hydraulic unit. The electronic control-unit design can be adapted to most sensors, modulators, and hydraulic units. Usually the differences are found in the unit's interfaces and/or software. The controller's signal values can usually be modified through software.
At the heart of this ABS is the 68HC05B6 microcontroller typical of Motorola's 8-bit CSIC ("customer-specified integrated circuit") family of microcontrollers. The B6 is an 8-bit CPU surrounded by memory and internal peripherals and ports; see Figure 2. The B6 is a self-contained computer needing only a keyboard, external RS-232 translator chip, and a monitor to view its contents if monitor code is placed in the B6's ROM. Otherwise, additional external memory chips are needed to store the monitor code.
Through software, the B6 CPU orchestrates communication between internal devices and the outside world. The B6 in Figure 2 has both analog peripherals, including an A/D converter, and digital peripherals, including ROM, EEPROM, and RAM. Other parts include a timer, serial-communications interface, external interrupt, watchdog timer, and two pulse-length D/A converters (PLMA and PLMB). To effectively use a microcontroller such as the B6 as a driver and sensor for an ABS, the B6 ports, timer, and A/D converter are necessary.
Interestingly, the B6 is commonly used in a variety of automotive applications because of its broad autonomy of sensor-intensive features (A/D, ports, D/A, timer capture, and the like). Other automotive applications for the B6 include joystick control for mirrors, cruise control, driver's-side door-switch console control for windows or other apparatus, digital-display control, spark control in carburetted engines, fuel injection, and storing both odometer and diagnostic information. The cruise control, joystick, and driver's-side door-switch console-control applications use the A/D converter. The digital display is accomplished through the general I/O ports. The spark control and fuel injection is accomplished through a complicated closed-loop system that includes the speed from A/D measurements, the timer, the capture, and a PWM (D/A converter). Finally, odometer and diagnostic information can be stored with the EEPROM.
Non-automotive B6 applications include modem control through the SCI and microwave control. Since the B6 feature set is similar to Motorola's HC11-A8, it lends itself to programmers familiar with either controller. In addition, the latest features in the Bx family of microcontrollers include a controller-area network (CAN) (B16 and B32) serial-communications module found in both automotive and industrial applications.
For software development, you can use the Motorola Modular Development System (MMDS-05), which consists primarily of software and a base unit with an adapter that accepts PC-compatible daughterboards for different '05 parts. Breakpoints can be placed on keywords in the assembly code. In addition, the IASM05 assembler is provided with this package. Likewise, Byte Craft (North Waterloo, ON) provides its C-based C6805 Code Development System for the 68HC05 family. Because some MC68HC05 microcontroller instructions have no counterpart in C, special directives identify unique microcontroller characteristics to the compiler. Still, the C6805 system generates source-level debugging information consistent with most available debugging environments. For more information on programming the 68HC05, refer to "C Programming for the 68HC05 Microcontroller," by Truman T. Van Sickle (DDJ, August 1991) and Motorola's Data Book #DL139, Microprocessor, Microcontroller, and Peripheral Data, Vol. 1.
The B6 is used as an integrated ABS controller. A typical scenario for ABS operation might be as follows:
You press the brake pedal. The B6 (which is constantly monitoring the brake pressure through polling routines) determines whether or not the ABS brake modulation should be employed, depending on the relative speed of each wheel. When brake pressure exceeds the safe threshold and a mismatch in wheel speed is encountered, the B6 takes control of the brake-pressure valves by modulating the pressure so that each wheel returns to the same speed, and the car comes to a smooth stop.
In addition to monitoring the brake pressure and wheel speed, the B6 also monitors the fluid level, brake-pedal switch, control-module voltage, brake-valve level, and ignition voltage. If failure is detected in any of these elements, the B6 directs the ABS to shut down. The brake system will behave conventionally until the failure is corrected. (In some sophisticated systems, fault codes corresponding to the problem detected are stored in nonvolatile EEPROM. A trained mechanic can then access these codes and fix the problem.)
The B6 will control and detect a variety of elements in the ABS. However, another microcontroller is often used to monitor system faults and gracefully bring down the system if a problem is encountered. The model control unit discussed here does not use an additional fault-detection microcontroller. Other B6-controlled devices in the ABS include the brake modulator, indicator lamps, and a relay that controls the power to a hydraulic solenoid. The B6 also detects switch closures, wheel-speed sensors, and the voltage level of the power supply used for the hydraulic solenoid. Since the B6 does not include high-current or high-voltage output drivers, buffer units are included between the B6 and automobile devices controlled or sensed by the B6; see Figure 3. Although many functions must be simultaneously controlled by the B6 (sensing the wheel speed and modulating brake values, for instance), only one function can be performed at a time.
In Figure 3, the output drivers typically consist of operational amplifiers (op amps) and high-power output transistors to increase current from the low milliampere range to ranges between 0.5 and 1 amps, for relays and the high-current brake modulator. The input network consists primarily of scaled voltages compatible to the B6 inputs. The scaling can also be performed by op amp circuits.
The B6 timer consists primarily of one 16-bit, software-programmable, binary, free-running upcounter driven by a fixed, divide-by-four prescaler and a control register. Two output-compare registers, two input-compare registers, and the oscillator clocks are also included. The clocks are divided by four, then applied to the counterclock input. The control register includes eight control bits.
The timer can be used for many purposes, including waveform measurement of two input signals and generation of two output waveforms. These functions can also be performed simultaneously. In the waveform measurement, the output of a given waveform is applied to the timer capture (TCAP) input. After each edge from the waveform is generated, the value in the counter is acquired. The pulse-width time is acquired by measuring the time that passed successively between the high and low edge. A period of a waveform is determined by acquiring the counter value after two consecutive high edges.
Since this is a free-running counter, you must know the counter's value when the measurement process begins. Therefore, on the first high edge, the value can be acquired from the timer register and placed on the microcontroller's main data bus, to be fetched by the CPU. This first value is a reference. On the second rising edge, the value in the counter's timer register at that instance is placed on the microcontroller's main data bus and in the CPU, and subtracted from the value found after the first rising edge. The difference is the period or the accumulative time between the successive high and low time of a waveform.
The B6 timer peripheral measures wheel speed. The signal generated by the wheel sensors is not applied directly to the B6. It is first applied to a conditioning circuit, where its high-frequency spikes are removed and its voltage level is brought to a clean 0-5V frequency-modulated, pulsed signal. This fairly clean signal is applied to one of the TCAP input pins on the B6. In this model, the four signals from the sensor outputs are applied through a multiplexer. The output from the multiplexer is applied to both TCAP1 and TCAP2, so that both high- and low-edge transitions can be detected from the wheel sensor. The multiplexer is used so that the timer program can distinguish between the four wheel sensors. PortA bit 0 (PA0) and PortA bit 1 (PA1) control the multiplexer.
The wheel-sensor frequency is directly proportional to the wheel speed. For example, if the maximum frequency produced from the wheel sensor is about 1800 Hz, then the software can be scaled so that an automobile's speed of 100 miles per hour (mph) would be detected as the maximum frequency from the sensor. Conversely, if the vehicle were traveling at about 35 mph, only about 500 Hz would be produced. The wheel-sensor manufacturer specifies output frequency versus wheel speed or revolutions per minute (rpm). From this data, scaling factors can be derived.
If rapid wheel deceleration, excessive wheel slip (the difference between the circumferential speed of the tire and the car's forward speed), or incompatible wheel speeds are detected, the hydraulic system's fluid is activated within milliseconds by the control unit. The brake modulator then corrects the differences in wheel speeds. When wheel speeds are found incompatible, the software directs the computer to rectify the problem.
Wheel-speed correction is performed through the brake modulator. By pulsing the brakes of those wheels rotating beyond a common threshold, the wheels reduce their speed. Like the wheel-speed sensor, the brakes are modulated one wheel at a time. Again, the speed of each wheel is examined. If the speed of all four wheels match within a specified tolerance, the modulation will cease; otherwise additional modulation is performed. For example, the software could specify that if any of the wheel-sensor inputs differs from the highest by more than 10 percent, then the ABS should activate the modulator to obtain speeds with this range.
PortA, pins 2, 3, 4, and 5, provide the signals for the brake modulators. Buffers as seen in Figure 3 are used to raise port- output levels high enough for each modulator input. A modulated pulse train is produced at the output of each of these port pins when needed. For high-frequency damping, each pulse follows the other closely. Conversely, for low-frequency clamping of the wheel through the brake modulator, pulses are more widely spaced. Figure 4 is the algorithm for the software that governs wheel-speed correction.
The B6 A/D converter consists of an 8-bit, successive-approximation converter and a 16-channel multiplexer. Eight of these channels are for input; the remainder are used for internal test functions. The eight analog inputs are available at Port D, bits 0-7. Port D becomes an I/O port if the A/D converter is disabled.
The A/D converter also includes a control-status register and a data-results register. The analog inputs are selected through bits 0-3 of the A/D's control/status register. Results of each conversion are available in the data register.
An external voltage reference is used for the A/D because drops caused by loading in the power-supply lines would degrade the accuracy of the A/D conversion.
For ratio-metric conversions, the source of each analog input should use VRH at the supply voltage and be referenced to VRL, the lowest voltage converted. For a typical input voltage equal to or exceeding VRH, the highest voltage converted, $FF converts as (full scale) with an overflow indication. Input voltages equal to VRL convert as $00.
Faults such as low fluid levels or low voltage can be determined through level-sensitive inputs--that is, through the A/D converter. Each monitored device is applied to a dedicated A/D input pin.
A minimum threshold level is specified for each device monitored. If an input falls below a given threshold, a fault code associated with that device can be written to EEPROM. Since a fault code was detected, the microcontroller can direct the ABS to be removed from the brake system until a trained mechanic can rectify the problem. Figure 5 presents the algorithm for the software that checks for faults.
Many automobile companies are currently focusing their attention on the development of systems more advanced than ABS, such as traction control. In the meantime, ABSs continue to provide a smoother, safer ride.
Figure 1: Four-wheel antilock brake system.
Figure 2: 68HC05B6 block diagram.
Figure 3: System view of ABS A/D interface.
Figure 4: Monitoring and correcting wheel speed.
Figure 5: Guidelines for checking faults.
Copyright © 1995, Dr. Dobb's Journal