UMAX140610. LIN
– J1939 CAN Protocol Converter with PWM Output. Version 1
Page: 43-81
3.6 Math Function Block
Figure 22. Programmable Logic Flowchart
There are four mathematic function blocks that allow the user to define basic algorithms. A
math function block can take up to four input signals, as listed in Table 8 in Section 3.2.4. Each
input is then scaled according the associated limit and scaling setpoints.
Inputs are converted into a percentage value based on the
“Math Input X Minimum”
and
“Math Input X Maximum”
values selected, where X = 1 to 4. For additional control, the user
can also adjust the
“Math Input X Scaler.”
By default, each input ha
s a scaling ‘weight’ of 1.0.
However, each input can be scaled from -1.0 to 1.0 as necessary before it is applied in the
function.
For example, in the case where the user may want to combine two inputs such that a joystick
(Input 1) is the primary control of an output, but the speed can be incremented or decremented
based on a potentiometer (Input 2), it may be desired that 75% of the scale is controlled by the
joystick position, while the potentiometer can increase or decrease the min/max output by up
to 25%. In this case, Input 1 would be scaled with 0.75, while Input 2 uses 0.25. The resulting
addition will give a command from 0 to 100% based on the combined positions of both inputs.