# Simulation Beyond Volts and Amps (Part 2)

### Mike Jensen

Posted Nov 8, 2010

Last week I wrote about  moving beyond electrical modeling to get more information about system behavior. To illustrate some of the basics, we looked at a portion of an incandescent lamp model which showed declarations for some of the lamp’s thermal properties. At the end of the post, I promised to illustrate some of the discussion with an example of an automotive emergency flasher system. Before diving into the example, however, we need to discuss the model for one more system component: a fuse.

Like the incandescent lamp, a fuse has both electrical and thermal properties. And like the lamp, a fuse’s electrical performance determines its thermal performance. The important difference is that when the fuse temperature gets high enough, the fuse melts and shuts down the circuit it protects. For simulation, we can model the fuse in a variety of ways. For our example, we will model the fuse as a resistance which changes state as the current through the fuse crosses a user-defined threshold. If the current is increasing as it crosses the threshold, the resistance changes from a very low to a very high value. If the current is decreasing as it crosses the threshold, the resistance transition is reversed. The modeling mechanism that enables the state change is inspiration for another blog post. The take away, however, is that the VHDL-AMS language enables multiple methods for modeling real world behavior. Similar to the lamp model, along with changing the fuse’s resistance based on its current, we can monitor the temperature of the fuse element using a VHDL-AMS quantity which is simply an analog unknown the simulator solves for.

(1) quantity v_fuse across i_fuse through p1 to p2;

(2) quantity r_fuse : resistance;

(3) quantity temp_element : temperature;

(4) signal r_switch : resistance := 0.0;

Line (1) declares two branch quantities, v_fuse and i_fuse, which are associated with pins p1 and p2 of the model. In this case, v_fuse represents the voltage across, and i_fuse the current through, the fuse’s element. Lines (2) and (3) declare free quantities which the simulator calculates to give additional information about the fuse’s performance. Line (2) declares r_fuse, the fuse’s resistance calculated as the sum of its cold and state-valued resistances. Line (3) declares temp_element, the temperature of the fuse’s element.

Line (4) declares r_switch as a signal, which in this case is a resistance that can change state instantaneously (quantities are analog unknowns which must change values continuously; signals are analog or digital unknowns that change state dis-continuously). The r_switch state-valued resistance is set by the amount of current flowing through the fuse, and is initialized to zero, meaning the fuse element’s normal (non-melted) resistance is simply its cold temperature resistance.

As I described for the lamp model, the terms following the [ : ] in lines (2) through (4) are type declarations which define the units use to plot the simulation results. Quantity r_fuse and signal r_switch are of type resistance and therefore plotted in Ohms; quantity temp_element is of type temperature and is plotted in degrees Celcius. The units for the v_fuse and i_fuse branch quantities are determined by the definitions for pins p1 and p2, which are assigned electrical natures elsewhere in the model.

Now that we’ve discussed the lamp and fuse models, it’s time to talk about the automotive emergency flasher system. I will introduce the circuit in my next post.