Component: Servo Motor Base (Mechatronics)

From Flowcode Help
Jump to navigationJump to search


Author Matrix Ltd
Version 1.1 (Release)
Category Mechatronics


Image Servo Motor Base component

Base component for creating custom servo motor simulations. Recieves messages from the the 'Servo Controller' component.

Macro 'SetTarget' allows external objects to be moved by the servo for mechanical simulations.

This component can be used as a base to create child components

Image The component Standard Servo is inherited from this.

Examples

Controlling a servo with an analogue input

This example reads the value of the analogue potentiometer and uses this to set the position of the servo motor. FC6 Icon.png Servo Example 1 The Servo controller is linked to the standard servo component but this could be linked to any object on the panel.

ServoLink.jpg


Creating a multi-axis actuator using servo motors

This example links two servo motors together using panel primitive objects and groups. FC6 Icon.png Servo Example 2 The Servo controller can handle up to 8 motors and is used to control both of the standard servo components on the panel.

LinkedServo.jpg

Downloadable macro reference

This component does not contain any downloadable macros

Simulation macro reference

SetTarget

Set a panel object to be 'connected' to the servo's.

The connected object will then move as if connected mechanically to

the servo's actuator.

Parameters

HANDLE Target
Object to be moved by the motor


Return value

This call does not return a value



Property reference

Moving Part

This property is of type Panel object and can be referenced with the variable name moving_object.

Set an object on the System Panel to be the servo's actuator.

The object's position at the moment of selection is taken to be the 'rest' position of the actuator - the

maximum and minimum angles will be measured from this position.

Axis Object

This property is of type Panel object and can be referenced with the variable name axis_object.

Set a panel object to be the centre of rotation of the servo's actuator.

Move Around

This property is of type Fixed list of ints and can be referenced with the variable name rot_axis.

Set the axis around which the actuator will revolve.

If an 'Axis Object' is chosen, this will be a local axis of the chosen object, otherwise it will be the

current world axes.

Minimum (degrees)

This property is of type Floating point and can be referenced with the variable name rot_min.

Angle that the servo turns when the PWM signal is at its minimum.

Measured from the actuator object's 'rest' position, chosen at the time of connecting the object.

Maximum (degrees)

This property is of type Floating point and can be referenced with the variable name rot_max.

Angle that the servo turns when the PWM signal is at its maximum.

Measured from the actuator object's 'rest' position, chosen at the time of connecting the object.