Difference between revisions of "Component: Motor Template (Mechatronics)"

From Flowcode Help
Jump to navigationJump to search
(XML import BR)
Line 38: Line 38:
  
 
==Examples==
 
==Examples==
 
 
Simple example showing how to drive the motor components and how to create sub assemblies attached to the motor output shafts in the simulation panels.
 
Simple example showing how to drive the motor components and how to create sub assemblies attached to the motor output shafts in the simulation panels.
 
 
{{Fcfile|Motors.fcfx|Motors}}
 
{{Fcfile|Motors.fcfx|Motors}}
 
  
 
==Downloadable macro reference==
 
==Downloadable macro reference==

Revision as of 15:46, 16 February 2017


Author Matrix Ltd
Version 1.1 (Release)
Category Mechatronics


Image Motor Template component

Base component for constructing continuous motion - e.g. motors. Automatically animates two objects - one within the same host components (e.g. moving parts of the motor itself), and one external (e.g. the mechanism to which the motor is connected).

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

The following components all inherit the traits of Motor Template:

-
Image Motor (Full Bridge) Motor that can be driven at a prest speed in either forwards or reverse direction with inertia.

Properties support several pin options to allow matching with differents hardware driving circuits. Can be connected to other objects to make them move.

Image Motor (Half Bridge) Simple animated motor turned on and off with a single pin connection.

Can be linked to other objects to make them move.

Examples

Simple example showing how to drive the motor components and how to create sub assemblies attached to the motor output shafts in the simulation panels. FC6 Icon.png Motors

Downloadable macro reference

This component does not contain any downloadable macros

Simulation macro reference

SetTarget

Set a target object external to the motor component.

This allows the motor to link "mechanically" to other components and

move them around.

Parameters

HANDLE Target
The object to set as a target


Return value

This call does not return a value


SetSpeed

Sets the speed for all attached objects. The speed will change at the rate set by the acceleration property.

Parameters

FLOAT Speed
World units or degrees per second.


Return value

This call does not return a value



Property reference

Frame Interval

This property is of type Unsigned integer and can be referenced with the variable name interval.

Time interval between animation frames.

Does not affect the speed of motion, only the rate of screen updates.

On Stop

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

Decide what action to take when simulation stops.

No Action - Animation is paused, continues from this position when simulation restarts

Return to start - all object returned to their start positions, current speed resumes on simulation start.

Clear speeds - objects retain their position, but speed is set to zero.

Return and clear - objects return to start position and have theri speed set to zero.

Target Object

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

An object within the same host component which the motor will animate.

Axis Object

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

If the motion property is set to 'Rotary', this sets an object around which the rotation will happen.

If not set, the 'Target' object will rotate around its own centre.

Axis

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

Which axis to move along or around.

Motion

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

The kind of motion to animate.

Rotary - animated targets will rotate around the given axis.

Linear - animated object will move in a straight line. Note that there is nothing to prevent the object from

moving off screen - stopping or reversing the motion is controlled only by the macro calls.

Acceleration

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

Amount of speed change allowed per second when the motor is powered.

Set to zero for instantaneous speed changes.

Deceleration

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

Amount of speed change allowed per second when power is removed and the motor is coasting.

Set to zero for instantaneous speed changes.