Overview - OPHION
Documentation for version 4.2.x
OPHION is our simplest-lightweight universal application for full electric standalone automotive usage, but can be used in other use-cases aswell. Essentialy the only thing OPHION does is converting inputs into motor commands (throttle, brake).
In this file we will take a look at OPHION gradually, starting by inputs and ending with motor commands (outputs).
Choosing inputs
Even if choosing inputs is semantically before sig_path
block, I recommend first understand the sig_path
block and then think about how to choose the right inputs.
OPHION considers at most two analog inputs and two digital inputs. The two analog inputs are called level1
and level2
and the two digital inputs are IN1
and IN2
. User maps these internal input variables to real inputs, on how to do the mapping refer to our inputs docs.
Now we have our inputs successfully selected and mapped to the variables, we can continue onto sig_path
.
Choosing, setting and understanding sig_path
With inputs we can now continue on correctly converting these inputs into outputs. These outputs are level
and disarm
. level
is a float variable from -1
to 1
, where 0
is no torque, -1
max reverse torque and 1
max forward torque. disarm
is a boolean variable (has only values true
or false
) that determines whether motor should be disarmed or armed. If disarm
is true
, motor won't be running even if level
is non-zero.
Because OPHION is trying to be as simple as possible, we only provide 7 predefined ways how we parse the 4
inputs into outputs (level
+ disarm
). Most of them do not even use all 4
inputs. For example if you set sig_path
to 1
,the controller then only considers one analog input1
and directly transfers it to motor command, but other settings can include disarming/arming.
To learn more about how to set sig_path
and all the different modes refer to our sig_path docs.
Main block
Main block mainly propagates inputs, selects driving modes and implements safety features. Another optional feature in the main block is the ability to have an idle mode
and cmd
, more about that in the separate file. This part of the application is always the same, unlike sig_path
. Most of the parameters (every parameter except sig_path
) is here taken into account.
The full description of all the parameters and futher explanation of the main block is located in our main block docs. And by sending commands to the motor the functionality of OPHION ends.
What does cmd
and mode
mean
These two values are how we fully control the electric motor. cmd
is a floating (decimal) value from -1
to 1
and it represents the factor of max value in the given mode. For example if you run the motor in current mode and cmd
set to 0.4
, we will rotate with 40%
of max possible current.
mode
represents the mode in which you want to control the motor, cmd
is interpreted differently in every mode, but the ideology stays the same. To learn about all the modes refer to here.