# Real-Time Robotics Framework

### Sidebar

eeros_architecture:hal:scaling_multi

This is an old revision of the document!

# Setting Multiple Scales and Ranges

The existing hardware is often comprised of several stages. The HAL can account for this in the following way.

## Output to Control a Motor

The control of EEROS sets the torque for a motor. This signal passes a digital to analog converter and an amplifier. The amplifier delivers a current which is trabsformed by the motor constant into a torque.

Example of output with multiple stages

The HAL mirrors the multiple stages. Each stage can be described individually as given in the following example.

  "channel0": {
"signalId": "dacOut",
"scale": [ { "id" : "dac",
"minIn":    1000, "maxIn":  64000,
"minOut": -9.787, "maxOut": 9.923 },
{ "id" : "amp",
"minIn":   -10.0, "maxIn":  10.0,
"minOut":  -7.0, "maxOut": 7.0 },
{ "id" : "kM",
"minIn":   -5.0, "maxIn":  5.0,
"minOut":  -1.0, "maxOut": 1.0 } ],
"range": [ { "id" : "dac",
"minIn":       0, "maxIn":  65536,
"minOut":  -10.0, "maxOut":  10.0 },
{ "id" : "amp",
"minIn":   -10.0, "maxIn":  10.0,
"minOut":  -7.0, "maxOut": 7.0 },
{ "id" : "kM",
"minIn":   -5.0, "maxIn":  5.0,
"minOut":  -1.0, "maxOut": 1.0 } ],
"unit": "Nm"
}

The HAL will calculate the scale and range of the whole chain considering the single stages. The range of the whole chain will be determined by the most restricting range of the single stages. The unit is determined by the unit of the last stage.

## Input for Axis Position

The control of EEROS sets the torque for a motor. This signal passes a digital to analog converter and an amplifier. The amplifier delivers a current which is trabsformed by the motor constant into a torque.

Example of input with multiple stages

The HAL mirrors the multiple stages. Each stage can be described individually as given in the following example.

  "channel0": {
"signalId": "dacOut",
"scale": [ { "id" : "dac",
"minIn":    1000, "maxIn":  64000,
"minOut": -9.787, "maxOut": 9.923 },
{ "id" : "amp",
"minIn":   -10.0, "maxIn":  10.0,
"minOut":  -7.0, "maxOut": 7.0 },
{ "id" : "kM",
"minIn":   -5.0, "maxIn":  5.0,
"minOut":  -1.0, "maxOut": 1.0 } ],
"range": [ { "id" : "dac",
"minIn":       0, "maxIn":  65536,
"minOut":  -10.0, "maxOut":  10.0 },
{ "id" : "amp",
"minIn":   -10.0, "maxIn":  10.0,
"minOut":  -7.0, "maxOut": 7.0 },
{ "id" : "kM",
"minIn":   -5.0, "maxIn":  5.0,
"minOut":  -1.0, "maxOut": 1.0 } ],
"unit": "Nm"
}

The HAL will calculate the scale and range of the whole chain considering the single stages. The range of the whole chain will be determined by the most restricting range of the single stages. The unit is determined by the unit of the last stage.

## Two Inputs or Outputs with Different Scales

There are cases where you want to read from a hardware input while this input might represent different things. A motor with its current and torque could serve as an example.

Reading from input with different scaling
• Scale1 : scaling for the adc converter
• Scale2 : scaling for motor current. This input allows for current control of the motor.
• Scale3 : scaling for motor torque. This input allows for observation of the motor torque.

For outputs we have a similar situation. A motor might be controlled by setting its current during homing of the drive. During normal operation the motor will be controlled by setting its torque.

Writing from to output with different scaling

The scaling in the HAL includes the common part of the two outputs while each control signal have their individual scaling as well.

eeros_architecture/hal/scaling_multi.1551015030.txt.gz · Last modified: 2019/02/24 14:30 by graf