Difference between revisions of "Component: Servo Motor (BL0162) (E-blocks 2)"
From Flowcode Help
Jump to navigationJump to searchLine 17: | Line 17: | ||
==Component Source Code== | ==Component Source Code== | ||
− | Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/ | + | Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_temp/EBlocks2_Servo_BL0162.fcfx FC_Comp_Source_temp/EBlocks2_Servo_BL0162.fcfx] |
− | Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/ | + | Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_temp/EBlocks2_Servo_BL0162.fcfx FC_Comp_Source_temp/EBlocks2_Servo_BL0162.fcfx] |
==Detailed description== | ==Detailed description== | ||
Line 49: | Line 49: | ||
''<span style="color:red;">No additional examples</span>'' | ''<span style="color:red;">No additional examples</span>'' | ||
+ | |||
+ | |||
Line 56: | Line 58: | ||
==Macro reference== | ==Macro reference== | ||
+ | |||
+ | ===AutoMoveToPosition=== | ||
+ | {| 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. | ||
+ | |- | ||
+ | |- | ||
+ | | 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. | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | Position | ||
+ | |- | ||
+ | | colspan="2" | Position to move to. | ||
+ | |- | ||
+ | | 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'' | ||
+ | |} | ||
+ | |||
===DisableServo=== | ===DisableServo=== | ||
Line 76: | Line 102: | ||
− | === | + | ===EnableServo=== |
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| 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" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''EnableServo''' |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Enables a servo channel effectivly setting the position of the motor to the value in the local position variable. |
|- | |- | ||
|- | |- | ||
Line 90: | Line 116: | ||
| colspan="2" | The channel to set the position for. First channel is zero. | | colspan="2" | The channel to set the position for. First channel is zero. | ||
|- | |- | ||
− | | width="10%" align="center" | [[File:Fc9- | + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID |
− | | width="90%" | | + | | width="90%" style="border-top: 2px solid #000;" | ''Return'' |
+ | |} | ||
+ | |||
+ | |||
+ | ===Initialise=== | ||
+ | {| 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 | ||
|- | |- | ||
− | |||
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | ||
Line 138: | Line 173: | ||
− | === | + | ===SetAutoMoveSpeed=== |
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| 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" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetAutoMoveSpeed''' |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Sets the speed of the auto move to position macro. Default speed is 1. |
|- | |- | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
− | | width="90%" | | + | | width="90%" | Speed |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | 1=Slowest (Default), 2= Double, 3=Triple, 4=Quadruple |
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | ||
Line 162: | Line 192: | ||
− | === | + | ===SetPosition=== |
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| 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" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetPosition''' |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Moves directly to the specified position with no interpolation. |
|- | |- | ||
|- | |- | ||
Line 179: | Line 209: | ||
| width="90%" | Position | | width="90%" | Position | ||
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Target position to move towards. |
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | ||
Line 186: | Line 216: | ||
− | === | + | ===SetTrim=== |
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| 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" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetTrim''' |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Allows the level of trim for each servo channel to be adjusted progmatically. |
|- | |- | ||
|- | |- | ||
Line 199: | Line 229: | ||
|- | |- | ||
| colspan="2" | The channel to set the position for. First channel is zero. | | colspan="2" | The channel to set the position for. First channel is zero. | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
− | | width="90%" | | + | | width="90%" | Trim |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
+ | | colspan="2" | 0=0us, 1=+25us, 2=+50us, 3=+75us, 4=+100us, 5=-25us, 6=-50us, 7=-75us, 8=-100us | ||
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID |
Revision as of 12:00, 3 February 2023
Author | Matrix TSL |
Version | 1.0 |
Category | E-blocks 2 |
Contents
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_temp/EBlocks2_Servo_BL0162.fcfx
Please click here to view the component source code (Beta): FC_Comp_Source_temp/EBlocks2_Servo_BL0162.fcfx
Detailed description
No detailed description exists yet for this component
Examples
No additional examples
Macro reference
AutoMoveToPosition
DisableServo
![]() |
DisableServo |
Disables a servo channel effectivly disabling the motor. | |
![]() |
Channel |
The channel to set the position for. First channel is zero. | |
![]() |
Return |
EnableServo
Initialise
![]() |
Initialise |
Sets up the servo motor interrupts | |
![]() |
Return |
IsAutoMoving
![]() |
IsAutoMoving |
Is the AutoMoveToPosition movement complete. Returns 1 if the servo is still moving. Returns 0 if the servo movement is complete. | |
![]() |
Return |
MoveToPosition
SetAutoMoveSpeed
![]() |
SetAutoMoveSpeed |
Sets the speed of the auto move to position macro. Default speed is 1. | |
![]() |
Speed |
1=Slowest (Default), 2= Double, 3=Triple, 4=Quadruple | |
![]() |
Return |
SetPosition
SetTrim