TRQ - Torque sensor

The torque sensor (TRQ) block reads the voltage output of a torque sensor and converts it to torque. It targets drive applications.

The B-Box RCP supports a single torque sensor through the Motor Interface for B-Box RCP. The sensor’s output must be a voltage proportional to the applied torque. The TRQ block will then read the input voltage and convert it to torque, using the specified sensitivity and offset of the sensor.

Signal specification

  • The output signal is the measured torque in [Nm].
  • The sim input signal is used in simulation and represents the actual torque, computed by the simulation plant model.
  • The > input signal needs to be connected to the sampling clock generated by the CONFIG block to account for the exact sampling instant in simulation.
Screenshot of the torque sensor block for Simulink.

Parameters

  • Device ID selects which B-Box/B-Board to address when used in a multi-device configuration.
  • Sensor sensitivity [V/Nm] defines the sensitivity of the sensor.
  • Sensor offset [V] defines the voltage offset of the sensor.
Screenshot of the torque sensor parameters for the Simulink block.

PLECS block

Signal specification

  • The output signal is the measured torque in [Nm].
  • The sim input signal is used in simulation and represents the actual torque, computed by the simulation plant model.
  • The > input signal needs to be connected to the sampling clock generated by the CONFIG block to account for the exact sampling instant in simulation.
Screenshot of the torque sensor block for PLECS.

Parameters

  • Device ID selects which B-Box/B-Board to address when used in a multi-device configuration.
  • Sensor sensitivity [V/Nm] defines the sensitivity of the sensor.
  • Sensor offset [V] defines the voltage offset of the sensor.
Screenshot of the torque sensor parameters for the PLECS block (addressing).
Screenshot of the parameters for the PLECS block.

C++ functions

void MotInt_EnableMotorInterface(unsigned int device=0);Code language: C++ (cpp)

Enable the drivers of the Motor Interface.

It has to be called in UserInit().

Parameters

  • device: the id of the addressed device (optional, used in multi-device configuration only).
void Trq_AdjustSensorParams(float sensitivity, float offset, unsigned int device=0);Code language: C++ (cpp)

Adjusts the sensitivity and offset of the sensor for calibration purposes.

It has to be called in UserInit().

Parameters

  • sensitivity: defines the sensitivity of the sensor in [V/Nm]
  • offset: defines the offset of the sensor in [V]
  • device: the id of the addressed device (optional, used in multi-device configuration only).
float Trq_GetTorque(unsigned int device=0);Code language: C++ (cpp)

Gets the torque measurement in [Nm].

It has to be called during the control interrupt.

Parameters

  • device: the id of the addressed device (optional, used in multi-device configuration only).