Skip to main content
FW version: Stable

ASC - Analog Signal Conditioner

Description

This block converts a fixed-point, discrete signal from analog-to-digital conversion into a normalized command. The block has several parameters that can be set to form the output curve. The ASC is suited for setting the analog sensor (e.g. throttle, brake lever). Transfer characteristic is shown in the picture below, with several different configurations of parameters min, center, max, and direction.

Settings

Parameter min should be set to the value of voltage which is on output on a sensor when is it fully released. Parameter max should be set to the value of voltage which is on output on a sensor when is it fully open. Ideally, the output of the ASC block should be a value from 0-1 (-1 to 1) according to a fully closed and opened analog sensor. In case absmin or absmax are not set, there is no constrain on ASC block output.

The center parameter is a special feature if is set to a non-zero value, the output of the ASC block is bi-directional (suitable for joystick control, or throttle release braking).

In case, when the sensor has the opposite direction of the output (low voltage – max output level), set parameter min to high voltage and parameter max to min voltage, the example is the green line below.

Transfer characteristic of the ASC block

Transfer characteristic of the ASC block

Interactive transfer function

Safety settings

Absmin and absmax are parameters for the detection of malfunction on the input device. If the input value is under absmin or above absmax, output goes to NaN (Not a Number). This mostly results in motor disarm (depend on the application in the controller). This function can detect disconnected cable from the controller.

Safety example

In case of disconnection of any cable, GPIO value goes to the supply voltage or to GND. This malfunction results in NaN on the output of the ASC block.

asc throttle connection

ASC parameters

NameDescription
minLow threshold of the input range
centerCenter point of the input range. If this parameter is zero, the output is treated as unidirectional with a range from <0-1>.
maxHigh threshold of the input range
absminInput value under this threshold set output to NaN. *
absmaxInput value above this threshold set output to NaN. *
lpfOutput low-pass filter. More about lpf here.

*NaN typically do disarm

ASC states

NameDescription
inInput signal to ASC block - usually [mV], value from GPIO input
outOutput signal from ASC block.

How to setup

Best approach to setup ASC is this:

  1. In term type stop and press enter
    • With this, you override motor command and force it to freewheel
  2. Go to ASC folder
  3. Plot state in and out to scope into 2 plots
  4. Move your input to low (potentiometer)
  5. Write value from in to min parameter
  6. Move your input to high
  7. Write value from in to max
  8. Now move with your input a check the output in scope

After you finish, run command run. This will relese the override and you can ride. (Or restart the controller)