HP Prime Control Systems App v3.01 - User Guide 20211125
HP Prime Control Systems App v3.01 - User Guide 20211125
1 Introduction
It is used to study the frequency and time domain responses of control systems consisting of a process and a
controller. The app also calculates Root Locus Plots for unity feedback systems.
• In the frequency domain, open loop response with and without controller and resulting closed loop
response (unity feedback loop) can be determined / compared.
• In the time domain, the app calculates the open loop and unity feedback loop response to reference
changes as well as to disturbances (appearing between controller and process). It also calculates and
visualizes the controller output. Input types: Dirac pulse, unit step and ramp.
Although the app type is ‘Parametric’, the app does not rely on the built in HP Prime parametric plot
mechanism but on custom plotting routines, including custom mouse movement handling, key press detection
and custom soft key menus to accomplish functionality that would not be possible otherwise. App parametric
equations are only used in Numeric View. The app is entirely menu based (no need to type in commands).
The Control Systems app is the intellectual property of Herwig Taveirne, Belgium. This program is free software:
you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the
Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.: http://www.gnu.org/licenses
2 Overview
The ‘Control systems’ app takes as input the transfer function of a process as well as the settings of a controller
and produces several plots typically used to study relative and absolute stability etc. Results are available in
numerical form as well.
Disturbance
r
+ ε Controller + + Process y C(S) and P(S): transfer
+- C(S) m P(S) functions of controller and
Input Output
process, respectively
Unity feedback
Page 1
HP Prime Controls Systems App v3.01 Herwig Taveirne rev. November 25, 2021
Plot types:
• Frequency domain: Nyquist, Nichols, Bode (magnitude + phase, magnitude only, phase only)
• Time domain: input, output, error signal, controller output
• Root Locus Plot
Sample plots
Bode plot
Nyquist and
Nichols plots
Note that the scales indicate real frequency (log scale) and magnitude (log or dB scale) units, instead of the
logarithm of these values which would be the case if the standard HP Prime plot mechanism would be used.
Page 2
HP Prime Controls Systems App v3.01 Herwig Taveirne rev. November 25, 2021
When starting the app or pressing the Symb button, the HP Prime will not open the standard Symbolic View but
will open the ‘Process Transfer Function (open loop)’ view.
You can enter a maximum of five Transfer functions (a transfer function is the Laplace transform of the time
response of a process when a Dirac function is applied at its input at time = 0).
Use S (capital S) as the symbol to denote the complex variable. Note that this will not refer to (real) HP
Prime HOME variable S
A time delay is entered as a factor e^(-T*S) in the numerator, with T being a number representing the
time delay
4 Angle measure
Press Shift Symb to open Symbolic Setup View and select the angle measure (standard HP Prime view).
Page 3
HP Prime Controls Systems App v3.01 Herwig Taveirne rev. November 25, 2021
5 Plot Setup
Press Shift Plot to open the settings menu, which consists of 4 pages.
Note that the HP Prime will not open the standard Plot Setup View (which you won’t need).
Alternatively, while a plot is displayed, you can directly access the relevant settings (frequency domain, time
domain or root locus) by tapping the Set soft key.
Logarithmic scales unit (for plot types with logarithmic magnitude scales)
• Log: logarithmic scale
• dB: decibel scale
This setting effects all frequency domain plot types. For instance, in the Bode plot, with “unity feedback loop”
selected, this produces the following plot:
Page 4
HP Prime Controls Systems App v3.01 Herwig Taveirne rev. November 25, 2021
Bode plot
Note that chart scales are sometimes optimized automatically (e.g. always after you changed plot setup). You
can also manually optimize chart scales.
Page 5
HP Prime Controls Systems App v3.01 Herwig Taveirne rev. November 25, 2021
Time range
Enter minimum and maximum time
Note that the input will be plotted in black if it is a reference change, and in dark yellow if it is a disturbance.
Response plot
Plots the process output for
• Open loop
• Unity feedback loop
Note that process output is always plotted in red (for open loop as well as unity feedback loop response).
Auxiliary plot
• Error signal: show the error signal (controller input) on the optional second chart. This plot is drawn in
gray
• Controller output: show controller output on the optional second chart. This plot is drawn in green
Page 6
HP Prime Controls Systems App v3.01 Herwig Taveirne rev. November 25, 2021
Gain range
Root locus plots take the controller open loop gain as a ‘center point’ (if no controller is present, then this
center point gain will be ‘one’). With the gain range setting, you define how wide the app needs to set the gain
range for calculating roots. Options:
Note that gain is not increased linearly (adding a fixed step) but by applying a calculated factor, based on gain
range and sample size (see next).
Sample size
Choose between 50, 100, 200, 500 or 1000 samples. The more samples, the slower the calculation.
Mark
• Dot
• Crosshair
• Circle
Page 7
HP Prime Controls Systems App v3.01 Herwig Taveirne rev. November 25, 2021
Note that this setting affects the Bode and time domain response plots only. It has no impact on Nyquist or
Nichols plots because these plots (which do not have frequency or time scales) always use the ω or time ranges
defined in plot setup to create a plot.
The first time a plot is performed after a Plot Setup (this menu), ω or time scales for that plot will always be
reset to their defaults (irrespective of this setting).
For Bode and time domain response plots, each time the ω or time range is reset to the default range, other
scales are automatically optimized again as well.
Page 8
HP Prime Controls Systems App v3.01 Herwig Taveirne rev. November 25, 2021
Select option 1 (Set controller) and either select a controller type or recall a previously stored controller setup.
You can either decide not to use a controller at all (option 1), or to use a controller with proportional (P),
integrating (I) or derivative (D) terms applied to the error signal (or a combination of these terms – options 2 to
5). The derivative term can be replaced by a lead network as well (see further), which will attenuate the
controller’s response for very high frequencies (options 6 and 7).
Page 9
HP Prime Controls Systems App v3.01 Herwig Taveirne rev. November 25, 2021
Example: select ‘PID controller’ in the ‘Set controller’ list. The controller setup screen will be displayed:
You can now change the static gain (proportional term) and the integrator and differentiator time constants.
The corresponding controller Transfer Function (which the app will construct) will then be:
C(S) = GAIN * (1 + 1 / τi S) * (1 + τd S)
In the Views menu, select option 1 (Set controller) and then select option 8 (Recall setup) in the ‘Set controller’
list.
Page 10
HP Prime Controls Systems App v3.01 Herwig Taveirne rev. November 25, 2021
Example: recall the controller setup previously stored in settings 9. The controller setup screen will be displayed:
According to this example, a ‘PI+lead network’ controller setup was stored in settings 9. This is essentially a PID
controller with a correction (based on the value for γ) applied to the higher frequency range.
You can now change the static gain (proportional term), the integrator and differentiator time constants and the
lead compensation factor γ.
The corresponding controller Transfer Function (which the app will construct) will be:
For γ = 1, this controller will behave like a PI-type controller. If γ is infinity, then the controller will behave like a
PID controller. Typically, γ ranges from 2 to 20.
For a given γ, the amplitude in the high frequency range will slowly approach γ times the static gain (GAIN * γ),
and this for frequencies higher then γ / τd, instead of going to infinity as would be the case for a pure PID
controller. The phase angle will approach zero for very high frequencies, instead of +90° (pure PID controller).
• The lower γ, the lower the maximum phase lead. This maximum phase lead will also be obtained for a
lower frequency.
The Bode diagrams below show amplitude and phase characteristics for two controllers with same values for
gain, integrator and differentiator constants (resp. 35, 0.3 and 0.1). The left Bode diagram represents a pure PID
controller, whereas the right plot represents a PI controller with lead compensation (γ = 12).
The right Bode diagram clearly shows that for ω = 5000 rad/s (marker 2), the indicated gain is 420, which is
35 * 12 = gain * y and the phase angle is almost 0°. The maximum phase lead (0.293 π rad) is reached for
ω = 39 rad/s.
Page 11
HP Prime Controls Systems App v3.01 Herwig Taveirne rev. November 25, 2021
Note: in order to obtain these plots, set the process transfer function to ‘1 * 1’.
Press View to open the custom Views Menu and select option 2 (Set plot type).
Note: associated functionality (zooming etc.) will be discussed globally in a next section.
Page 12
HP Prime Controls Systems App v3.01 Herwig Taveirne rev. November 25, 2021
Nyquist plot
This is a polar plot, with linear scales, of the transfer function C(jω) * P(jω). In the sample screenshot below, the
plot for the transfer function of the unity feedback loop is also shown, as is the M1.3 circle (see section about
settings).
Marker info for
Unity feedback loop
Marker 2
Color coding for plots: blue is open loop,
purple is open loop with inactive controller
(not shown), red is unity feedback loop
Nichols plot
This is a magnitude / phase angle plot of the transfer function C(jω) * P(jω). The magnitude (vertical scale) is
logarithmic.
In the sample screenshot below, no secondary response plot is selected (see section about settings).
Page 13
HP Prime Controls Systems App v3.01 Herwig Taveirne rev. November 25, 2021
Bode plot
Magnitude (logarithmic or dB scale) and phase angle are plotted on separate charts.
Marker 2
Magnitude
Marker 1
Phase angle
As mentioned before, you can choose between reference input change and disturbance, and the change can be
a Dirac pulse, a unit step or a unit ramp.
In the examples below, the unity feedback response plot is shown, together with (lower chart) the controller
output (you can also visualize the error signal).
Page 14
HP Prime Controls Systems App v3.01 Herwig Taveirne rev. November 25, 2021
Note: time domain response plots are based on the calculation of an Inverse Laplace Transform. Standard HP
Prime function ‘invlaplace’ is used for that, but it is not always capable to perform the calculation. If it fails, you
will receive an error message.
Page 15
HP Prime Controls Systems App v3.01 Herwig Taveirne rev. November 25, 2021
8.2 Markers
All frequency and time domain plots have two markers, labeled marker 1 (M1) and marker 2 (M2). Markers are
associated with a set angular frequency (ω) or, for time domain response plots, with a set time.
• Bode plots and time domain response plots display these markers as two vertical lines. The active
marker (if within the visible frequency range) is shown in a bright red color. The inactive marker is
shown in a very light red color. Marker 1 is always positioned to the left of marker 2.
• Nyquist and Nichols plots display the markers as a cross hair with a square around it. For marker 2, this
square is tilted 45 degrees. In order not to overload the screen, only the active marker (M1 or M2) will
be visible (if two plots are currently shown, then each plot will have its active marker).
If the status line (see further) currently displays the change in magnitude and phase between the two
marker positions for a plot, then the two markers (M1 and M2) for that plot are shown instead.
The status line on top of the chart displays more info about the active marker / about the markers.
For Bode plots and time domain response plots (only), you can also activate a marker by tapping on a marker
and holding for a second. The marker position will not move.
Inactive
marker
Active
marker
Page 16
HP Prime Controls Systems App v3.01 Herwig Taveirne rev. November 25, 2021
• Tap the screen. This will move the active marker. If this would move the active marker beyond the other
marker (M1 is always positioned left of M2), the other marker will become active and will be moved
instead
• Press the left or right cursor keys to decrease or increase the set angular frequency (or time)
for the active marker, moving that marker
• Press and hold the left or right cursor keys: after half a second, the active marker position will
start moving left or right at a constant speed. This speed will increase with a factor ten after another 1.5
seconds
• Press Shift and then press the left or right cursor keys to move the active marker to the left or
right border of the chart (Bode plots and time domain response plots) or to the outer ends of the plot
(Nyquist and Nichols plots)
• Tap the Go To soft key and enter an angular frequency or time (time domain response plots) to set
markers.
1
Tap OK
Page 17
HP Prime Controls Systems App v3.01 Herwig Taveirne rev. November 25, 2021
On top of the screen, a status line displays more information about the (active) marker(s).
Page 18
HP Prime Controls Systems App v3.01 Herwig Taveirne rev. November 25, 2021
• Frequency domain response plots: this first shows magnitude and phase for plot 1, and then, if currently
two plots are displayed, for plot 2 (each time in the color of the plot). Finally, magnitude change (ratio)
and phase angle change (difference) is displayed going from plot 1 to plot 2 (in black)
Marker 1: positioned at ω = 5;
magnitude change (G x refers to a ratio, log
scale) and phase angle change (Δϕ) from
open loop response to unity feedback loop
response is displayed in selected units (log
scale and Radians, respectively)
• Time domain response plots: this cycles through input magnitude, then output magnitude, and then
error signal magnitude or controller output magnitude (depending on Plot Setup)
To show the change in magnitude (and, frequency domain plots only: phase angle) between the two marker
positions M1 and M2: press the cursor down key repeatedly.
• Frequency domain response plots): this first shows magnitude change (ratio) and phase angle change
(difference) for plot 1, and then, if currently two plots are displayed, for plot 2
• Time domain response plots: this alternatively shows magnitude change for input and output plot
(always as a difference, not a ratio)
Page 19
HP Prime Controls Systems App v3.01 Herwig Taveirne rev. November 25, 2021
8.4 Zooming
• Performing a two-finger pinch zoom gesture (the zoom is animated by shrinking / stretching the graphic
object representing the plot)
• Pressing the + or – key. This will zoom in or out using a custom zoom factor as entered in plot Setup.
• Tapping the Zoom soft key
Zooming is always performed horizontally (Bode plot: ω zoom, time domain: time zoom).
We will use the Bode plot to describe the zoom menu options, but the time domain response plot zoom works
in the same way. When tapping the Zoom soft key, the zoom menu opens:
• Align the plot with marker 1 or marker 2, but do not change the scale
You will be presented three options: align the left side of the
scale, the right side or the center of the plot with the current
position (angular frequency ω) of the selected marker
• Center on frequency: you will be asked to enter an angular frequency (ω) to center the plot
Page 20
HP Prime Controls Systems App v3.01 Herwig Taveirne rev. November 25, 2021
• Zoom to markers: rescale such that the current position of markers 1 and 2 (angular frequency ω) will
coincide with the left and right border of the plot, respectively
• Zoom:
• Zoom to default ω range: plot according to the ω range defined in Plot Setup
Nyquist plots
Zooming is performed by either
• Performing a two-finger pinch zoom gesture (the zoom is animated by shrinking / stretching the graphic
object representing the plot). If the zoom gesture is performed diagonally, the same zoom factor is used
in the two dimensions. You can also zoom horizontally or vertically by performing a horizontal or vertical
zoom gesture.
• Pressing the + or – key. This will zoom in or out using a custom zoom factor as entered in plot Setup.
• Tapping the Zoom soft key. This opens the zoom menu for Nyquist plots:
Page 21
HP Prime Controls Systems App v3.01 Herwig Taveirne rev. November 25, 2021
If two plots are currently displayed, this will center on the active marker for the plot selected in the
status line.
Only when the app cannot decide (when the status line is currently
displaying magnitude and phase angle difference between the two
plots), you will be asked to choose a plot
• Center on (Re, Im) point: enter the coordinates of a point on the complex plane
Page 22
HP Prime Controls Systems App v3.01 Herwig Taveirne rev. November 25, 2021
Nichols plots
Zooming is always performed vertically (the horizontal scale is fixed and runs from -π to π radians, in the
selected angle unit).
• Performing a two-finger pinch zoom gesture (the zoom is animated by shrinking / stretching the graphic
object representing the plot)
• Pressing the + or – key. This will zoom in or out using a custom zoom factor as entered in plot Setup.
• Tapping the Zoom soft key. This opens the zoom menu for Nichols plots:
• Center on active marker (as with Nyquist plots, if two plots are currently displayed, this will center on
the active marker for the plot selected in the status line)
Page 23
HP Prime Controls Systems App v3.01 Herwig Taveirne rev. November 25, 2021
8.5 Scrolling
Bode plot and time domain response plot: animated scrolling is always performed horizontally (Bode plot: ω
zoom, time domain plot: time scroll).
Nichols plot: scrolling is performed vertically, as the horizontal scale is fixed and runs from -π to π radians, in the
selected angle unit.
Page 24
HP Prime Controls Systems App v3.01 Herwig Taveirne rev. November 25, 2021
8.6 Optimizing
Optimizing adjusts the chart scales in such a way that the plot(s) fit(s) best on the charts.
• Bode plots and time domain response plot: this optimizes the vertical scale, based on the ω or time
scale range displayed horizontally
• Nyquist plots: this optimizes the horizontal and vertical scales, based on the ω range selected for
plotting
• Nichols plots: this optimizes the vertical scale, based on the ω range selected for plotting (the horizontal
scale is fixed and runs from -π to π radians, in the selected angle unit).
Optimizing is either performed automatically (if enabled in Plot Settings – general settings) or manually.
To optimize the plots manually: tap the Optim↕ softkey (or, for Nyquist plots, the Optim softkey).
If manually optimizing and currently two plots are shown, a popup will ask you to select the plot(s) to optimize
for.
If currently two plots are being shown, you will be asked whether to optimize for the open loop plot,
the secondary plot (as selected in Plot Setup) or both plots.
You will be asked whether to optimize for the input plot, the process output plot or for both plots. The
auxiliary plot (error signal or controller output, depending on Plot Setup) will always be optimized at that
time.
Page 25
HP Prime Controls Systems App v3.01 Herwig Taveirne rev. November 25, 2021
Bode plots and time domain plots normally draw two charts: an upper chart and a lower chart. What is actually
plot can be selected in Plot Setup, but it comes down to:
• Bode plots: upper chart shows magnitude plots, whereas lower chart shows phase angle plots
• Time domain plots: upper chart plots reference change or disturbance, together with process output,
whereas lower chart plots either error signal or controller output
However, you can enlarge the upper or the lower plot to occupy the whole screen.
Press the More soft key and select a layout from the submenu that will open.
• Time domain plot currently plotting disturbance and process output on the upper chart and controller
output on the lower chart: select from
Alternatively, you can also press Shift and then press the up cursor key to toggle between two-chart
display and the enlarged upper chart. Or press Shift and then press the down cursor key to toggle
between two-chart display and the enlarged lower chart.
Page 26
HP Prime Controls Systems App v3.01 Herwig Taveirne rev. November 25, 2021
Page 27
HP Prime Controls Systems App v3.01 Herwig Taveirne rev. November 25, 2021
This is a scatter plot, in the complex plane, of the roots of the unity feedback loop characteristic equation, for a
given range of open loop gain values, centered around the controller gain (see Plot Setup).
Roots are indicated by small circles in a dark red color (instead of circles, you can also select a crosshair or a dot
marker).
The root locus plot allows you to highlight all the roots for a selectable open loop gain value and it will display
information about these roots in the status line.
Highlighted roots are shown with a large dark gray circle, with a crosshair inside, around them. For one of the
highlighted roots this large circle is shown in blue and more information about this root is displayed in the status
line.
• Tap the screen, close to a root. This will select the open loop gain for that root and highlight all the roots
for this open loop gain. The tapped root will be highlighted in blue, indicating that information about
that root will be displayed in the status line
• Press the left or right cursor keys to decrease or increase the open loop gain
• Press and hold the left or right cursor keys: after half a second, the selected open loop gain
will start decreasing or increasing at a constant speed. This speed will further increase after another 1.5
seconds
Page 28
HP Prime Controls Systems App v3.01 Herwig Taveirne rev. November 25, 2021
• Press Shift and then press the left cursor key to set the open loop gain to the lowest value in the
open loop gain range, as selected in Plot Setup
If the currently selected open loop gain is greater than the ‘center position’ (which is the controller
gain, see Plot Setup) then this center position will be selected instead
• Press Shift and then press the right cursor key to set the open loop gain to the highest value in the
open loop gain range, as selected in Plot Setup
If the currently selected open loop gain is less than the ‘center position’ (which is the controller
gain, see Plot Setup) then this center position will be selected instead
• Tap the Go To soft key and the desired open loop gain. Then, tap OK
Note that you can select any open loop gain value – this includes gain values outside the K-range selected for
the plot.
The status line contains information about the selected root. More specifically, it displays
The selected root will be highlighted in blue and information about it will be displayed in the status line.
Page 29
HP Prime Controls Systems App v3.01 Herwig Taveirne rev. November 25, 2021
9.3 Zooming
• Performing a two-finger pinch zoom gesture (the zoom is animated by shrinking / stretching the graphic
object representing the plot). If the zoom gesture is performed diagonally, the same zoom factor is used
in the two dimensions. You can also zoom horizontally or vertically by performing a horizontal or vertical
zoom gesture.
• Pressing the + or – key. This will zoom in or out using a custom zoom factor as entered in plot Setup.
• Tapping the Zoom soft key. This opens the zoom menu for Root Locus plots:
The root currently highlighted in blue will be put in the middle of the chart. Scales will not change
• Center on (Re, Im) point: enter the coordinates of a point on the complex plane
The selected point will be placed in the middle of the chart. Scales will not change
Page 30
HP Prime Controls Systems App v3.01 Herwig Taveirne rev. November 25, 2021
9.4 Scrolling
Scrolling is animated by moving the graphic object representing the plot in the indicated direction before
replotting occurs.
9.5 Optimizing
Optimizing adjusts the chart scales in such a way that the plot fits best on the chart.
Optimizing is either performed automatically (if enabled in Plot Settings – general settings) or manually.
The second option will optimize the plot, only considering the highlighted roots (the roots for the selected open
loop gain value).
Page 31
HP Prime Controls Systems App v3.01 Herwig Taveirne rev. November 25, 2021
10 Active keys
An active key means that a key press is detected by the program, resulting in a specific action.
• Apps, App Info, Home, Home Settings: standard global view is displayed
• Symb Setup, Num Setup: standard app view is displayed
• Plot Setup: control systems app settings are displayed (instead of standard app plot setup view)
• Symb: display transfer functions (instead of standard app parametric equations view)
• Plot: launch interactive plotting routine (instead of standard app plot view)
• Num: standard app view is displayed, except when Root Locus Plot is currently selected as plot type:
pressing Num will then display a matrix with information about the calculated roots
• Cursor keys : custom functionality (as explained above)
• + and - keys : zoom in and out
• Shift: toggles Shift status (while in interactive plotting mode)
• View: displays custom Views menu
• Esc: exits interactive plot and returns to Home View (to abort plotting while the plot is being drawn:
keep holding down the Esc key until you return to the Home screen)
The ON key exits interactive plotting as well, but this is a HP Prime system function, so this key is not handled by
the ‘control systems’ app.
All other keys have no function at all, except that pressing any key resets the Key Shift status.
Page 32
HP Prime Controls Systems App v3.01 Herwig Taveirne rev. November 25, 2021
From the Home view, Press View to open the custom Views Menu and select option 3 (Show parametric Eq.) to
open the standard HP Prime Symbolic View showing the parametric equations set by the ‘control systems’ app.
These equations are shown for your information only because they are set by the app, based on the controller
settings and process transfer function entered.
In all equations, all instances of complex variable ‘S’ in the Transfer Functions are replaced with expression ‘i * T’
(i refers to the imaginary unit, T refers to the real variable T used as independent variable in the parametric
equations).
Please refer to next section (Numerical view) for the definition of these equations
Page 33
HP Prime Controls Systems App v3.01 Herwig Taveirne rev. November 25, 2021
12 Numerical view
Press Shift Num to open Numeric Setup View and set numerical range etc. (standard HP Prime view).
Note: if the set plot type is Root Locus, then the settings in Numeric Setup View will have no effect.
Plot type T X1 Y1 X2 Y2
Nyquist ω Transfer function - Transfer function - Transfer function - Transfer function -
real part, plot 1 imag. Part, plot 1 real part, plot 2 imag. Part, plot 2
Nichols ω Phase angle plot 1 Magnitude plot 1 Phase angle plot 2 Magnitude plot 2
(value or dB) (value or dB)
Bode ω Magnitude plot 1 Phase angle plot 1 Magnitude plot 2 Phase angle plot 2
(value or dB) (value or dB)
Time domain time Input value Process output Error signal value Controller output
value value
ω: angular frequency
Note: for frequency domain plots, columns X2, Y2 are set to ‘0’ if currently no secondary plot is selected (see
‘Second response plot’ in Plot Setup)
Press Num to view a read-only matrix with information about all roots calculated as per settings in Plot Setup.
The matrix contains all roots of the characteristic equation of the unity feedback loop transfer function, for a
given range of open loop gain values, centered around the controller gain.
(no label) 1 2 3
Root sequence number K-value (gain) Real part of root Imag. Part of root
Note that there will be as many entries for a given K value as there are roots.
Page 34
HP Prime Controls Systems App v3.01 Herwig Taveirne rev. November 25, 2021
13 Retrieving equations
The Control Systems App calculates a set of equations as a base for plotting, based on the transfer functions and
controller settings entered, the type of plot (frequency domain, time domain or root locus) and the current
settings.
You can retrieve these equations, either to a special variable ‘currEq’ (current equation) or to the home screen.
From the Home view, Press View to open the custom Views Menu and select option 4 (Set ‘currEq’ variable).
Note that it is not possible to return a value to Home View from the Views menu.
Then, select the equation you want. It will be stored in variable ‘currEq’
Page 35
HP Prime Controls Systems App v3.01 Herwig Taveirne rev. November 25, 2021
Note: the characteristic equation for a unity feedback loop equals D(s) + K * N(s) with
Execute app program ‘RetrieveEq’ (either type the program name or select it from the Control Systems App
program catalog, as shown). Note that you can also call this procedure from inside a user program.
You will be guided through the same menu options as described in previous section.
The selected equation will be returned to Home View and it will be stored in variable ‘currEq’.
Page 36
HP Prime Controls Systems App v3.01 Herwig Taveirne rev. November 25, 2021
To retrieve and use an equation from within a user program, you may prefer to call function ‘RetrieveOneEq’
instead (available in the Control Systems App program catalog).
This procedure accepts two parameters: equation type and equation, allowing you to bypass user input required
with procedure ‘RetrieveEq’, as outlined in the table below.
The selected equation will be returned to Home View and it will be stored in variable ‘currEq’.
A small demo program ‘CharEquationCoeff’ taking one parameter, demonstrating how to call procedure
‘RetrieveOneEq, is available from the user program catalog. Refer to the procedure comments for more
information.
Page 37
HP Prime Controls Systems App v3.01 Herwig Taveirne rev. November 25, 2021
14 Utility “DrawGrid”
Use: draws a horizontal and vertical grid (either logarithmic, in dB or linear) on the HP Prime screen or any of
the graphic objects (G0 to G9).
The program is called by the ‘control systems’ app, but it is an independent program that is available for general
use from the user program catalog.
With
→ a list indicating lowest and highest values to be displayed in the grid. For linear scales, this corresponds
to minimum and maximum values in Cartesian (user) coordinates.
Note: lowest values correspond to the lower left corner of grid
→ a list indicating starting pixel and number of pixels to be used for the grid, in the horizontal (X) and
vertical (Y) dimension.
Note: Xlow and Ylow correspond to the upper left of the grid
With
Page 38
HP Prime Controls Systems App v3.01 Herwig Taveirne rev. November 25, 2021
4 lineUnits Minimum grid line spacing. Note that spacing will automatically increase
(to the lowest possible multiple of lineUnits) if the grid would become
too dense.
This parameter is used for dB and linear scales only, it is ignored for
logarithmic (non-dB) scales – refer to the ‘log1only’ parameter for
logarithmic scales.
Default if parameter is not present: 3 dB for dB scale, automatic grid
lines for linear scale.
You may also refer to the default by entering value -1 for this parameter.
5 scaleAsFraction 0 = print regular value labels, 1 = print value labels as fractions, e.g.
display ½ instead of 0.5 (only used for linear scales).
Default if parameter is not present: regular labels
6 log1only Only used for logarithmic scales. 0 = draw grid lines for 1 EXP n to 9 EXP
n.
1 = draw grid lines for 1 EXP n only (n: integer).
Note that grid lines are only drawn when the value range (scale) permits
it.
Default if parameter is not present: draw grid lines for 1…9 EXP n
7 unitSymbol Linear scales only. Unit symbol to be printed after the value label.
Default if parameter is not present: empty string
8 multSymbol Linear scales only. Symbol to be printed as part of the value label.
Especially useful with ‘scale as fraction’ display. For instance, with
multSymbol = “π”, value 3/2 will be printed as 3π/2.
Default if parameter is not present: empty string
9 gridLineColor Grid line color as an RGB value.
Default if parameter is not present: RGB(230, 230, 230) (light gray).
You may also refer to the default by entering value -1 for this parameter
10 majorGridLineColor Major grid line color as an RGB value.
Default if parameter is not present: RGB(200, 200, 200) (darker gray).
You may also refer to the default by entering value -1 for this parameter.
Page 39
HP Prime Controls Systems App v3.01 Herwig Taveirne rev. November 25, 2021
Example 1:
RECT();
DrawGrid(G0, {0.01, 1000, 0.1, 100}, {30, 290, 13, 102}, {0}, {1} );
WAIT();
Notes:
1. The horizontal scale (from 0.01 to 1000) is logarithmic, whereas the vertical scale (from 0.1 to 100) is in
dB (1 dB = 20 LOG(value), as requested by the last two parameters {0} and {1}
2. Horizontal scale: the labels indicate the real values, not the logarithm of the values. When appropriate,
scientific format is used
3. Horizontal scale: note that vertical grid lines for 0.02, 0.05, 0.2, 0.5, 2, 5, 20, 50, … are also drawn. If the
scale permits it, even more grid lines will be drawn (1…9 EXP n)
4. Vertical scale: calibrated in dB. The lowest value (0.1) corresponds to -20 dB. As the (default) minimum
scale unit of 3 dB would result in a very dense grid, labels are printed every 12 dB. So, the lowest label
shown is the label for -12 dB
5. Major grid lines (having a label) are drawn a little darker, to clearly indicate which line a label belongs to
Page 40
HP Prime Controls Systems App v3.01 Herwig Taveirne rev. November 25, 2021
Example 2:
RECT();
DrawGrid(G0, {0.01, 1000, 0.1, 100}, {30, 290, 13, 102}, {0, 0}, {1} );
DrawGrid(G0, {0.01, 1000, -1, 1}, {30, 290, 130, 90}, {0, 1}, {2, 1, 0, 1/8, 1, 0, "", "π"} );
WAIT();
This leaves some room for a status line at the top and a softkey line at the bottom.
Note that the second grid has a linear scale, calibrated in fractions of PI. The minimum grid line spacing is
specified as 1/8, but it is automatically set to ¼ because of the scale given.
Also note that, as the two grids share the same horizontal scale, labels are only drawn once.
A small demo program 'TestGrid', taking no parameters, is available from the user program catalog.
Page 41
HP Prime Controls Systems App v3.01 Herwig Taveirne rev. November 25, 2021
15 Installation
Before you start: make sure your calculator is ON, connected to your computer via USB and visible in the HP
connectivity kit.
If the HP connectivity kit is not yet installed on your computer, you will need to install it first. Please
refer to HP’s documentation.
Installation procedure:
1. Unzip compressed folder “HP Prime-control systems.zip” and select the four items indicated in the
figure below, in File Explorer.
Page 42
HP Prime Controls Systems App v3.01 Herwig Taveirne rev. November 25, 2021
3. Check that
• the ‘Control Systems’ app is present in the
Application Library
• the other programs are present in the
‘Programs’ section of the content tree
4. Open the program catalog, select the Control Systems App and tap Edit
Verify that you see the screen below:
Perform the same action for the three programs in the Program Catalog.
=> If this step is not performed (after installation), the App may not start correctly.
Page 43
HP Prime Controls Systems App v3.01 Herwig Taveirne rev. November 25, 2021
5. Press the Apps button. Select the Control Systems App (it could be at the bottom) and press Start
6. Press Enter. You should now see the app (custom) Symbolic View, where you can enter Transfer
Functions (see section about Process transfer functions).
Page 44
HP Prime Controls Systems App v3.01 Herwig Taveirne rev. November 25, 2021
16 Known issues
When pressing the View button while a program is still running, the View menu is only displayed when program
execution stops. This is typically the case when you press the View button while a Bode plot is being drawn.
If you don’t wait until the View menu appears before making a selection (by pressing a numeric button), this key
stroke is sent to the command line and the View menu does not disappear.
The calculator performs a soft reset and the View menu will disappear.
After some time, plotting a Bode diagram can become a little slow.
If this happens, perform a soft reset (procedure explained earlier in this section).
Page 45