Difference between revisions of "Component: Servo Motor Controller (Mechatronics)"
| Line 43: | Line 43: | ||
| − | Example showing how to control three servos using AutoMoveToPosion, MoveTopposition & | + | 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> | ||
| − | {{Fcfile| | + | Example using BL0162 Servo controller for BL0055 Arduino Shield<br> |
| + | Samples the Port D0-D7 switches and moves the servo motors based on the input states.<br> | ||
| + | D0 increments motor 0, D1 decrements motor 0.<br> | ||
| + | D2 increments motor 1, D3 decrements motor 1.<br> | ||
| + | Connections: Combo Board Ports A0-A5&D0-D7 / Servo Board Port D8-D13.<br> | ||
| + | {{Fcfile|BL0162_Servo.fcfx|BL0162 Servos Example.fcfx}}<br> | ||
==Macro reference== | ==Macro reference== | ||
Revision as of 08:28, 15 October 2024
| Author | Matrix Ltd |
| Version | 2.1 |
| Category | Mechatronics |
Contents
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.
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
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 D0-D7 switches and moves the servo motors based on the input states.
D0 increments motor 0, D1 decrements motor 0.
D2 increments motor 1, D3 decrements motor 1.
Connections: Combo Board Ports A0-A5&D0-D7 / Servo Board Port D8-D13.
BL0162 Servos Example.fcfx
Macro reference
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
MoveToPosition
MoveToPositionInt
SetAutoMoveSpeed
SetAutoMoveSpeedInt
SetPosition
SetPositionInt
SetTrim