Difference between revisions of "Component: Servo Motor Controller (Mechatronics)"

From Flowcode Help
Jump to navigationJump to search
 
(15 intermediate revisions by 2 users not shown)
Line 15: Line 15:
 
Can control up to eight standard PWM driven servo's.  Supports 8-bit and 16-bit movement resolutions. 'Servo Object' properties allow you to connect the controller to on-screen simulations using the "Servo Motor" component and its derivatives.  
 
Can control up to eight standard PWM driven servo's.  Supports 8-bit and 16-bit movement resolutions. 'Servo Object' properties allow you to connect the controller to on-screen simulations using the "Servo Motor" component and its derivatives.  
  
==Component Source Code==
+
==Detailed description==
 +
 
  
Please click here to download the component source project: [https://www.flowcode.co.uk/wikicopy/componentsource/FC_Comp_Source_Servo_Controller.fcfx FC_Comp_Source_Servo_Controller.fcfx]
 
  
Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_Servo_Controller.fcfx FC_Comp_Source_Servo_Controller.fcfx]
 
  
==Detailed description==
 
  
  
Line 39: Line 37:
  
  
''<span style="color:red;">No additional examples</span>''
+
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>
  
==Macro reference==
+
Example using BL0162 Servo controller for BL0055 Arduino Shield
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
+
Samples the Port D8-D13 (portB) switches and moves the servo motors based on the input states.  
|-
 
| 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''
 
|}
 
  
 +
D8 increments motor 0, D9 decrements motor on channel 0.
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
+
D10 increments motor 1, D11 decrements motor on channel 1.
|-
 
| 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 assign the new position. Range: 0-7&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Position
 
|-
 
| colspan="2" | Position to jump to. Range: 0-255&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''
 
|}
 
  
 +
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;" | '''MoveToPositionInt'''
 
|-
 
| 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 assign the new position. Range: 0-7&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 
| width="90%" | Position
 
|-
 
| colspan="2" | Target position to move towards. Range: 0-65535&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''
 
|}
 
  
 +
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;" | '''SetPositionInt'''
 
|-
 
| colspan="2" | Moves directly to the specified position with no interpolation. Uses a 16-bit position parameter to add extra precision.&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Channel
 
|-
 
| colspan="2" | The channel to assign the new position. Range: 0-7&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 
| width="90%" | Position
 
|-
 
| colspan="2" | Position to jump to. Range: 0-65535&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;" | '''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 assign the new position. Range: 0-7&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Position
 
|-
 
| colspan="2" | Target position to move towards. Range: 0-255&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==
  
 +
===AutoMoveToAngle===
 
{| 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;" | '''SetTrim'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''AutoMoveToAngle'''
 
|-
 
|-
| colspan="2" | Allows the level of trim for each servo channel to be adjusted progmatically.&nbsp;
+
| colspan="2" | Automatically moves towards the new angle at a fixed rate determined by the AutoMoveSpeed. AutoMove not currently supported by ESP32.&nbsp;
 
|-
 
|-
 
|-
 
|-
Line 164: Line 74:
 
| width="90%" | Channel
 
| width="90%" | Channel
 
|-
 
|-
| colspan="2" | The channel to set the position for.  First channel is zero.&nbsp;
+
| colspan="2" | The channel to assign the new position. Range: 0-7&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Trim
+
| width="90%" | Angle
 
|-
 
|-
| colspan="2" | Legacy: 0=0us, 1=+25us, 2=+50us, 3=+75us, 4=+100us, 5=-25us, 6=-50us, 7=-75us, 8=-100us or Smooth: 0-200&nbsp;
+
| colspan="2" | Angle in degrees, Range 0 to calibration angle&nbsp;
 
|-
 
|-
 
| 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 176: Line 86:
  
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
+
===AutoMoveToPosition===
|-
 
| 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 servos are still moving.  Returns 0 if all 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;" | '''SetAutoMoveSpeedInt'''
 
|-
 
| colspan="2" | Sets the speed of the auto move to position macro.  Default speed is shown in the Servo_Period_Multiplier property.&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 
| 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;" | '''IsServoAutoMoving'''
 
|-
 
| colspan="2" | Is the AutoMoveToPosition movement complete for a specific servo output.  Returns 1 if the servo is still moving.  Returns 0 if the servo movement is complete.&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Channel
 
|-
 
| colspan="2" | Servo Motor Output Range: 0-7&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;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
Line 230: Line 92:
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''AutoMoveToPosition'''
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''AutoMoveToPosition'''
 
|-
 
|-
| colspan="2" | Automatically moves towards the new position at a fixed rate determined by the AutoMoveSpeed.&nbsp;
+
| colspan="2" | Automatically moves towards the new position at a fixed rate determined by the AutoMoveSpeed. AutoMove not currently supported by ESP32.&nbsp;
 
|-
 
|-
 
|-
 
|-
Line 248: Line 110:
  
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
+
===AutoMoveToPositionInt===
|-
 
| 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 shown in the Servo_Period_Multiplier property.&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;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
Line 289: Line 116:
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''AutoMoveToPositionInt'''
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''AutoMoveToPositionInt'''
 
|-
 
|-
| colspan="2" | Automatically moves towards the new 16-bit position at a fixed rate determined by the AutoMoveSpeed.&nbsp;
+
| colspan="2" | Automatically moves towards the new 16-bit position at a fixed rate determined by the AutoMoveSpeed. AutoMove not currently supported by ESP32.&nbsp;
 
|-
 
|-
 
|-
 
|-
Line 307: Line 134:
  
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
+
===DisableServo===
|-
 
| 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;" | Resources
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-10-icon.png]]
 
| width="90%" | Peripherals
 
|-
 
| colspan="2" | Lists the internal peripherals of the MCU used by the component. When the servo motor is initialised you will not be able to use the listed peripherals for other functionality.&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 Mode
 
|-
 
| colspan="2" | &nbsp;
 
|-
 
| 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;" | 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" | [[File:Fc9-type-21-icon.png]]
 
| width="90%" | Period Multiplier
 
|-
 
| colspan="2" | Number of instructions for 1 / 256th of the positional accuracy. This sets the default movement speed to maintain legacy move speeds. Also sets the multiplication factor to convert from a byte 0-255 to a clocked position value.&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-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;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
Line 519: Line 153:
  
  
 +
===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;" | '''SetPosition'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''EnableServo'''
 
|-
 
|-
| colspan="2" | Moves directly to the specified position with no interpolation. &nbsp;
+
| colspan="2" | Enables a servo channel effectivly setting the position of the motor to the value in the local position variable.&nbsp;
 
|-
 
|-
 
|-
 
|-
Line 530: Line 165:
 
| width="90%" | Channel
 
| width="90%" | Channel
 
|-
 
|-
| colspan="2" | The channel to assign the new position. Range: 0-7&nbsp;
+
| 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 jump to. Range: 0-255&nbsp;
 
 
|-
 
|-
 
| 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 542: Line 172:
  
  
 +
===Initialise===
 
{| 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;" | '''MoveToPositionInt'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise'''
 
|-
 
|-
| 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" | Sets up the servo motor interrupts&nbsp;
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Channel
 
|-
 
| colspan="2" | The channel to assign the new position. Range: 0-7&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 
| width="90%" | Position
 
|-
 
| colspan="2" | Target position to move towards. Range: 0-65535&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;" | '''SetPositionInt'''
 
|-
 
| colspan="2" | Moves directly to the specified position with no interpolation. Uses a 16-bit position parameter to add extra precision.&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Channel
 
|-
 
| colspan="2" | The channel to assign the new position. Range: 0-7&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 
| width="90%" | Position
 
 
|-
 
|-
| colspan="2" | Position to jump to. Range: 0-65535&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;" | '''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 assign the new position. Range: 0-7&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Position
 
|-
 
| colspan="2" | Target position to move towards. Range: 0-255&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" | Legacy: 0=0us, 1=+25us, 2=+50us, 3=+75us, 4=+100us, 5=-25us, 6=-50us, 7=-75us, 8=-100us or Smooth: 0-200&nbsp;
 
 
|-
 
|-
 
| 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 634: Line 186:
  
  
 +
===IsAutoMoving===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
Line 647: Line 200:
  
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
+
===IsServoAutoMoving===
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetAutoMoveSpeedInt'''
 
|-
 
| colspan="2" | Sets the speed of the auto move to position macro.  Default speed is shown in the Servo_Period_Multiplier property.&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 
| 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;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
Line 683: Line 219:
  
  
 +
===MoveToAngle===
 
{| 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;" | '''AutoMoveToPosition'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''MoveToAngle'''
 
|-
 
|-
| colspan="2" | Automatically moves towards the new position at a fixed rate determined by the AutoMoveSpeed.&nbsp;
+
| colspan="2" | Moves a single step towards the new angle, 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 697: Line 234:
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Position
+
| width="90%" | Angle
 
|-
 
|-
| colspan="2" | Position to automatically move to. Range: 0-255&nbsp;
+
| colspan="2" | Angle in degrees, Range 0 to calibration angle&nbsp;
 
|-
 
|-
| 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-bool-icon.png]] - BOOL
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
  
  
 +
===MoveToPosition===
 
{| 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;" | '''EnableServo'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''MoveToPosition'''
 
|-
 
|-
| colspan="2" | Enables a servo channel effectivly setting the position of the motor to the value in the local position variable.&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 calledReturns 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" 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 shown in the Servo_Period_Multiplier property.&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;" | '''AutoMoveToPositionInt'''
 
|-
 
| colspan="2" | Automatically moves towards the new 16-bit position at a fixed rate determined by the AutoMoveSpeed.&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Channel
 
|-
 
| colspan="2" | The channel to assign the new position. Range: 0-7&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 
| width="90%" | Position
 
|-
 
| colspan="2" | Position to automatically move to. Range: 0-65535&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;" | Resources
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-10-icon.png]]
 
| width="90%" | Peripherals
 
|-
 
| colspan="2" | Lists the internal peripherals of the MCU used by the component. When the servo motor is initialised you will not be able to use the listed peripherals for other functionality.&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 Mode
 
|-
 
| colspan="2" | &nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
| width="90%" | Trim 0
 
|-
 
| colspan="2" | Trim the pulse width for this channelUse 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;" | 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" | [[File:Fc9-type-21-icon.png]]
 
| width="90%" | Period Multiplier
 
|-
 
| colspan="2" | Number of instructions for 1 / 256th of the positional accuracy. This sets the default movement speed to maintain legacy move speeds. Also sets the multiplication factor to convert from a byte 0-255 to a clocked position value.&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-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;
 
 
|-
 
|-
 
|-
 
|-
Line 993: Line 260:
 
| width="90%" | Position
 
| width="90%" | Position
 
|-
 
|-
| colspan="2" | Position to jump to. Range: 0-255&nbsp;
+
| colspan="2" | Target position to move towards. Range: 0-255&nbsp;
 
|-
 
|-
| 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-u8-icon.png]] - BYTE
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
  
  
 +
===MoveToPositionInt===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
Line 1,023: Line 291:
  
  
 +
===SetAngle===
 
{| 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;" | '''SetPositionInt'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetAngle'''
|-
 
| colspan="2" | Moves directly to the specified position with no interpolation. Uses a 16-bit position parameter to add extra precision.&nbsp;
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Channel
 
|-
 
| colspan="2" | The channel to assign the new position. Range: 0-7&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 
| width="90%" | Position
 
|-
 
| colspan="2" | Position to jump to. Range: 0-65535&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;" | '''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 the motor straight to the specified angle. Uses the angle property to calculate the correct amount to move.&nbsp;
 
|-
 
|-
 
|-
 
|-
Line 1,060: Line 306:
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Position
+
| width="90%" | Angle
 
|-
 
|-
| colspan="2" | Target position to move towards. Range: 0-255&nbsp;
+
| colspan="2" | Angle in degrees, Range 0 to calibration angle&nbsp;
 
|-
 
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
+
| 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''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
  
  
 +
===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;" | '''SetTrim'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetAutoMoveSpeed'''
 
|-
 
|-
| colspan="2" | Allows the level of trim for each servo channel to be adjusted progmatically.&nbsp;
+
| colspan="2" | Sets the speed of the auto move to position macro.  Default speed is shown in the Servo_Period_Multiplier property.&nbsp;
 
|-
 
|-
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Channel
+
| width="90%" | Speed
 
|-
 
|-
| colspan="2" | The channel to set the position for.  First channel is zero.&nbsp;
+
| colspan="2" | 1=Slowest (Default), 2= Double, 3=Triple, 4=Quadruple&nbsp;
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Trim
 
|-
 
| colspan="2" | Legacy: 0=0us, 1=+25us, 2=+50us, 3=+75us, 4=+100us, 5=-25us, 6=-50us, 7=-75us, 8=-100us or Smooth: 0-200&nbsp;
 
 
|-
 
|-
 
| 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 1,092: Line 334:
  
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
+
===SetAutoMoveSpeedInt===
|-
 
| 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 servos are still moving.  Returns 0 if all 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;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
Line 1,123: Line 353:
  
  
 +
===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;" | '''IsServoAutoMoving'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetPosition'''
 
|-
 
|-
| colspan="2" | Is the AutoMoveToPosition movement complete for a specific servo output.  Returns 1 if the servo is still moving.  Returns 0 if the servo movement is complete.&nbsp;
+
| 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" | Servo Motor Output Range: 0-7&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;" | '''AutoMoveToPosition'''
 
|-
 
| colspan="2" | Automatically moves towards the new position at a fixed rate determined by the AutoMoveSpeed.&nbsp;
 
 
|-
 
|-
 
|-
 
|-
Line 1,157: Line 370:
 
| width="90%" | Position
 
| width="90%" | Position
 
|-
 
|-
| colspan="2" | Position to automatically move to. Range: 0-255&nbsp;
+
| colspan="2" | Position to jump to. Range: 0-255&nbsp;
 
|-
 
|-
 
| 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 1,164: Line 377:
  
  
 +
===SetPositionInt===
 
{| 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;" | '''EnableServo'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetPositionInt'''
 
|-
 
|-
| colspan="2" | Enables a servo channel effectivly setting the position of the motor to the value in the local position variable.&nbsp;
+
| colspan="2" | Moves directly to the specified position with no interpolation. Uses a 16-bit position parameter to add extra precision.&nbsp;
 
|-
 
|-
 
|-
 
|-
Line 1,175: Line 389:
 
| width="90%" | Channel
 
| width="90%" | Channel
 
|-
 
|-
| colspan="2" | The channel to set the position for.  First channel is zero.&nbsp;
+
| colspan="2" | The channel to assign the new position. Range: 0-7&nbsp;
 
|-
 
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
+
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" style="border-top: 2px solid #000;" | ''Return''
+
| width="90%" | Position
|}
 
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
 
|-
 
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
+
| colspan="2" | Position to jump to. Range: 0-65535&nbsp;
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetAutoMoveSpeed'''
 
|-
 
| colspan="2" | Sets the speed of the auto move to position macro. Default speed is shown in the Servo_Period_Multiplier property.&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="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
Line 1,200: Line 401:
  
  
 +
===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;" | '''AutoMoveToPositionInt'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetTrim'''
 
|-
 
|-
| colspan="2" | Automatically moves towards the new 16-bit position at a fixed rate determined by the AutoMoveSpeed.&nbsp;
+
| colspan="2" | Allows the level of trim for each servo channel to be adjusted progmatically.&nbsp;
 
|-
 
|-
 
|-
 
|-
Line 1,211: Line 413:
 
| width="90%" | Channel
 
| width="90%" | Channel
 
|-
 
|-
| colspan="2" | The channel to assign the new position. Range: 0-7&nbsp;
+
| colspan="2" | The channel to set the position for.  First channel is zero.&nbsp;
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
+
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Position
+
| width="90%" | Trim
|-
 
| colspan="2" | Position to automatically move to. Range: 0-65535&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" | Legacy: 0=0us, 1=+25us, 2=+50us, 3=+75us, 4=+100us, 5=-25us, 6=-50us, 7=-75us, 8=-100us or Smooth: 0-200&nbsp;
 
|-
 
|-
 
| 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
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
 
 
  
  
Line 1,252: Line 439:
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
 
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Connections
+
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Resources
 
|-
 
|-
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
+
| width="10%" align="center" | [[File:Fc9-type-10-icon.png]]
| width="90%" | Channel 0
+
| width="90%" | Peripherals
 
|-
 
|-
| colspan="2" | Pin on which to output PWM for the servo motor.&nbsp;
+
| colspan="2" | Lists the internal peripherals of the MCU used by the component. When the servo motor is initialised you will not be able to use the listed peripherals for other functionality.&nbsp;
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
+
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="90%" | Channel 1
+
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Pulse Width
 
|-
 
|-
| 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" | [[File:Fc9-type-21-icon.png]]
| width="90%" | Channel 2
+
| width="90%" | Minimum (us)
 
|-
 
|-
| colspan="2" | Pin on which to output PWM for the servo motor.&nbsp;
+
| colspan="2" | Shortest pulse width that will be used.&nbsp;
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
+
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| width="90%" | Channel 3
+
| width="90%" | Maximum (us)
 
|-
 
|-
| colspan="2" | Pin on which to output PWM for the servo motor.&nbsp;
+
| colspan="2" | Longest pulse width used for the PWM signals.&nbsp;
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
+
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="90%" | Channel 4
+
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Connections
|-
 
| 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="10%" align="center" | [[File:Fc9-type-5-icon.png]]
| width="90%" | Channel 6
+
| 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 7
 
 
|-
 
|-
 
| 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" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Resources
+
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Angle
 
|-
 
|-
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-type-10-icon.png]]
+
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| width="90%" | Peripherals
+
| width="90%" | Angle 0
 
|-
 
|-
| colspan="2" | Lists the internal peripherals of the MCU used by the component. When the servo motor is initialised you will not be able to use the listed peripherals for other functionality.&nbsp;
+
| colspan="2" | Range of movement in the servo motor to calibrate the Angle component macros. Can be found by measuring the angle between position 0 and position 255.&nbsp;
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
 
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
Line 1,315: Line 490:
 
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
| width="90%" | Trim 0
 
| 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;
 
| 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;" | 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" | [[File:Fc9-type-21-icon.png]]
 
| width="90%" | Period Multiplier
 
|-
 
| colspan="2" | Number of instructions for 1 / 256th of the positional accuracy. This sets the default movement speed to maintain legacy move speeds. Also sets the multiplication factor to convert from a byte 0-255 to a clocked position value.&nbsp;
 
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
 
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
Line 1,378: Line 499:
 
| width="10%" align="center" | [[File:Fc9-type-17-icon.png]]
 
| width="10%" align="center" | [[File:Fc9-type-17-icon.png]]
 
| width="90%" | Servo Object 0
 
| 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;
 
| 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;
 
|}
 
|}
 +
 +
==Component Source Code==
 +
 +
Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_Servo_Controller.fcfx FC_Comp_Source_Servo_Controller.fcfx]
 +
 +
Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_Servo_Controller.fcfx FC_Comp_Source_Servo_Controller.fcfx]

Latest revision as of 11:10, 29 January 2025

Author Matrix Ltd
Version 2.1
Category Mechatronics


Servo Motor Controller component

Can control up to eight standard PWM driven servo's. Supports 8-bit and 16-bit movement resolutions. 'Servo Object' properties allow you to connect the controller to on-screen simulations using the "Servo Motor" component and its derivatives.

Detailed description

No detailed description exists yet for this component

Examples

Example showing how to control three servos using AutoMoveToPosion, MoveTopposition & SetPosition component macros.
FC6 Icon.png 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)

FC6 Icon.png BL0162 Servos Example for BL0055

Macro reference

AutoMoveToAngle

Fc9-comp-macro.png AutoMoveToAngle
Automatically moves towards the new angle at a fixed rate determined by the AutoMoveSpeed. AutoMove not currently supported by ESP32. 
Fc9-u8-icon.png - BYTE Channel
The channel to assign the new position. Range: 0-7 
Fc9-u8-icon.png - BYTE Angle
Angle in degrees, Range 0 to calibration angle 
Fc9-void-icon.png - VOID Return


AutoMoveToPosition

Fc9-comp-macro.png AutoMoveToPosition
Automatically moves towards the new position at a fixed rate determined by the AutoMoveSpeed. AutoMove not currently supported by ESP32. 
Fc9-u8-icon.png - BYTE Channel
The channel to assign the new position. Range: 0-7 
Fc9-u8-icon.png - BYTE Position
Position to automatically move to. Range: 0-255 
Fc9-void-icon.png - VOID Return


AutoMoveToPositionInt

Fc9-comp-macro.png AutoMoveToPositionInt
Automatically moves towards the new 16-bit position at a fixed rate determined by the AutoMoveSpeed. AutoMove not currently supported by ESP32. 
Fc9-u8-icon.png - BYTE Channel
The channel to assign the new position. Range: 0-7 
Fc9-u16-icon.png - UINT Position
Position to automatically move to. Range: 0-65535 
Fc9-void-icon.png - VOID Return


DisableServo

Fc9-comp-macro.png DisableServo
Disables a servo channel effectivly disabling the motor. 
Fc9-u8-icon.png - BYTE Channel
The channel to set the position for. First channel is zero. 
Fc9-void-icon.png - VOID Return


EnableServo

Fc9-comp-macro.png EnableServo
Enables a servo channel effectivly setting the position of the motor to the value in the local position variable. 
Fc9-u8-icon.png - BYTE Channel
The channel to set the position for. First channel is zero. 
Fc9-void-icon.png - VOID Return


Initialise

Fc9-comp-macro.png Initialise
Sets up the servo motor interrupts 
Fc9-void-icon.png - VOID Return


IsAutoMoving

Fc9-comp-macro.png IsAutoMoving
Is the AutoMoveToPosition movement complete. Returns 1 if the servos are still moving. Returns 0 if all servo movement is complete. 
Fc9-u8-icon.png - BYTE Return


IsServoAutoMoving

Fc9-comp-macro.png IsServoAutoMoving
Is the AutoMoveToPosition movement complete for a specific servo output. Returns 1 if the servo is still moving. Returns 0 if the servo movement is complete. 
Fc9-u8-icon.png - BYTE Channel
Servo Motor Output Range: 0-7 
Fc9-u8-icon.png - BYTE Return


MoveToAngle

Fc9-comp-macro.png MoveToAngle
Moves a single step towards the new angle, the rate of movement is determined by how often the move to macro is called. Returns 1 if the position has been reached. 
Fc9-u8-icon.png - BYTE Channel
The channel to assign the new position. Range: 0-7 
Fc9-u8-icon.png - BYTE Angle
Angle in degrees, Range 0 to calibration angle 
Fc9-bool-icon.png - BOOL Return


MoveToPosition

Fc9-comp-macro.png 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. 
Fc9-u8-icon.png - BYTE Channel
The channel to assign the new position. Range: 0-7 
Fc9-u8-icon.png - BYTE Position
Target position to move towards. Range: 0-255 
Fc9-u8-icon.png - BYTE Return


MoveToPositionInt

Fc9-comp-macro.png MoveToPositionInt
Moves a single step towards the new position, the rate of movement is determined by how often the move to macro is called. Returns 1 if the position has been reached. 
Fc9-u8-icon.png - BYTE Channel
The channel to assign the new position. Range: 0-7 
Fc9-u16-icon.png - UINT Position
Target position to move towards. Range: 0-65535 
Fc9-u8-icon.png - BYTE Return


SetAngle

Fc9-comp-macro.png SetAngle
Moves the motor straight to the specified angle. Uses the angle property to calculate the correct amount to move. 
Fc9-u8-icon.png - BYTE Channel
The channel to assign the new position. Range: 0-7 
Fc9-u8-icon.png - BYTE Angle
Angle in degrees, Range 0 to calibration angle 
Fc9-void-icon.png - VOID Return


SetAutoMoveSpeed

Fc9-comp-macro.png SetAutoMoveSpeed
Sets the speed of the auto move to position macro. Default speed is shown in the Servo_Period_Multiplier property. 
Fc9-u8-icon.png - BYTE Speed
1=Slowest (Default), 2= Double, 3=Triple, 4=Quadruple 
Fc9-void-icon.png - VOID Return


SetAutoMoveSpeedInt

Fc9-comp-macro.png SetAutoMoveSpeedInt
Sets the speed of the auto move to position macro. Default speed is shown in the Servo_Period_Multiplier property. 
Fc9-u16-icon.png - UINT Speed
1=Slowest (Default), 2= Double, 3=Triple, 4=Quadruple 
Fc9-void-icon.png - VOID Return


SetPosition

Fc9-comp-macro.png SetPosition
Moves directly to the specified position with no interpolation.  
Fc9-u8-icon.png - BYTE Channel
The channel to assign the new position. Range: 0-7 
Fc9-u8-icon.png - BYTE Position
Position to jump to. Range: 0-255 
Fc9-void-icon.png - VOID Return


SetPositionInt

Fc9-comp-macro.png SetPositionInt
Moves directly to the specified position with no interpolation. Uses a 16-bit position parameter to add extra precision. 
Fc9-u8-icon.png - BYTE Channel
The channel to assign the new position. Range: 0-7 
Fc9-u16-icon.png - UINT Position
Position to jump to. Range: 0-65535 
Fc9-void-icon.png - VOID Return


SetTrim

Fc9-comp-macro.png SetTrim
Allows the level of trim for each servo channel to be adjusted progmatically. 
Fc9-u8-icon.png - BYTE Channel
The channel to set the position for. First channel is zero. 
Fc9-u8-icon.png - BYTE Trim
Legacy: 0=0us, 1=+25us, 2=+50us, 3=+75us, 4=+100us, 5=-25us, 6=-50us, 7=-75us, 8=-100us or Smooth: 0-200 
Fc9-void-icon.png - VOID Return


Property reference

Fc9-prop-icon.png Properties
Fc9-type-16-icon.png Channels (1 - 8)
Set the number of servo's that you need to control. Value from 1 to 8. 
Fc9-conn-icon.png Resources
Fc9-type-10-icon.png Peripherals
Lists the internal peripherals of the MCU used by the component. When the servo motor is initialised you will not be able to use the listed peripherals for other functionality. 
Fc9-conn-icon.png Pulse Width
Fc9-type-21-icon.png Minimum (us)
Shortest pulse width that will be used. 
Fc9-type-21-icon.png Maximum (us)
Longest pulse width used for the PWM signals. 
Fc9-conn-icon.png Connections
Fc9-type-5-icon.png Channel 0
Pin on which to output PWM for the servo motor. 
Fc9-conn-icon.png Angle
Fc9-type-21-icon.png Angle 0
Range of movement in the servo motor to calibrate the Angle component macros. Can be found by measuring the angle between position 0 and position 255. 
Fc9-conn-icon.png Trim
Fc9-type-16-icon.png Trim Mode
 
Fc9-type-16-icon.png 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. 
Fc9-conn-icon.png Simulation
Fc9-type-17-icon.png 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)). 

Component Source Code

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

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