A new high-performance car may have 100 million lines of code written into its electronic brains. Like it or not, you are depending on a long string of instructions that someone has keyed into a computer (a fact I try not to think about when I'm on the race track, hoping that the brakes are going to work.) A few misplaced digits can spell disaster. And so the age of the digital dragon slayer has arrived - the engineer who knows how to keep software from killing you.
This was driven home when I visited a group of student engineers at McMaster University to watch them work on the car of the future. Well, it wasn't actually one particular car, but a whole fleet of them, all designed to replace a human driver with computer software.
"We've been working on it since October," said Nick Leerenveld, 23-year-old mechatronics student. Leerenveld and his team had spent countless hours producing a miniature Nissan 350Z packed with circuit boards, microprocessors, and a digital camera mounted on an aluminum mast that made the car look like a Le Mans racer crossed with a U-boat.
The camera would be the car's eyes, watching the road ahead to determine whether the car was between the white lines, and whether there was an obstacle ahead. But the camera's video images had to be interpreted. To do this, the team spent months writing thousands of lines of computer code - I watched as they scrolled through it, screen after screen of instructions that would tell the car what to do. Now it was time for a road test.
The first lap went passably. The car sensed the white tapes that defined the edges of the lane, and automatically steered through the curve. But now it was time for the obstacle test. A team member placed a rectangular piece of foam board on the track to see if the car would avoid it. The car drove up to the obstacle, slowed and angled itself in a new direction. But not enough - the obstacle toppled. Leerenvold's team sighed and got out their laptops. It was time to write more code.
"It probably didn't recognize the obstacle because it was on a new angle," said Leerenveld. "More work."
Looking over the scene was Allan Wassyng, a McMaster professor and veteran software expert who has worked on countless programming initiatives (including the code that controls the Darlington nuclear plant). Now he's working on a new McMaster project called The Cognitive Car.
With sponsorship from IBM and the Ontario government, the Cognitive Car is a research effort aimed at advancing digital automotive design. The ultimate objective: get rid of human drivers altogether. But there's more to it than that. Wassyng and his colleagues are looking at everything from fuel efficiency to a new modular dash system that will reduce driver distraction.
"There are a tremendous number of things that can be done," says Wassyng. "It's exciting."
When it comes to car design, software is the new El Dorado.
Manfred Broy, a professor at Munich's Technical University and a leading expert on automotive software, has estimated that more than 80 per cent of car innovations now come from computer systems, and that software is now the single biggest contributor to a car's value - and its cost.
Software can create as many problems as it solves. Just ask Toyota, which was forced to spend millions hunting down software glitches in the first-generation Prius that could make the car shut down at highway speed. Virtually every manufacturer has wrestled with software demons. Case in point: BMW, which was confounded when drivers of some of its early digital cars claimed that changing radio channels altered their engine's performance. (It turned out to be true - the problem was ultimately pinned down to bandwidth issues in a shared circuit bus.)
Although software has become much more reliable, the potential for trouble is still there. Prof. Wassyng and his colleagues at McMaster are working to develop new software standards that will ensure that digital systems are designed and tested as thoroughly as mechanical ones are now.
"There is tremendous pressure to roll out new software features. It's the single biggest change you can make to a car," says Wassyng. "But there are no real standards. We think there should be."
Automotive engineering has gone through a series of distinct eras since the first car was built in 1889. Now the digital age is upon us, and billions of dollars are at stake, not to mention countless lives. Wassyng and his colleagues believe software safety is still in its formative stages.
Software safety depends on identifying logic flaws that may be buried in millions of lines of code. And there are countless pitfalls. When Wassyng helped design the software that controls the Darlington nuclear plant, for example, he and his colleagues considered countless scenarios. But then they encountered something that none of them had envisioned: an operator fell asleep, slumped over a control console, and pressed the On and Off buttons on a control panel at the same time.
Although nothing serious happened, they learned that even the most careful designers can miss something. "We tried to think of everything," Wassyng says. "But we didn't see this one coming."
Surprisingly, digital systems for cars present far greater problems than those designed for airplanes. This is partly due to sheer complexity: The radio and navigation system in a new Mercedes-Benz requires more than 20 million lines of code, and the car contains almost as many electronic control units as a new Airbus A380 jumbo jet.
This complexity has created new problems: According to IBM, approximately 50 per cent of car warranty costs are now related to electronics and their software. And safety is an obvious concern. Wassyng and his Cognitive Car colleagues want tough new standards to ensure that software is reliable.
"It's a bit like the wild west right now," he says.
At the moment, automotive software designers are able to take shortcuts that are forbidden in the world of aviation. For example: commercial aircraft have strict firewalls that separate critical flight software and entertainment systems. Not so with cars, where there is extensive commingling. According to a Wharton Business School article entitled Car Trouble: Should We Recall the U.S. Auto Industry?, some Mercedes drivers found that their seats moved when they pushed a button that was supposed to operate the navigation system.
Wasssyng and his students showed me just how complicated things can get in the world of automotive software. I watched them scroll through thousand of lines of code and realized that a misplaced digit could be like a crack in an airplane's wing spar. The students had been pulling all-nighters with their little robot cars. Now I could see why. They were teaching a car to do what a driver does, but better. They were making mistakes, but that was all part of it. They watched their little test cars crash, then wrote better software and tried again.
The path to perfection was anything but smooth. One team rewrote its software because the car kept drifting out of the lane. At first, the fix worked. But then the car drove straight off the track, because it didn't recognize the white lane stripe at a sharp angle. They fixed that, too. Then a new problem popped up. Time for some new code.
It reminded me of my late teens, when I spent my spare time tearing motors and suspensions apart in my parent's garage, trying to figure out why I had a high rpm miss or a camber issue. Now these kids were doing the same thing, but with keyboards instead of wrenches.
They were smart kids, and I liked them. The tools are different, but the mission is the same.
For more from Peter Cheney, go to facebook.com/cheneydrive
Twitter: Peter Cheney@cheneydrive