Jump to content

Component: Servo Motor (BL0162) (E-blocks 2): Difference between revisions

From Flowcode Help
No edit summary
m Text replacement - "style="background-color:#EAE1EA;"" to "class="mtx-class-propfolder""
 
(12 intermediate revisions by 3 users not shown)
Line 22: Line 22:


==Detailed description==
==Detailed description==




Line 41: Line 43:




Example showing how to control three servos using AutoMoveToPosion, MoveTopposition & SetPosition component macros.<br>
{{Fcfile|Controlling_Servos_Example.fcfx|Controlling Servos Example.fcfx}}<br><br>


Example using BL0162 Servo controller for BL0055 Arduino Shield


Samples the Port D8-D13 (portB) switches and moves the servo motors based on the input states.


''<span style="color:red;">No additional examples</span>''
D8 increments motor 0, D9 decrements motor on channel 0.


D10 increments motor 1, D11 decrements motor on channel 1.


==Macro reference==
D12 increments motor 3, D13 decrements motor on channel 2.


{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
Connections:   
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''DisableServo'''
|-
| colspan="2" | Disables a servo channel effectivly disabling the motor.&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Channel
|-
| colspan="2" | The channel to set the position for. First channel is zero.&nbsp;
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}


Servo Board Port D0-D2.


{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
Switch Board Port D8 - D13
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetPosition'''
|-
| colspan="2" | Moves directly to the specified position with no interpolation.&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Channel
|-
| colspan="2" | The channel to set the position for.  First channel is zero.&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Position
|-
| colspan="2" | Target position to move towards.&nbsp;
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}


LCD A0 to A5 (PortC)


{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{{Fcfile|BL0162_Servo_BL0055.fcfx|BL0162 Servos Example for BL0055}}<br><br>
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''IsAutoMoving'''
|-
| colspan="2" | Is the AutoMoveToPosition movement complete. Returns 1 if the servo is still moving. Returns 0 if the servo movement is complete.&nbsp;
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}


==Macro reference==


{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===AutoMoveToPosition===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''MoveToPosition'''
| width="90%" class="mtx-class-macrohead" | '''AutoMoveToPosition'''
|-
| colspan="2" | 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.&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Channel
|-
| colspan="2" | The channel to set the position for.  First channel is zero.&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Position
|-
| colspan="2" | Target position to move towards.&nbsp;
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetTrim'''
|-
| colspan="2" | Allows the level of trim for each servo channel to be adjusted progmatically.&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Channel
|-
| colspan="2" | The channel to set the position for.  First channel is zero.&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Trim
|-
| colspan="2" | 0=0us, 1=+25us, 2=+50us, 3=+75us, 4=+100us, 5=-25us, 6=-50us, 7=-75us, 8=-100us&nbsp;
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''AutoMoveToPosition'''
|-
|-
| colspan="2" | Automatically moves towards the new position with a fixed rate of 100 steps per second.&nbsp;
| colspan="2" | Automatically moves towards the new position with a fixed rate of 100 steps per second.&nbsp;
Line 172: Line 92:




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===DisableServo===
|-
{| class="mtx-class-macrotable wikitable"
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''EnableServo'''
|-
| colspan="2" | Enables a servo channel effectivly setting the position of the motor to the value in the local position variable.&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Channel
|-
| colspan="2" | The channel to set the position for.  First channel is zero.&nbsp;
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetAutoMoveSpeed'''
|-
| colspan="2" | Sets the speed of the auto move to position macro. Default speed is 1.&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Speed
|-
| colspan="2" | 1=Slowest (Default), 2= Double, 3=Triple, 4=Quadruple&nbsp;
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise'''
|-
| colspan="2" | Sets up the servo motor interrupts&nbsp;
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
 
 
 
 
==Property reference==
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''
|-
|-
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| width="90%" | Channels (1 - 8)
|-
| colspan="2" | Set the number of servo's that you need to control. Value from 1 to 8.&nbsp;
|-
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Connections
|-
|-
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
| width="90%" | Channel 0
|-
| colspan="2" | Pin on which to output PWM for the servo motor.&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
| width="90%" | Channel 1
|-
| colspan="2" | Pin on which to output PWM for the servo motor.&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
| width="90%" | Channel 2
|-
| colspan="2" | Pin on which to output PWM for the servo motor.&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
| width="90%" | Channel 3
|-
| colspan="2" | Pin on which to output PWM for the servo motor.&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
| width="90%" | Channel 4
|-
| colspan="2" | Pin on which to output PWM for the servo motor.&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
| width="90%" | Channel 5
|-
| colspan="2" | Pin on which to output PWM for the servo motor.&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
| width="90%" | Channel 6
|-
| colspan="2" | Pin on which to output PWM for the servo motor.&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
| width="90%" | Channel 7
|-
| colspan="2" | Pin on which to output PWM for the servo motor.&nbsp;
|-
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Pulse Width
|-
|-
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| width="90%" | Minimum (us)
|-
| colspan="2" | Shortest pulse width that will be used.&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| width="90%" | Maximum (us)
|-
| colspan="2" | Longest pulse width used for the PWM signals.&nbsp;
|-
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Trim
|-
|-
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| width="90%" | Trim 0
|-
| colspan="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.&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| width="90%" | Trim 1
|-
| colspan="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.&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| width="90%" | Trim 2
|-
| colspan="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.&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| width="90%" | Trim 3
|-
| colspan="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.&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| width="90%" | Trim 4
|-
| colspan="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.&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| width="90%" | Trim 5
|-
| colspan="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.&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| width="90%" | Trim 6
|-
| colspan="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.&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| width="90%" | Trim 7
|-
| colspan="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.&nbsp;
|-
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Simulation
|-
|-
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
| width="90%" | Show Servo Interface
|-
| colspan="2" | &nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-17-icon.png]]
| width="90%" | Servo Object 0
|-
| colspan="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)).&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-17-icon.png]]
| width="90%" | Servo Object 1
|-
| colspan="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)).&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-17-icon.png]]
| width="90%" | Servo Object 2
|-
| colspan="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)).&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-17-icon.png]]
| width="90%" | Servo Object 3
|-
| colspan="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)).&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-17-icon.png]]
| width="90%" | Servo Object 4
|-
| colspan="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)).&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-17-icon.png]]
| width="90%" | Servo Object 5
|-
| colspan="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)).&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-17-icon.png]]
| width="90%" | Servo Object 6
|-
| colspan="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)).&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-17-icon.png]]
| width="90%" | Servo Object 7
|-
| colspan="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)).&nbsp;
|}==Macro reference==
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''DisableServo'''
| width="90%" class="mtx-class-macrohead" | '''DisableServo'''
|-
|-
| colspan="2" | Disables a servo channel effectivly disabling the motor.&nbsp;
| colspan="2" | Disables a servo channel effectivly disabling the motor.&nbsp;
Line 406: Line 111:




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===EnableServo===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetPosition'''
| width="90%" class="mtx-class-macrohead" | '''EnableServo'''
|-
| colspan="2" | Moves directly to the specified position with no interpolation.&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Channel
|-
| colspan="2" | The channel to set the position for.  First channel is zero.&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Position
|-
| colspan="2" | Target position to move towards.&nbsp;
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''IsAutoMoving'''
|-
| colspan="2" | Is the AutoMoveToPosition movement complete. Returns 1 if the servo is still moving. Returns 0 if the servo movement is complete.&nbsp;
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''MoveToPosition'''
|-
| colspan="2" | 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.&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Channel
|-
| colspan="2" | The channel to set the position for.  First channel is zero.&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Position
|-
| colspan="2" | Target position to move towards.&nbsp;
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetTrim'''
|-
| colspan="2" | Allows the level of trim for each servo channel to be adjusted progmatically.&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Channel
|-
| colspan="2" | The channel to set the position for.  First channel is zero.&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Trim
|-
| colspan="2" | 0=0us, 1=+25us, 2=+50us, 3=+75us, 4=+100us, 5=-25us, 6=-50us, 7=-75us, 8=-100us&nbsp;
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''AutoMoveToPosition'''
|-
| colspan="2" | Automatically moves towards the new position with a fixed rate of 100 steps per second.&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Channel
|-
| colspan="2" | The channel to set the position for.  First channel is zero.&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Position
|-
| colspan="2" | Position to move to.&nbsp;
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''EnableServo'''
|-
|-
| colspan="2" | Enables a servo channel effectivly setting the position of the motor to the value in the local position variable.&nbsp;
| colspan="2" | Enables a servo channel effectivly setting the position of the motor to the value in the local position variable.&nbsp;
Line 529: Line 130:




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===Initialise===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetAutoMoveSpeed'''
| width="90%" class="mtx-class-macrohead" | '''Initialise'''
|-
| colspan="2" | Sets the speed of the auto move to position macro. Default speed is 1.&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Speed
|-
| colspan="2" | 1=Slowest (Default), 2= Double, 3=Triple, 4=Quadruple&nbsp;
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise'''
|-
|-
| colspan="2" | Sets up the servo motor interrupts&nbsp;
| colspan="2" | Sets up the servo motor interrupts&nbsp;
Line 560: Line 144:




 
===IsAutoMoving===
 
{| class="mtx-class-macrotable wikitable"
==Property reference==
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''
|-
|-
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| width="90%" | Channels (1 - 8)
|-
| colspan="2" | Set the number of servo's that you need to control. Value from 1 to 8.&nbsp;
|-
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Connections
|-
|-
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
| width="90%" | Channel 0
|-
| colspan="2" | Pin on which to output PWM for the servo motor.&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" | Channel 1
| width="90%" class="mtx-class-macrohead" | '''IsAutoMoving'''
|-
| colspan="2" | Pin on which to output PWM for the servo motor.&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
| width="90%" | Channel 2
|-
| colspan="2" | Pin on which to output PWM for the servo motor.&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
| width="90%" | Channel 3
|-
| colspan="2" | Pin on which to output PWM for the servo motor.&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
| width="90%" | Channel 4
|-
| colspan="2" | Pin on which to output PWM for the servo motor.&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
| width="90%" | Channel 5
|-
| colspan="2" | Pin on which to output PWM for the servo motor.&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
| width="90%" | Channel 6
|-
| colspan="2" | Pin on which to output PWM for the servo motor.&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
| width="90%" | Channel 7
|-
| colspan="2" | Pin on which to output PWM for the servo motor.&nbsp;
|-
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Pulse Width
|-
|-
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| width="90%" | Minimum (us)
|-
| colspan="2" | Shortest pulse width that will be used.&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| width="90%" | Maximum (us)
|-
| colspan="2" | Longest pulse width used for the PWM signals.&nbsp;
|-
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Trim
|-
|-
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| width="90%" | Trim 0
|-
| colspan="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.&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| width="90%" | Trim 1
|-
| colspan="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.&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| width="90%" | Trim 2
|-
| colspan="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.&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| width="90%" | Trim 3
|-
| colspan="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.&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| width="90%" | Trim 4
|-
| colspan="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.&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| width="90%" | Trim 5
|-
| colspan="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.&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| width="90%" | Trim 6
|-
| colspan="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.&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| width="90%" | Trim 7
|-
| colspan="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.&nbsp;
|-
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Simulation
|-
|-
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
| width="90%" | Show Servo Interface
|-
| colspan="2" | &nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-17-icon.png]]
| width="90%" | Servo Object 0
|-
| colspan="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)).&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-17-icon.png]]
| width="90%" | Servo Object 1
|-
| colspan="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)).&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-17-icon.png]]
| width="90%" | Servo Object 2
|-
| colspan="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)).&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-17-icon.png]]
| width="90%" | Servo Object 3
|-
| colspan="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)).&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-17-icon.png]]
| width="90%" | Servo Object 4
|-
| colspan="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)).&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-17-icon.png]]
| width="90%" | Servo Object 5
|-
| colspan="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)).&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-17-icon.png]]
| width="90%" | Servo Object 6
|-
| colspan="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)).&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-17-icon.png]]
| width="90%" | Servo Object 7
|-
| colspan="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)).&nbsp;
|}==Macro reference==
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''DisableServo'''
|-
| colspan="2" | Disables a servo channel effectivly disabling the motor.&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Channel
|-
| colspan="2" | The channel to set the position for.  First channel is zero.&nbsp;
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetPosition'''
|-
| colspan="2" | Moves directly to the specified position with no interpolation.&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Channel
|-
| colspan="2" | The channel to set the position for.  First channel is zero.&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Position
|-
| colspan="2" | Target position to move towards.&nbsp;
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''IsAutoMoving'''
|-
|-
| colspan="2" | Is the AutoMoveToPosition movement complete. Returns 1 if the servo is still moving. Returns 0 if the servo movement is complete.&nbsp;
| colspan="2" | Is the AutoMoveToPosition movement complete. Returns 1 if the servo is still moving. Returns 0 if the servo movement is complete.&nbsp;
Line 781: Line 158:




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===MoveToPosition===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''MoveToPosition'''
| width="90%" class="mtx-class-macrohead" | '''MoveToPosition'''
|-
|-
| colspan="2" | 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.&nbsp;
| colspan="2" | 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.&nbsp;
Line 804: Line 182:




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===SetAutoMoveSpeed===
|-
{| class="mtx-class-macrotable wikitable"
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetTrim'''
|-
| colspan="2" | Allows the level of trim for each servo channel to be adjusted progmatically.&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Channel
|-
| colspan="2" | The channel to set the position for.  First channel is zero.&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Trim
|-
| colspan="2" | 0=0us, 1=+25us, 2=+50us, 3=+75us, 4=+100us, 5=-25us, 6=-50us, 7=-75us, 8=-100us&nbsp;
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''AutoMoveToPosition'''
|-
| colspan="2" | Automatically moves towards the new position with a fixed rate of 100 steps per second.&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Channel
|-
| colspan="2" | The channel to set the position for.  First channel is zero.&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Position
|-
| colspan="2" | Position to move to.&nbsp;
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''EnableServo'''
|-
| colspan="2" | Enables a servo channel effectivly setting the position of the motor to the value in the local position variable.&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Channel
|-
| colspan="2" | The channel to set the position for.  First channel is zero.&nbsp;
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetAutoMoveSpeed'''
| width="90%" class="mtx-class-macrohead" | '''SetAutoMoveSpeed'''
|-
|-
| colspan="2" | Sets the speed of the auto move to position macro. Default speed is 1.&nbsp;
| colspan="2" | Sets the speed of the auto move to position macro. Default speed is 1.&nbsp;
Line 886: Line 201:




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===SetPosition===
|-
{| class="mtx-class-macrotable wikitable"
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise'''
|-
| colspan="2" | Sets up the servo motor interrupts&nbsp;
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
 
 
 
 
==Property reference==
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''
| width="90%" class="mtx-class-macrohead" | '''SetPosition'''
|-
|-
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| width="90%" | Channels (1 - 8)
|-
| colspan="2" | Set the number of servo's that you need to control. Value from 1 to 8.&nbsp;
|-
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Connections
|-
|-
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
| width="90%" | Channel 0
|-
| colspan="2" | Pin on which to output PWM for the servo motor.&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
| width="90%" | Channel 1
|-
| colspan="2" | Pin on which to output PWM for the servo motor.&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
| width="90%" | Channel 2
|-
| colspan="2" | Pin on which to output PWM for the servo motor.&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
| width="90%" | Channel 3
|-
| colspan="2" | Pin on which to output PWM for the servo motor.&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
| width="90%" | Channel 4
|-
| colspan="2" | Pin on which to output PWM for the servo motor.&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
| width="90%" | Channel 5
|-
| colspan="2" | Pin on which to output PWM for the servo motor.&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
| width="90%" | Channel 6
|-
| colspan="2" | Pin on which to output PWM for the servo motor.&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
| width="90%" | Channel 7
|-
| colspan="2" | Pin on which to output PWM for the servo motor.&nbsp;
|-
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Pulse Width
|-
|-
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| width="90%" | Minimum (us)
|-
| colspan="2" | Shortest pulse width that will be used.&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| width="90%" | Maximum (us)
|-
| colspan="2" | Longest pulse width used for the PWM signals.&nbsp;
|-
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Trim
|-
|-
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| width="90%" | Trim 0
|-
| colspan="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.&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| width="90%" | Trim 1
|-
| colspan="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.&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| width="90%" | Trim 2
|-
| colspan="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.&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| width="90%" | Trim 3
|-
| colspan="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.&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| width="90%" | Trim 4
|-
| colspan="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.&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| width="90%" | Trim 5
|-
| colspan="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.&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| width="90%" | Trim 6
|-
| colspan="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.&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| width="90%" | Trim 7
|-
| colspan="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.&nbsp;
|-
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Simulation
|-
|-
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
| width="90%" | Show Servo Interface
|-
| colspan="2" | &nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-17-icon.png]]
| width="90%" | Servo Object 0
|-
| colspan="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)).&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-17-icon.png]]
| width="90%" | Servo Object 1
|-
| colspan="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)).&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-17-icon.png]]
| width="90%" | Servo Object 2
|-
| colspan="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)).&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-17-icon.png]]
| width="90%" | Servo Object 3
|-
| colspan="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)).&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-17-icon.png]]
| width="90%" | Servo Object 4
|-
| colspan="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)).&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-17-icon.png]]
| width="90%" | Servo Object 5
|-
| colspan="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)).&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-17-icon.png]]
| width="90%" | Servo Object 6
|-
| colspan="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)).&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-17-icon.png]]
| width="90%" | Servo Object 7
|-
| colspan="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)).&nbsp;
|}==Macro reference==
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''DisableServo'''
|-
| colspan="2" | Disables a servo channel effectivly disabling the motor.&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Channel
|-
| colspan="2" | The channel to set the position for.  First channel is zero.&nbsp;
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetPosition'''
|-
|-
| colspan="2" | Moves directly to the specified position with no interpolation.&nbsp;
| colspan="2" | Moves directly to the specified position with no interpolation.&nbsp;
Line 1,107: Line 225:




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===SetTrim===
|-
{| class="mtx-class-macrotable wikitable"
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''IsAutoMoving'''
|-
| colspan="2" | Is the AutoMoveToPosition movement complete. Returns 1 if the servo is still moving. Returns 0 if the servo movement is complete.&nbsp;
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''MoveToPosition'''
| width="90%" class="mtx-class-macrohead" | '''SetTrim'''
|-
| colspan="2" | 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.&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Channel
|-
| colspan="2" | The channel to set the position for.  First channel is zero.&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Position
|-
| colspan="2" | Target position to move towards.&nbsp;
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetTrim'''
|-
|-
| colspan="2" | Allows the level of trim for each servo channel to be adjusted progmatically.&nbsp;
| colspan="2" | Allows the level of trim for each servo channel to be adjusted progmatically.&nbsp;
Line 1,164: Line 247:
| width="90%" style="border-top: 2px solid #000;" | ''Return''
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
|}
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''AutoMoveToPosition'''
|-
| colspan="2" | Automatically moves towards the new position with a fixed rate of 100 steps per second.&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Channel
|-
| colspan="2" | The channel to set the position for.  First channel is zero.&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Position
|-
| colspan="2" | Position to move to.&nbsp;
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''EnableServo'''
|-
| colspan="2" | Enables a servo channel effectivly setting the position of the motor to the value in the local position variable.&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Channel
|-
| colspan="2" | The channel to set the position for.  First channel is zero.&nbsp;
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetAutoMoveSpeed'''
|-
| colspan="2" | Sets the speed of the auto move to position macro. Default speed is 1.&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Speed
|-
| colspan="2" | 1=Slowest (Default), 2= Double, 3=Triple, 4=Quadruple&nbsp;
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise'''
|-
| colspan="2" | Sets up the servo motor interrupts&nbsp;
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}




==Property reference==
==Property reference==


{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-prop-icon.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''  
| width="90%" class="mtx-class-macrohead" | '''Properties'''  
|-
|-
|-
|-
Line 1,253: Line 262:
| colspan="2" | Set the number of servo's that you need to control. Value from 1 to 8.&nbsp;
| colspan="2" | Set the number of servo's that you need to control. Value from 1 to 8.&nbsp;
|-
|-
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Connections
| width="90%" class="mtx-class-propfolder" | Connections
|-
|-
|-
|-
Line 1,297: Line 306:
| colspan="2" | Pin on which to output PWM for the servo motor.&nbsp;
| colspan="2" | Pin on which to output PWM for the servo motor.&nbsp;
|-
|-
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Pulse Width
| width="90%" class="mtx-class-propfolder" | Pulse Width
|-
|-
|-
|-
Line 1,311: Line 320:
| colspan="2" | Longest pulse width used for the PWM signals.&nbsp;
| colspan="2" | Longest pulse width used for the PWM signals.&nbsp;
|-
|-
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Trim
| width="90%" class="mtx-class-propfolder" | Trim
|-
|-
|-
|-
Line 1,355: Line 364:
| colspan="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.&nbsp;
| colspan="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.&nbsp;
|-
|-
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Simulation
| width="90%" class="mtx-class-propfolder" | Simulation
|-
|-
|-
|-

Latest revision as of 14:37, 13 July 2026

Author Matrix TSL
Version 1.0
Category E-blocks 2


Servo Motor component

Servo motor component to drive the E-blocks 2 BL0162 Servo Motors board. Provides up to eight individually addressable connections for standard DC servo motors to be connected.

Component Source Code

Please click here to download the component source project: FC_Comp_Source_EBlocks2_Servo_BL0162.fcfx

Please click here to view the component source code (Beta): FC_Comp_Source_EBlocks2_Servo_BL0162.fcfx

Detailed description

No detailed description exists yet for this component

Examples

Example showing how to control three servos using AutoMoveToPosion, MoveTopposition & SetPosition component macros.
Controlling Servos Example.fcfx

Example using BL0162 Servo controller for BL0055 Arduino Shield

Samples the Port D8-D13 (portB) switches and moves the servo motors based on the input states.

D8 increments motor 0, D9 decrements motor on channel 0.

D10 increments motor 1, D11 decrements motor on channel 1.

D12 increments motor 3, D13 decrements motor on channel 2.

Connections:

Servo Board Port D0-D2.

Switch Board Port D8 - D13

LCD A0 to A5 (PortC)

BL0162 Servos Example for BL0055

Macro reference

AutoMoveToPosition

AutoMoveToPosition
Automatically moves towards the new position with a fixed rate of 100 steps per second. 
- BYTE Channel
The channel to set the position for. First channel is zero. 
- BYTE Position
Position to move to. 
- VOID Return


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


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


Initialise

Initialise
Sets up the servo motor interrupts 
- VOID Return


IsAutoMoving

IsAutoMoving
Is the AutoMoveToPosition movement complete. Returns 1 if the servo is still moving. Returns 0 if the servo movement is complete. 
- BYTE 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 set the position for. First channel is zero. 
- BYTE Position
Target position to move towards. 
- BYTE Return


SetAutoMoveSpeed

SetAutoMoveSpeed
Sets the speed of the auto move to position macro. Default speed is 1. 
- BYTE Speed
1=Slowest (Default), 2= Double, 3=Triple, 4=Quadruple 
- VOID Return


SetPosition

SetPosition
Moves directly to the specified position with no interpolation. 
- BYTE Channel
The channel to set the position for. First channel is zero. 
- BYTE Position
Target position to move towards. 
- VOID 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
0=0us, 1=+25us, 2=+50us, 3=+75us, 4=+100us, 5=-25us, 6=-50us, 7=-75us, 8=-100us 
- 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. 
Pulse Width
Minimum (us)
Shortest pulse width that will be used. 
Maximum (us)
Longest pulse width used for the PWM signals. 
Trim
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. 
Simulation
Show Servo Interface
 
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)).