docs.unity3d.com
    Show / Hide Table of Contents

    Class DCMotor

    The role of this class is to emulate an axial DC Motor rotating on the Y axis (Up vector).

    Inheritance
    Object
    NodeRuntime
    DCMotor
    Inherited Members
    NodeRuntime._parent
    NodeRuntime._portList
    NodeRuntime._queryPath
    NodeRuntime._tickCPUTimeNs
    NodeRuntime.Initialize(SystemGraphComponent)
    NodeRuntime.InternalInitialize()
    NodeRuntime.Start()
    NodeRuntime.Disable()
    NodeRuntime.Update()
    NodeRuntime.FixedUpdate()
    NodeRuntime.OnPortAdded(String, Type, String, PortDirection, FieldExtra, IPortType)
    NodeRuntime.OnPortRemoved(String)
    NodeRuntime.InitializeDynamicPorts(SystemGraphComponent)
    NodeRuntime.QueryPath
    NodeRuntime.TickCPUTimeNs
    NodeRuntime.PortDataList
    Namespace: Mechatronics.SensorSDK
    Syntax
    [NodeCategory("Actuator", "DC Motor", NodeTick.Synchronous, (LifeCycle)0, 0F, NodeMode.Standard, false)]
    public class DCMotor : NodeRuntime

    Fields

    angularDistance

    Declaration
    [Tooltip("Rotation since the last update in degree.")]
    [Field("AngularDistance", PortDirection.Right, FieldExtra.Write)]
    [SerializeField]
    protected PortType<float> angularDistance
    Field Value
    Type Description
    PortType<Single>

    boundTransform

    Declaration
    [Binding("Transform")]
    [SerializeField]
    protected Binding<Transform> boundTransform
    Field Value
    Type Description
    Binding<Transform>

    cw

    Declaration
    [Tooltip("Whether the DC motor rotates in the clockwise direction.")]
    [Field("TurnCW", PortDirection.Left, FieldExtra.Read)]
    [SerializeField]
    protected PortType<bool> cw
    Field Value
    Type Description
    PortType<Boolean>

    enable

    Declaration
    [Tooltip("Activate/Deactivate the dc motor behavior.")]
    [Field("Enable", PortDirection.Left, FieldExtra.Read)]
    [SerializeField]
    protected PortType<bool> enable
    Field Value
    Type Description
    PortType<Boolean>

    maxRPM

    Declaration
    [Tooltip("Max speed in rotation per minute.")]
    [Field("RPM", PortDirection.Left, FieldExtra.Read)]
    [SerializeField]
    protected PortType<float> maxRPM
    Field Value
    Type Description
    PortType<Single>

    speedVariation

    Declaration
    [Tooltip("Apply a Gaussian noise on the maxRPM.  This value correspond to the sigma of the Gaussian curve. (In RPM)  (0 means no noise)")]
    [Field("Speed variation", PortDirection.Left, FieldExtra.Read)]
    [SerializeField]
    protected PortType<float> speedVariation
    Field Value
    Type Description
    PortType<Single>

    timeConstant

    Declaration
    [Tooltip("Time when the motor hits 63% of its max speed in seconds.  It describes how the motor accelerate.")]
    [Field("Time constant", PortDirection.Left, FieldExtra.Read)]
    [SerializeField]
    protected PortType<float> timeConstant
    Field Value
    Type Description
    PortType<Single>

    turnTime

    Declaration
    [Tooltip("Time elapsed since the last turn.")]
    [Field("turnTime", PortDirection.Right, FieldExtra.Write)]
    [SerializeField]
    protected PortType<float> turnTime
    Field Value
    Type Description
    PortType<Single>

    velocity

    Declaration
    [Tooltip("Angular speed since the last update in degree/second.")]
    [Field("Velocity", PortDirection.Right, FieldExtra.Write)]
    [SerializeField]
    protected PortType<float> velocity
    Field Value
    Type Description
    PortType<Single>

    Methods

    Enable(Scheduler.ClockState)

    Reset internal timers.

    Declaration
    public override void Enable(Scheduler.ClockState clockState)
    Parameters
    Type Name Description
    Scheduler.ClockState clockState

    The parameters of the waveform associated to this node

    Overrides
    NodeRuntime.Enable(Scheduler.ClockState)

    OnTick(Double, Double, Scheduler.ClockState, Scheduler.Signal)

    Apply the DC Motor model.

    Declaration
    public override bool OnTick(double now, double eventTime, Scheduler.ClockState clockState, Scheduler.Signal signal)
    Parameters
    Type Name Description
    Double now

    The current time in seconds of the scheduler clocksource

    Double eventTime

    The current time in seconds of the scheduler waveform. This is independant from the clocksource time and aligned to every rising edge time in the waveform.

    Scheduler.ClockState clockState

    The current parameters of the waveform event associated to this node

    Scheduler.Signal signal

    Signals that the scheduler pass to the OnTick event receiver. These are signals that describe the action that should be done in the Node. For example, integrate this tick as multiple events.

    Returns
    Type Description
    Boolean

    Returns true if time integration was performed

    Overrides
    NodeRuntime.OnTick(Double, Double, Scheduler.ClockState, Scheduler.Signal)
    Back to top
    Terms of use
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023