Software continues to become a more important factor for providing new features and functions, making code writing and validation a mainstay of design cycles. Automated code generation has become a primary development tool, while a range of techniques are used to check software’s quality.
The technology provides many benefits. Machine-generated code is more structured than most handwritten software, and it’s no longer so bulky that it drives up memory costs and runs slower than manually-produced code. The programs are typically easier to revise than handwritten software.
“Autocoding can really save time and move projects forward quickly,” said Peter Lauer, senior specialist, Embedded Controls Architecture, Eaton. “For example, working on an auto guidance steering solution for a new machine, we had to design steering controls that would work with different types of ground drives. Autocoding allowed our team to quickly convert code between different machine forms—in this case a wheeled drive to a tracked drive.”
Some companies have already made the conversion to automated programming. Humans write only small portions of many programs.
“In our new platform, 90% of the code is auto-generated,” said Steven Dumoulin, Team Leader for Controls, Dana Holding Corp. “A limited amount is written in C, mostly the low-level stuff.”
Some elements in this low-level programming may soon be written in a standardized format. There’s growing interest in the AUTomotive Open System ARchitecture (AUTOSAR), which sets a common format for the links between hardware and software. That makes it easier to change hardware platforms while simplifying the programming architecture.
“All the software on our new platforms is written with AUTOSAR in mind,” Dumoulin said. “It’s compatible within Dana, if it was plugged into another AUTOSAR platform, it would be no big deal to alter it.”
Autocoding can also simplify testing. Code is easier to debug, and developers can run tests at any time to see whether the code meets the original requirements. That increases the likelihood that features and functions will meet expectations when they’re implemented on the end product.
“Autocoding is a tool for the overall development,” said Jason McConnell, Business Unit Director, Electrification & Hybrid, IAV Automotive Engineering. “It provides an opportunity to improve quality early on, you can do more testing of algorithms early in the cycle.”
The combination of autocoding and model-based design makes it easier for developers to test their work throughout the development cycle. Eliminating problems early in the process can improve the end result. Often, code is tested using hardware-in-the-loop (HIL) systems that let programmers test software at the system level before hardware development is finished.
“Our HIL platform provides an efficient method for testing embedded software that allows for greater code coverage and more robust functional testing without compromising development timelines,” said Nick Keel, Group Manager for Automotive Applications, National Instruments. “By incorporating automation into test software as well as embedded software, engineers can add more functionality and improve product quality without adding cost or time to the testing process.”
While some companies tout the benefits of HIL, others are avoiding it. Some design tools for human machine interfaces (HMIs) have been designed to produce code that doesn’t need to be tested using HIL.
“One of the key factors driving this reduction is the use of graphical programming tools and HMI programming tools that allow for no hardware-in-the-loop simulation,” said Kirk Lola, Business Development Manager, Parker Hannifin Electronic Controls Division. By not having HIL, the menus and screen can be simulated, tested, and evaluated quicker and by more design stakeholders to help gain consensus on the menu operation and screen designs as well as help reduce development time and cost.”