Difference between revisions of "Component: Servo Controller (Mechatronics)"
(XML import of component documentation) |
(XML import) |
||
Line 4: | Line 4: | ||
|- | |- | ||
| width="20%" style="color: gray;" | Author | | width="20%" style="color: gray;" | Author | ||
− | | | + | | Matrix Ltd |
|- | |- | ||
| width="20%" style="color: gray;" | Version | | width="20%" style="color: gray;" | Version | ||
Line 15: | Line 15: | ||
− | ==[[ | + | ==[[Media:Component Icon 9202a62e_0a42_4780_adce_16b701e5ec53.png|Image]] Servo Controller component== |
Can control up to eight standard PWM driven servo's. | Can control up to eight standard PWM driven servo's. | ||
'Servo Object' properties allow you to connect the controller to on-screen simulations | 'Servo Object' properties allow you to connect the controller to on-screen simulations |
Revision as of 11:12, 16 January 2014
Author | Matrix Ltd |
Version | 1.1 |
Category | Mechatronics |
Contents
Image Servo Controller component
Can control up to eight standard PWM driven servo's. 'Servo Object' properties allow you to connect the controller to on-screen simulations using the "Servo Motor" component and its derivatives.
Examples
No additional examples
Downloadable macro reference
DisableServo
Disables a servo channel effectivly disabling the motor.
Parameters
- BYTE Channel
- The channel to set the position for. First channel is zero.
Return value
- This call does not return a value
SetPosition
Moves directly to the specified position with no interpolation.
Parameters
- BYTE Channel
- The channel to set the position for. First channel is zero.
- BYTE Position
- Target position to move towards.
Return value
- This call does not return a value
MoveToPosition
Moves a single step towards the new position, the rate of movement is determined by how often the move to macro is called. Returns 1 if the position has been reached.
Parameters
- BYTE Channel
- The channel to set the position for. First channel is zero.
- BYTE Position
- Target position to move towards.
Return value
- BYTE : 1 = reached target, 0 = target not reached.
SetTrim
Allows the level of trim for each servo channel to be adjusted progmatically.
Parameters
- BYTE Channel
- The channel to set the position for. First channel is zero.
- BYTE Trim
Return value
- This call does not return a value
AutoMoveToPosition
Automatically moves towards the new position with a fixed rate of 100 steps per second.
Parameters
- BYTE Channel
- The channel to set the position for. First channel is zero.
- BYTE Position
- Position to move to.
Return value
- This call does not return a value
EnableServo
Enables a servo channel effectivly setting the position of the motor to the value in the local position variable.
Parameters
- BYTE Channel
- The channel to set the position for. First channel is zero.
Return value
- This call does not return a value
Initialise
Sets up the servo motor interrupts
Parameters
- This macro has no parameters
Return value
- This call does not return a value
Simulation macro reference
This component does not contain any simulation macros
Property reference
Channels (1 - 8)
This property is of type Fixed list of ints and can be referenced with the variable name Channel_Count.
Set the number of servo's that you need to control.
Value from 1 to 8.
Channel 0
This property is of type Single digital pin and can be referenced with the variable name pin0.
Pin on which to output PWM for the servo motor.
Trim 0
This property is of type Fixed list of ints and can be referenced with the variable name trim0.
Trim the pulse width for this channel. Use this to trim the positioning of two servos so that similar
input values will produce the same degree of movement.
Minimum (us)
This property is of type Unsigned integer and can be referenced with the variable name min_pulse_width.
Shortest pulse width that will be used.
Maximum (us)
This property is of type Unsigned integer and can be referenced with the variable name max_pulse_width.
Longest pulse width used for the PWM signals.
Servo Object 0
This property is of type Panel object and can be referenced with the variable name sim0.
Drag a servo motor component onto the System Panel, and then select it here, to create
an on screen simulation of the way that your flowchart moves the servo's.
Servo motors should be based on the 'Servo Motor Base' component, or use a custom component
set to responf to 'User.Notify' events (ID = n/a, Data = Position (0-127)).