Use Case: Joe Debugs Controller Code

Dr. Joe Porter is a research scientist studying embedded software systems design at Vanderbilt University’s Institute for Software Integrated Systems (ISIS).

Their most recent project focused on modeling and simulating large vehicle designs.  Joe led the integration of custom tools for modeling controllers, generating code, and simulating the results of the controller code.

As Joe builds out demo controllers, he runs a multitude of simulations. He uses Initial State’s various tools to help him more effectively generate and simulate model-based controller code.

simulink controller codeModel-Based Controller Code Generation and Simulation

Joe and his team created a set of modeling tools that automatically integrate generated Simulink controller code into a larger vehicle simulation for testing and verification.

Transmission Control Logic

Joe told the Initial State team, “our main example consists of a set of controllers for the vehicle transmission: to determine the next gear setting and to signal the torque converter to lock out changes when appropriate.”

Shift Controller Logic in Stateflow

Shift Controller Logic in Stateflow

Debugging the Generated Controller Code

When Joe debugs the controller code, he compares the signal trace from the simulation against traces from the reference logic.

Essentially, we simultaneously debug the modeling tools, the code generator, the controller logic models, and the generated code.  I have to find any bugs quickly, isolate them to a particular layer, and create a fix.  Normally I would use Matlab: write a handful of scripts to handle the different formats and data types, and then manage the log data files myself to do the comparisons.

Using Initial State Log Visualization

Joe joined our Beta program a few months ago.

He uses Log Manager to keep his most recent log files organized, particularly as he makes changes to the code generation tools.

The side-by-side visualization of Waves helps him find and fix problems much more quickly. Joe simply modifies the simulation code to produce time-stamped log data.

initial state waves data

“It’s a great tool,” Joe writes, “straightforward to use and gets me to the problem very quickly.”

1 comments On Use Case: Joe Debugs Controller Code

Leave a reply:

Your email address will not be published.

Site Footer

Initial State