IV. Maps settings
A basic feature of Lynx is the ability to change torque, power, and speed limitations on the fly. This is done by changing the power map.
Configure map switch
By default, there is no GPIO assigned as a map switch. Let's presume, that mapswitch is connected between IOGND and GPIO1.
To enable the mapswitch functionality on GPIO1, you need to set the /io/IN_mapswitch
parameter to value 17.
Also, you need to enable a pull-up resistor on GPIO1. This is done by setting /common/ioconf
to value 1.
If you press the map switch, you should hear a sound from the motor. The number of beeps corresponds to the map number.
If you use siliXcon VDS-display with LYNX, you can use the map switch on the display. In this case, you do not need to configure the map switch. (Only ensure, that the display is connected to the controller using the CAN bus)
Speed reading
Before we start to tune the maps, we need to know the speed of the vehicle. To do this we need to calculate vehicle speed from the motor.
- Make sure, that you configure the motor polepairs in previous steps.
- Setup parameter
/gearthr
. Its value is in "motor shaft revolutions per one-wheel revolution". - Setup parameter
/odothr
. Its value is the number of wheel revolutions per kilometer.
If you set this correctly, you can later set the speed limitation in km/h.
Curent speed reading is located in /speed
state.
Speed limiter response tuning
It is necessary to tune these parameters. Wrong settings can cause oscillation or slow reaction.
If you have oscillation, try to decrease the rdec
parameter - i.e. slow limiter response. Or increase the rdec
.
These values are good starting point for tuning:
"/driver/limiter/rdec" : "100.0" # '[RPM] speed limiter decrement rate'
"/driver/limiter/rgain" : "50.0" # 'speed limiter gain'
The rpos
treshold is calculated from the map speed limit kph
.
The rpos
, rdec
are in [motor RPM]. The kph
in maps is in [kph].
Number of maps
By default, there are 3 maps. You can change the number of maps by setting /map/mapcnt
parameter.
Tune the maps
For each map, you can set a few parameters. For this guide, we will care only the following parameters:
trqlvl
- maximum torque in range [0-1]. It multiplies reference currentiref
. i.e. value 0.8 means, that the maximum available current is 80% of theiref
.kph
- maximum speed in [km/h]. This is the speed of the vehicle. It is calculated from the motor speed. If it's set to 0, there is no speed limitation.pwr
- maximum power in [W]. This is the maximum power of the motor. It is calculated from the motor power. If it's set to 0, there is no power limitation.
These parameters are located in /maps/mapX
folder. Where X is the map number.
Check maps values. The default settings are set low. In most cases, you will want to increase the values.