• Home
  • User Manual
  • Tutorials
  • Updates
Search Results for

    Show / Hide Table of Contents
    • Welcome to twin
    • Getting Started
      • Install and uninstall twin
      • Install and uninstall a licence
      • Start twin
    • Simulation Component Library
      • Automation
        • ScriptComponent
        • Sequence
      • BitManipulator
        • BitsToBytesConverter
        • BytesToBitsConverter
        • EndiannessChanger
      • BooleanOperations
        • BooleanFunction
        • Invert
        • InputSwitch
      • ControlPanel
        • ControlPanel
      • Conveyor
        • Conveyor
        • VacuumConveyor
      • Debug
        • Counter
      • DataManipulator
        • DataReader
        • DataTypeConverter
        • DataWriter
      • FMU
        • FMU
      • Gripper
        • KinematicGripper
        • ObjectCoupler
        • VacuumGripper
      • HardwareConnector
        • PLCConnector
        • RobotControllerConnector
      • Math
        • Gain
        • LinearFunction
        • LowPassFilter
        • NumberComparer
        • Sum
      • Motor
        • FCControlledMotor
        • ServoMotor
      • Movers
        • BoolToSignedDirection
        • DynamicCylinder
        • DynamicRotationMover
        • DynamicTranslationMover
        • KinematicCylinder
        • KinematicPathMover
        • KinematicRotationMover
        • KinematicTranslationMover
      • ObjectManipulator
        • Colorizer
        • Object3DCutter
        • VisiblityChanger
      • Sensors
        • AngleLimitSwitch
        • CollisionObserver
        • DistanceSensor
        • DynamicObjectDetector
        • LightBarrier
        • PositionLimitSwitch
        • PositionTracker
      • Sinks
        • FileLogger
        • CollisionSink
        • RaySink
      • Sources
        • BoolConstant
        • BoxSource
        • DoubleConstant
        • Object3DFileSource
        • Object3DSource
        • RandomBoolean
        • RandomNumber
        • SinusGenerator
        • SphereSource
        • StringConstant
      • Timers
        • IntervalTrigger
        • TOF
        • TON
    • Collision Detection
      • What is essential for collision detection?
      • Where can I find the mesh simplifiers?
      • Which mesh simplification methods are available?
    • twin Mirror
      • Install the twin Mirror
      • Embed the twin Mirror into your HMI
      • React on user-events
      • Manipulate 3D objects
      • Add labels and buttons
    • Video Guides
      • How to install twin
      • How to organize projects
      • How to import CAD files
      • How to handle 3D objects
      • How to activate physics in your simulation
      • How to simulate conveyor systems
      • How to simulate cylinders
      • How to simulate axis systems and portals
      • How to simulate sensors
      • How to simulate grippers
      • How to create program sequences
      • How to connect to PLCs
      • How to simulate robots
      • How to model complex mechanical motion systems
      • How to debug and analyse signals in twin

    LinearFunction

    This simulation component outputs the result of the linear function Output(Input) = Slope * Input + Offset.

    LinearFunction

    When to use

    Use this simulation component if you want to change the offset and slope of an input signal. You can for example convert unit-less signals into signals which have a defined unit or vice versa.

    Sensor connected to LinearFunction

    How to use

    Add this simulation component from the simulation component library and define the parameters Offset and Slope.

    Parameters

    Offset

    A value indicating an offset which is added to the input signal.

    Slope

    A value indicating a factor with which the input signal is multiplied.

    Inputs

    Input

    The input to the LinearFunction block.

    Outputs

    Output

    Outputs a value which is calculated by the formula Slope * Input + Offset.

    Example

    In this example, the distance output of a DistanceSensor simulation component is connected to the LinearFunction block. The distance is scaled between a lower and upper sensor limit, e.g. from 0 m ... 0.5 m, to an analog value, e.g. from 0 ... 27648.

    To calculate the Slope we can use the following formula:

    Slope = (adc_upper - adc_lower) / (upperLimitSensor - lowerLimitSensor)
    Slope = (27648 - 0) / (0.5 - 0)
    Slope = 55296
    

    The offset is calculated as follows:

    Offset = adc_lower - (slope * lowerLimitSensor)
    Offset = 0 - (55296 * 0)
    Offset = 0
    

    For a DistanceSensor output of 0.25 m the LinearFunction block outputs an analog value of 13824.

    LinearFunction Example Properties

    In This Article
    Back to top Copyright © Eberle Automatische Systeme GmbH & Co KG