Jump to content

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

From Flowcode Help
XML import - Pre 8.0 release
 
m Text replacement - "style="background-color:#EAE1EA;"" to "class="mtx-class-propfolder""
 
(19 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 
{| style="width:50%"
 
{| width="50%"
|-
|-
| width="20%" style="color: gray;" | Author
| width="20%" style="color:gray;" | Author
| Matrix TSL
| Matrix TSL
|-
|-
| width="20%" style="color: gray;" | Version
| width="20%" style="color:gray;" | Version
| 1.0 (Release)
| 1.0
|-
|-
| width="20%" style="color: gray;" | Category
| width="20%" style="color:gray;" | Category
| E-blocks 2
| 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.


==[[File:Component Icon bc8ae960_3887_4d08_ac7c_1eedb8e5f6c8.png|Image]] Servo Motor (BL0162) component==
==Component Source Code==
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.


==Examples==
Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_EBlocks2_Servo_BL0162.fcfx FC_Comp_Source_EBlocks2_Servo_BL0162.fcfx]
''<span style="color:red;">No additional examples</span>''


Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_EBlocks2_Servo_BL0162.fcfx FC_Comp_Source_EBlocks2_Servo_BL0162.fcfx]


==Downloadable macro reference==
==Detailed description==


===<span style="font-weight: normal;"><u><tt>DisableServo</tt></u></span>===
Disables a servo channel effectivly disabling the motor.


'''Parameters'''


:[[Variable Types|BYTE]] ''Channel''
::The channel to set the position for.  First channel is zero.




'''Return value'''


:''This call does not return a value''




===<span style="font-weight: normal;"><u><tt>SetPosition</tt></u></span>===
Moves directly to the specified position with no interpolation.


'''Parameters'''


:[[Variable Types|BYTE]] ''Channel''
::The channel to set the position for.  First channel is zero.


:[[Variable Types|BYTE]] ''Position''
''No detailed description exists yet for this component''
::Target position to move towards.


==Examples==


'''Return value'''


:''This call does not return a value''




===<span style="font-weight: normal;"><u><tt>IsAutoMoving</tt></u></span>===
Is the AutoMoveToPosition movement complete.


Returns 1 if the servo is still moving.


Returns 0 if the servo movement is complete.


'''Parameters'''
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>


:''This macro has no parameters''
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.


'''Return value'''
D8 increments motor 0, D9 decrements motor on channel 0.


:[[Variable Types|BYTE]]
D10 increments motor 1, D11 decrements motor on channel 1.


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


===<span style="font-weight: normal;"><u><tt>MoveToPosition</tt></u></span>===
Connections:
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'''
Servo Board Port D0-D2.


:[[Variable Types|BYTE]] ''Channel''
Switch Board Port D8 - D13
::The channel to set the position for.  First channel is zero.


:[[Variable Types|BYTE]] ''Position''
LCD A0 to A5 (PortC)
::Target position to move towards.


{{Fcfile|BL0162_Servo_BL0055.fcfx|BL0162 Servos Example for BL0055}}<br><br>


'''Return value'''
==Macro reference==


:[[Variable Types|BYTE]] : 1 = reached target, 0 = target not reached.
===AutoMoveToPosition===
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''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''
|}




===<span style="font-weight: normal;"><u><tt>SetTrim</tt></u></span>===
===DisableServo===
Allows the level of trim for each servo channel to be adjusted progmatically.
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''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''
|}


'''Parameters'''


:[[Variable Types|BYTE]] ''Channel''
===EnableServo===
::The channel to set the position for.  First channel is zero.
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''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''
|}


:[[Variable Types|BYTE]] ''Trim''
::0=0us, 1=+25us, 2=+50us, 3=+75us, 4=+100us, 5=-25us, 6=-50us, 7=-75us, 8=-100us


===Initialise===
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''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''
|}


'''Return value'''


:''This call does not return a value''
===IsAutoMoving===
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''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''
|}




===<span style="font-weight: normal;"><u><tt>AutoMoveToPosition</tt></u></span>===
===MoveToPosition===
Automatically moves towards the new position with a fixed rate of 100 steps per second.
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| 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;
|-
|-
| 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''
|}


'''Parameters'''


:[[Variable Types|BYTE]] ''Channel''
===SetAutoMoveSpeed===
::The channel to set the position for. First channel is zero.
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''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''
|}


:[[Variable Types|BYTE]] ''Position''
::Position to move to.


===SetPosition===
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''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''
|}


'''Return value'''
:''This call does not return a value''
===<span style="font-weight: normal;"><u><tt>EnableServo</tt></u></span>===
Enables a servo channel effectivly setting the position of the motor to the value in the local position variable.
'''Parameters'''
:[[Variable Types|BYTE]] ''Channel''
::The channel to set the position for.  First channel is zero.
'''Return value'''
:''This call does not return a value''


 
===SetTrim===
===<span style="font-weight: normal;"><u><tt>SetAutoMoveSpeed</tt></u></span>===
{| class="mtx-class-macrotable wikitable"
Sets the speed of the auto move to position macro.
|-
 
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
Default speed is 1.
| width="90%" class="mtx-class-macrohead" | '''SetTrim'''
 
|-
'''Parameters'''
| colspan="2" | Allows the level of trim for each servo channel to be adjusted progmatically.&nbsp;
 
|-
:[[Variable Types|BYTE]] ''Speed''
|-
::1=Slowest (Default), 2= Double, 3=Triple, 4=Quadruple
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Channel
 
|-
'''Return value'''
| colspan="2" | The channel to set the position for.  First channel is zero.&nbsp;
 
|-
:''This call does not return a value''
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Trim
 
|-
===<span style="font-weight: normal;"><u><tt>Initialise</tt></u></span>===
| colspan="2" | 0=0us, 1=+25us, 2=+50us, 3=+75us, 4=+100us, 5=-25us, 6=-50us, 7=-75us, 8=-100us&nbsp;
Sets up the servo motor interrupts
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
'''Parameters'''
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
:''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==
==Property reference==
<span style="font-weight: normal;"><u>Channels (1 - 8)</u></span>


This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''Servo_Controller1::Channel_Count''.
{| class="mtx-class-macrotable wikitable"
 
|-
Set the number of servo's that you need to control.
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-prop-icon.png]]
 
| width="90%" class="mtx-class-macrohead" | '''Properties'''  
Value from 1 to 8.
|-
 
|-
<span style="font-weight: normal;"><u>Channel 0</u></span>
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
| width="90%" | Channels (1 - 8)
This property is of type ''Single digital pin'' and can be referenced with the variable name ''Servo_Controller1::pin0''.
|-
 
| colspan="2" | Set the number of servo's that you need to control. Value from 1 to 8.&nbsp;
Pin on which to output PWM for the servo motor.
|-
 
| width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]]
<span style="font-weight: normal;"><u>Channel 1</u></span>
| width="90%" class="mtx-class-propfolder" | Connections
 
|-
This property is of type ''Single digital pin'' and can be referenced with the variable name ''Servo_Controller1::pin1''.
|-
 
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
Pin on which to output PWM for the servo motor.
| width="90%" | Channel 0
 
|-
<span style="font-weight: normal;"><u>Channel 2</u></span>
| colspan="2" | Pin on which to output PWM for the servo motor.&nbsp;
 
|-
This property is of type ''Single digital pin'' and can be referenced with the variable name ''Servo_Controller1::pin2''.
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
 
| width="90%" | Channel 1
Pin on which to output PWM for the servo motor.
|-
 
| colspan="2" | Pin on which to output PWM for the servo motor.&nbsp;
<span style="font-weight: normal;"><u>Channel 3</u></span>
|-
 
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
This property is of type ''Single digital pin'' and can be referenced with the variable name ''Servo_Controller1::pin3''.
| width="90%" | Channel 2
 
|-
Pin on which to output PWM for the servo motor.
| colspan="2" | Pin on which to output PWM for the servo motor.&nbsp;
 
|-
<span style="font-weight: normal;"><u>Channel 4</u></span>
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
 
| width="90%" | Channel 3
This property is of type ''Single digital pin'' and can be referenced with the variable name ''Servo_Controller1::pin4''.
|-
 
| colspan="2" | Pin on which to output PWM for the servo motor.&nbsp;
Pin on which to output PWM for the servo motor.
|-
 
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
<span style="font-weight: normal;"><u>Channel 5</u></span>
| width="90%" | Channel 4
 
|-
This property is of type ''Single digital pin'' and can be referenced with the variable name ''Servo_Controller1::pin5''.
| colspan="2" | Pin on which to output PWM for the servo motor.&nbsp;
 
|-
Pin on which to output PWM for the servo motor.
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
 
| width="90%" | Channel 5
<span style="font-weight: normal;"><u>Channel 6</u></span>
|-
 
| colspan="2" | Pin on which to output PWM for the servo motor.&nbsp;
This property is of type ''Single digital pin'' and can be referenced with the variable name ''Servo_Controller1::pin6''.
|-
 
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
Pin on which to output PWM for the servo motor.
| width="90%" | Channel 6
 
|-
<span style="font-weight: normal;"><u>Channel 7</u></span>
| colspan="2" | Pin on which to output PWM for the servo motor.&nbsp;
 
|-
This property is of type ''Single digital pin'' and can be referenced with the variable name ''Servo_Controller1::pin7''.
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
 
| width="90%" | Channel 7
Pin on which to output PWM for the servo motor.
|-
 
| colspan="2" | Pin on which to output PWM for the servo motor.&nbsp;
<span style="font-weight: normal;"><u>Minimum (us)</u></span>
|-
 
| width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]]
This property is of type ''Unsigned integer'' and can be referenced with the variable name ''Servo_Controller1::min_pulse_width''.
| width="90%" class="mtx-class-propfolder" | Pulse Width
 
|-
Shortest pulse width that will be used.
|-
 
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
<span style="font-weight: normal;"><u>Maximum (us)</u></span>
| width="90%" | Minimum (us)
 
|-
This property is of type ''Unsigned integer'' and can be referenced with the variable name ''Servo_Controller1::max_pulse_width''.
| colspan="2" | Shortest pulse width that will be used.&nbsp;
 
|-
Longest pulse width used for the PWM signals.
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
 
| width="90%" | Maximum (us)
<span style="font-weight: normal;"><u>Trim 0</u></span>
|-
 
| colspan="2" | Longest pulse width used for the PWM signals.&nbsp;
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''Servo_Controller1::trim0''.
|-
 
| width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]]
Trim the pulse width for this channel.  Use this to trim the positioning of two servos so that similar
| width="90%" class="mtx-class-propfolder" | Trim
 
|-
input values will produce the same degree of movement.
|-
 
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
<span style="font-weight: normal;"><u>Trim 1</u></span>
| width="90%" | Trim 0
 
|-
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''Servo_Controller1::trim1''.
| 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;
 
|-
Trim the pulse width for this channel.  Use this to trim the positioning of two servos so that similar
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
| width="90%" | Trim 1
input values will produce the same degree of movement.
|-
 
| 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;
<span style="font-weight: normal;"><u>Trim 2</u></span>
|-
 
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''Servo_Controller1::trim2''.
| width="90%" | Trim 2
 
|-
Trim the pulse width for this channel.  Use this to trim the positioning of two servos so that similar
| 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;
 
|-
input values will produce the same degree of movement.
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
| width="90%" | Trim 3
<span style="font-weight: normal;"><u>Trim 3</u></span>
|-
 
| 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;
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''Servo_Controller1::trim3''.
|-
 
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
Trim the pulse width for this channel.  Use this to trim the positioning of two servos so that similar
| width="90%" | Trim 4
 
|-
input values will produce the same degree of movement.
| 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;
 
|-
<span style="font-weight: normal;"><u>Trim 4</u></span>
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
| width="90%" | Trim 5
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''Servo_Controller1::trim4''.
|-
 
| 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;
Trim the pulse width for this channel.  Use this to trim the positioning of two servos so that similar
|-
 
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
input values will produce the same degree of movement.
| width="90%" | Trim 6
 
|-
<span style="font-weight: normal;"><u>Trim 5</u></span>
| 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;
 
|-
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''Servo_Controller1::trim5''.
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
| width="90%" | Trim 7
Trim the pulse width for this channel.  Use this to trim the positioning of two servos so that similar
|-
 
| 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;
input values will produce the same degree of movement.
|-
 
| width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]]
<span style="font-weight: normal;"><u>Trim 6</u></span>
| width="90%" class="mtx-class-propfolder" | Simulation
 
|-
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''Servo_Controller1::trim6''.
|-
 
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
Trim the pulse width for this channel.  Use this to trim the positioning of two servos so that similar
| width="90%" | Show Servo Interface
 
|-
input values will produce the same degree of movement.
| colspan="2" | &nbsp;
 
|-
<span style="font-weight: normal;"><u>Trim 7</u></span>
| width="10%" align="center" | [[File:Fc9-type-17-icon.png]]
 
| width="90%" | Servo Object 0
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''Servo_Controller1::trim7''.
|-
 
| 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;
Trim the pulse width for this channel.  Use this to trim the positioning of two servos so that similar
|-
 
| width="10%" align="center" | [[File:Fc9-type-17-icon.png]]
input values will produce the same degree of movement.
| width="90%" | Servo Object 1
 
|-
<span style="font-weight: normal;"><u>Servo Object 0</u></span>
| 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;
 
|-
This property is of type ''Panel object'' and can be referenced with the variable name ''Servo_Controller1::sim0''.
| width="10%" align="center" | [[File:Fc9-type-17-icon.png]]
 
| width="90%" | Servo Object 2
Drag a servo motor component onto the System Panel, and then select it here, to create
|-
 
| 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;
an on screen simulation of the way that your flowchart moves the servo's.
|-
 
| width="10%" align="center" | [[File:Fc9-type-17-icon.png]]
Servo motors should be based on the 'Servo Motor Base' component, or use a custom component
| width="90%" | Servo Object 3
 
|-
set to responf to 'User.Notify' events (ID = n/a,  Data = Position (0-127)).
| 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;
 
|-
<span style="font-weight: normal;"><u>Servo Object 1</u></span>
| width="10%" align="center" | [[File:Fc9-type-17-icon.png]]
 
| width="90%" | Servo Object 4
This property is of type ''Panel object'' and can be referenced with the variable name ''Servo_Controller1::sim1''.
|-
 
| 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;
Drag a servo motor component onto the System Panel, and then select it here, to create
|-
 
| width="10%" align="center" | [[File:Fc9-type-17-icon.png]]
an on screen simulation of the way that your flowchart moves the servo's.
| width="90%" | Servo Object 5
 
|-
Servo motors should be based on the 'Servo Motor Base' component, or use a custom component
| 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;
 
|-
set to responf to 'User.Notify' events (ID = n/a,  Data = Position (0-127)).
| width="10%" align="center" | [[File:Fc9-type-17-icon.png]]
 
| width="90%" | Servo Object 6
<span style="font-weight: normal;"><u>Servo Object 2</u></span>
|-
 
| 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;
This property is of type ''Panel object'' and can be referenced with the variable name ''Servo_Controller1::sim2''.
|-
 
| width="10%" align="center" | [[File:Fc9-type-17-icon.png]]
Drag a servo motor component onto the System Panel, and then select it here, to create
| width="90%" | Servo Object 7
 
|-
an on screen simulation of the way that your flowchart moves the servo's.
| 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;
 
|}
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)).
 
<span style="font-weight: normal;"><u>Servo Object 3</u></span>
 
This property is of type ''Panel object'' and can be referenced with the variable name ''Servo_Controller1::sim3''.
 
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)).
 
<span style="font-weight: normal;"><u>Servo Object 4</u></span>
 
This property is of type ''Panel object'' and can be referenced with the variable name ''Servo_Controller1::sim4''.
 
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)).
 
<span style="font-weight: normal;"><u>Servo Object 5</u></span>
 
This property is of type ''Panel object'' and can be referenced with the variable name ''Servo_Controller1::sim5''.
 
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)).
 
<span style="font-weight: normal;"><u>Servo Object 6</u></span>
 
This property is of type ''Panel object'' and can be referenced with the variable name ''Servo_Controller1::sim6''.
 
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)).
 
<span style="font-weight: normal;"><u>Servo Object 7</u></span>
 
This property is of type ''Panel object'' and can be referenced with the variable name ''Servo_Controller1::sim7''.
 
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)).

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)).