Difference between revisions of "Component: Servo Motor Controller (Mechatronics)"
Line 5: | Line 5: | ||
|- | |- | ||
| width="20%" style="color:gray;" | Version | | width="20%" style="color:gray;" | Version | ||
− | | | + | | 8.8 |
|- | |- | ||
| width="20%" style="color:gray;" | Category | | width="20%" style="color:gray;" | Category | ||
Line 14: | Line 14: | ||
==Servo Motor Controller component== | ==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. | 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. | ||
+ | |||
+ | ==Version information== | ||
+ | |||
+ | Library Version, Component Version, Date, Author, Info | ||
+ | |||
==Detailed description== | ==Detailed description== | ||
Line 92: | Line 97: | ||
| 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 | + | | colspan="2" | Automatically moves towards the new position at a fixed rate determined by the AutoMoveSpeed. |
|- | |- | ||
|- | |- | ||
Line 116: | Line 121: | ||
| 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 | + | | colspan="2" | Automatically moves towards the new 16-bit position at a fixed rate determined by the AutoMoveSpeed. |
|- | |- | ||
|- | |- | ||
Line 287: | Line 292: | ||
|- | |- | ||
| 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-u8-icon.png]] - BYTE | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
Line 439: | Line 420: | ||
|- | |- | ||
| 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;" | | + | | 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. | ||
+ | |- | ||
+ | | 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. | ||
|- | |- | ||
− | | width="10%" align="center" | [[File:Fc9-type- | + | | width="10%" align="center" | [[File:Fc9-type-5-icon.png]] |
− | | width="90%" | | + | | width="90%" | Channel 2 |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Pin on which to output PWM for the servo motor. |
|- | |- | ||
− | | width="10%" align="center | + | | width="10%" align="center" | [[File:Fc9-type-5-icon.png]] |
− | | width="90% | + | | width="90%" | Channel 3 |
|- | |- | ||
+ | | colspan="2" | Pin on which to output PWM for the servo motor. | ||
|- | |- | ||
− | | width="10%" align="center" | [[File:Fc9-type- | + | | width="10%" align="center" | [[File:Fc9-type-5-icon.png]] |
− | | width="90%" | | + | | width="90%" | Channel 4 |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Pin on which to output PWM for the servo motor. |
|- | |- | ||
− | | width="10%" align="center" | [[File:Fc9-type- | + | | width="10%" align="center" | [[File:Fc9-type-5-icon.png]] |
− | | width="90%" | | + | | width="90%" | Channel 5 |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Pin on which to output PWM for the servo motor. |
|- | |- | ||
− | | width="10%" align="center | + | | width="10%" align="center" | [[File:Fc9-type-5-icon.png]] |
− | | width="90% | + | | width="90%" | Channel 6 |
|- | |- | ||
+ | | colspan="2" | Pin on which to output PWM for the servo motor. | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]] | | width="10%" align="center" | [[File:Fc9-type-5-icon.png]] | ||
− | | width="90%" | Channel | + | | width="90%" | Channel 7 |
|- | |- | ||
| colspan="2" | Pin on which to output PWM for the servo motor. | | colspan="2" | Pin on which to output PWM for the servo motor. | ||
|- | |- | ||
| 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;" | | + | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Resources |
|- | |- | ||
|- | |- | ||
− | | width="10%" align="center" | [[File:Fc9-type- | + | | width="10%" align="center" | [[File:Fc9-type-10-icon.png]] |
− | | width="90%" | | + | | width="90%" | Peripherals |
|- | |- | ||
− | | colspan="2" | | + | | 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. |
|- | |- | ||
| 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 490: | Line 483: | ||
| 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. | ||
+ | |- | ||
+ | | 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. | ||
+ | |- | ||
+ | | 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. | ||
+ | |- | ||
+ | | 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. | ||
+ | |- | ||
+ | | 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. | ||
+ | |- | ||
+ | | 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. | ||
+ | |- | ||
+ | | 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. | ||
+ | |- | ||
+ | | 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. | | 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. | ||
+ | |- | ||
+ | | 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. | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]] | ||
+ | | width="90%" | Maximum (us) | ||
+ | |- | ||
+ | | colspan="2" | Longest pulse width used for the PWM signals. | ||
+ | |- | ||
+ | | 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. | ||
|- | |- | ||
| 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 499: | Line 546: | ||
| 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)). | ||
+ | |- | ||
+ | | 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)). | ||
+ | |- | ||
+ | | 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)). | ||
+ | |- | ||
+ | | 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)). | ||
+ | |- | ||
+ | | 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)). | ||
+ | |- | ||
+ | | 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)). | ||
+ | |- | ||
+ | | 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)). | ||
+ | |- | ||
+ | | 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)). | | 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)). |
Latest revision as of 08:59, 9 June 2025
Author | Matrix Ltd |
Version | 8.8 |
Category | Mechatronics |
Contents
- 1 Servo Motor Controller component
- 2 Version information
- 3 Detailed description
- 4 Examples
- 5 Macro reference
- 5.1 AutoMoveToAngle
- 5.2 AutoMoveToPosition
- 5.3 AutoMoveToPositionInt
- 5.4 DisableServo
- 5.5 EnableServo
- 5.6 Initialise
- 5.7 IsAutoMoving
- 5.8 IsServoAutoMoving
- 5.9 MoveToAngle
- 5.10 MoveToPosition
- 5.11 MoveToPositionInt
- 5.12 SetAutoMoveSpeed
- 5.13 SetAutoMoveSpeedInt
- 5.14 SetPosition
- 5.15 SetPositionInt
- 5.16 SetTrim
- 6 Property reference
- 7 Component Source Code
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.
Version information
Library Version, Component Version, Date, Author, Info
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
AutoMoveToAngle
AutoMoveToPosition
AutoMoveToPositionInt
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 servos are still moving. Returns 0 if all servo movement is complete. | |
![]() |
Return |
IsServoAutoMoving
MoveToAngle
MoveToPosition
MoveToPositionInt
SetAutoMoveSpeed
SetAutoMoveSpeedInt
SetPosition
SetPositionInt
SetTrim
Property reference
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