|
|
| Line 48: |
Line 48: |
|
| |
|
| ''<span style="color:red;">No additional examples</span>'' | | ''<span style="color:red;">No additional examples</span>'' |
| | |
| | |
|
| |
|
|
| |
|
| Line 53: |
Line 55: |
| ==Macro reference== | | ==Macro reference== |
|
| |
|
| | ===DisableServo=== |
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |
| |- | | |- |
| Line 71: |
Line 74: |
|
| |
|
|
| |
|
| | ===SetPosition=== |
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |
| |- | | |- |
| Line 94: |
Line 98: |
|
| |
|
|
| |
|
| | ===MoveToPositionInt=== |
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |
| |- | | |- |
| Line 117: |
Line 122: |
|
| |
|
|
| |
|
| | ===SetPositionInt=== |
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |
| |- | | |- |
| Line 140: |
Line 146: |
|
| |
|
|
| |
|
| | ===MoveToPosition=== |
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |
| |- | | |- |
| Line 163: |
Line 170: |
|
| |
|
|
| |
|
| | ===SetTrim=== |
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |
| |- | | |- |
| Line 186: |
Line 194: |
|
| |
|
|
| |
|
| | ===IsAutoMoving=== |
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |
| |- | | |- |
| Line 199: |
Line 208: |
|
| |
|
|
| |
|
| | ===SetAutoMoveSpeedInt=== |
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |
| |- | | |- |
| Line 217: |
Line 227: |
|
| |
|
|
| |
|
| | ===IsServoAutoMoving=== |
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |
| |- | | |- |
| Line 235: |
Line 246: |
|
| |
|
|
| |
|
| | ===AutoMoveToPosition=== |
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |
| |- | | |- |
| Line 258: |
Line 270: |
|
| |
|
|
| |
|
| | ===EnableServo=== |
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |
| |- | | |- |
| Line 276: |
Line 289: |
|
| |
|
|
| |
|
| | ===SetAutoMoveSpeed=== |
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |
| |- | | |- |
| Line 294: |
Line 308: |
|
| |
|
|
| |
|
| | ===AutoMoveToPositionInt=== |
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |
| |- | | |- |
| Line 317: |
Line 332: |
|
| |
|
|
| |
|
| | ===Initialise=== |
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |
| |- | | |- |
| Author
|
Matrix Ltd
|
| Version
|
2.1
|
| Category
|
Mechatronics
|
Servo Motor Controller component
Can control up to eight standard PWM driven servo's. Supports 8-bit and 16-bit movement resolutions. 'Servo Object' properties allow you to connect the controller to on-screen simulations using the "Servo Motor" component and its derivatives.
Component Source Code
Please click here to download the component source project: FC_Comp_Source_Servo_Controller.fcfx
Please click here to view the component source code (Beta): FC_Comp_Source_Servo_Controller.fcfx
Detailed description
No detailed description exists yet for this component
Examples
No additional examples
Macro reference
DisableServo
|
DisableServo
|
| Disables a servo channel effectivly disabling the motor.
|
- BYTE
|
Channel
|
| The channel to set the position for. First channel is zero.
|
- VOID
|
Return
|
SetPosition
|
SetPosition
|
| Moves directly to the specified position with no interpolation.
|
- BYTE
|
Channel
|
| The channel to assign the new position. Range: 0-7
|
- BYTE
|
Position
|
| Position to jump to. Range: 0-255
|
- VOID
|
Return
|
MoveToPositionInt
|
MoveToPositionInt
|
| 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.
|
- BYTE
|
Channel
|
| The channel to assign the new position. Range: 0-7
|
- UINT
|
Position
|
| Target position to move towards. Range: 0-65535
|
- BYTE
|
Return
|
SetPositionInt
|
SetPositionInt
|
| Moves directly to the specified position with no interpolation. Uses a 16-bit position parameter to add extra precision.
|
- BYTE
|
Channel
|
| The channel to assign the new position. Range: 0-7
|
- UINT
|
Position
|
| Position to jump to. Range: 0-65535
|
- VOID
|
Return
|
MoveToPosition
|
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.
|
- BYTE
|
Channel
|
| The channel to assign the new position. Range: 0-7
|
- BYTE
|
Position
|
| Target position to move towards. Range: 0-255
|
- BYTE
|
Return
|
SetTrim
|
SetTrim
|
| Allows the level of trim for each servo channel to be adjusted progmatically.
|
- BYTE
|
Channel
|
| The channel to set the position for. First channel is zero.
|
- BYTE
|
Trim
|
| Legacy: 0=0us, 1=+25us, 2=+50us, 3=+75us, 4=+100us, 5=-25us, 6=-50us, 7=-75us, 8=-100us or Smooth: 0-200
|
- VOID
|
Return
|
IsAutoMoving
|
IsAutoMoving
|
| Is the AutoMoveToPosition movement complete. Returns 1 if the servos are still moving. Returns 0 if all servo movement is complete.
|
- BYTE
|
Return
|
SetAutoMoveSpeedInt
|
SetAutoMoveSpeedInt
|
| Sets the speed of the auto move to position macro. Default speed is shown in the Servo_Period_Multiplier property.
|
- UINT
|
Speed
|
| 1=Slowest (Default), 2= Double, 3=Triple, 4=Quadruple
|
- VOID
|
Return
|
IsServoAutoMoving
|
IsServoAutoMoving
|
| Is the AutoMoveToPosition movement complete for a specific servo output. Returns 1 if the servo is still moving. Returns 0 if the servo movement is complete.
|
- BYTE
|
Channel
|
| Servo Motor Output Range: 0-7
|
- BYTE
|
Return
|
AutoMoveToPosition
|
AutoMoveToPosition
|
| Automatically moves towards the new position at a fixed rate determined by the AutoMoveSpeed.
|
- BYTE
|
Channel
|
| The channel to assign the new position. Range: 0-7
|
- BYTE
|
Position
|
| Position to automatically move to. Range: 0-255
|
- VOID
|
Return
|
EnableServo
|
EnableServo
|
| Enables a servo channel effectivly setting the position of the motor to the value in the local position variable.
|
- BYTE
|
Channel
|
| The channel to set the position for. First channel is zero.
|
- VOID
|
Return
|
SetAutoMoveSpeed
|
SetAutoMoveSpeed
|
| Sets the speed of the auto move to position macro. Default speed is shown in the Servo_Period_Multiplier property.
|
- BYTE
|
Speed
|
| 1=Slowest (Default), 2= Double, 3=Triple, 4=Quadruple
|
- VOID
|
Return
|
AutoMoveToPositionInt
|
AutoMoveToPositionInt
|
| Automatically moves towards the new 16-bit position at a fixed rate determined by the AutoMoveSpeed.
|
- BYTE
|
Channel
|
| The channel to assign the new position. Range: 0-7
|
- UINT
|
Position
|
| Position to automatically move to. Range: 0-65535
|
- VOID
|
Return
|
Initialise
|
Initialise
|
| Sets up the servo motor interrupts
|
- VOID
|
Return
|
Property reference
|
Properties
|
|
Channels (1 - 8)
|
| Set the number of servo's that you need to control. Value from 1 to 8.
|
|
Connections
|
|
Channel 0
|
| Pin on which to output PWM for the servo motor.
|
|
Channel 1
|
| Pin on which to output PWM for the servo motor.
|
|
Channel 2
|
| Pin on which to output PWM for the servo motor.
|
|
Channel 3
|
| Pin on which to output PWM for the servo motor.
|
|
Channel 4
|
| Pin on which to output PWM for the servo motor.
|
|
Channel 5
|
| Pin on which to output PWM for the servo motor.
|
|
Channel 6
|
| Pin on which to output PWM for the servo motor.
|
|
Channel 7
|
| Pin on which to output PWM for the servo motor.
|
|
Resources
|
|
Peripherals
|
| Lists the internal peripherals of the MCU used by the component. When the servo motor is initialised you will not be able to use the listed peripherals for other functionality.
|
|
Trim
|
|
Trim Mode
|
|
|
|
Trim 0
|
| 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.
|
|
Trim 1
|
| 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.
|
|
Trim 2
|
| 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.
|
|
Trim 3
|
| 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.
|
|
Trim 4
|
| 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.
|
|
Trim 5
|
| 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.
|
|
Trim 6
|
| 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.
|
|
Trim 7
|
| 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.
|
|
Pulse Width
|
|
Minimum (us)
|
| Shortest pulse width that will be used.
|
|
Maximum (us)
|
| Longest pulse width used for the PWM signals.
|
|
Period Multiplier
|
| Number of instructions for 1 / 256th of the positional accuracy. This sets the default movement speed to maintain legacy move speeds. Also sets the multiplication factor to convert from a byte 0-255 to a clocked position value.
|
|
Simulation
|
|
Servo Object 0
|
| 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)).
|
|
Servo Object 1
|
| 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)).
|
|
Servo Object 2
|
| 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)).
|
|
Servo Object 3
|
| 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)).
|
|
Servo Object 4
|
| 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)).
|
|
Servo Object 5
|
| 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)).
|
|
Servo Object 6
|
| 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)).
|
|
Servo Object 7
|
| 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)).
|