Jump to content

Component: Actuators (BL0127) (E-blocks 2)

From Flowcode Help
Author Matrix TSL
Version 1.0
Category E-blocks 2


Actuators component

The Actuators board allows for investigation into several different motor types. Included on the board is a DC motor with both analogue and digital feedback, a servo motor and a stepper motor plus the circuitry to drive the motors.

Version information

Library Version, Component Version, Date, Author, Info
4, 1.0, 08-05-25, BR, Added autodetect port on Ev_PostInitialise


Detailed description

No detailed description exists yet for this component

Examples

Demo program using the Eblocks 2 Actuators Board BL0127 connected to BL0011 PIC programmer BL0127 Actuators Demo for PIC


Macro reference

DCMotor_Break

DCMotor_Break
Actively drives both ends of the motor by setting the pins according to the 'Brake Pattern' property. 
- VOID Return


DCMotor_Coast

DCMotor_Coast
Turn off power to the motor by setting the pins according to the 'Coast Pattern' property. 
- VOID Return


DCMotor_DC_Feedback

DCMotor_DC_Feedback
 
- BYTE Return


DCMotor_DC_FeedbackSim

DCMotor_DC_FeedbackSim
 
- BYTE Return


DCMotor_Disable

DCMotor_Disable
Disable the motor output 
- VOID Return


DCMotor_Enable

DCMotor_Enable
Enables the motor output 
- VOID Return


DCMotor_Forwards

DCMotor_Forwards
Set the motor turning in the forwards direction by setting the pins according to the 'Forwards Pattern' property. 
- UINT Duty
Sets the motor power for PWM or H-Bridge outputs 
- VOID Return


DCMotor_Reverse

DCMotor_Reverse
Set the motor turning in the reverse direction by setting the pins according to the 'Reverse Pattern' property. 
- UINT Duty
Sets the motor power for PWM or H-Bridge outputs 
- VOID Return


Servo_AutoMoveToPosition

Servo_AutoMoveToPosition
Automatically moves towards the new position at a fixed rate determined by the AutoMoveSpeed. 
- BYTE Channel
The channel to assign the new position. Range: 0-7 
- BYTE Position
Position to automatically move to. Range: 0-255 
- VOID Return


Servo_AutoMoveToPositionInt

Servo_AutoMoveToPositionInt
Automatically moves towards the new 16-bit position at a fixed rate determined by the AutoMoveSpeed. 
- BYTE Channel
The channel to assign the new position. Range: 0-7 
- UINT Position
Position to automatically move to. Range: 0-65535 
- VOID Return


Servo_DisableServo

Servo_DisableServo
Disables a servo channel effectivly disabling the motor. 
- BYTE Channel
The channel to set the position for. First channel is zero. 
- VOID Return


Servo_EnableServo

Servo_EnableServo
Enables a servo channel effectivly setting the position of the motor to the value in the local position variable. 
- BYTE Channel
The channel to set the position for. First channel is zero. 
- VOID Return


Servo_Initialise

Servo_Initialise
Sets up the servo motor interrupts 
- VOID Return


Servo_IsAutoMoving

Servo_IsAutoMoving
Is the AutoMoveToPosition movement complete. Returns 1 if the servos are still moving. Returns 0 if all servo movement is complete. 
- BYTE Return


Servo_IsServoAutoMoving

Servo_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. 
- BYTE Channel
Servo Motor Output Range: 0-7 
- BYTE Return


Servo_MoveToPosition

Servo_MoveToPosition
Moves a single step towards the new position, the rate of movement is determined by how often the move to macro is called. Returns 1 if the position has been reached. 
- BYTE Channel
The channel to assign the new position. Range: 0-7 
- BYTE Position
Target position to move towards. Range: 0-255 
- BYTE Return


Servo_MoveToPositionInt

Servo_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. 
- BYTE Channel
The channel to assign the new position. Range: 0-7 
- UINT Position
Target position to move towards. Range: 0-65535 
- BYTE Return


Servo_SetAutoMoveSpeed

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


Servo_SetAutoMoveSpeedInt

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


Servo_SetPosition

Servo_SetPosition
Moves directly to the specified position with no interpolation.  
- BYTE Channel
The channel to assign the new position. Range: 0-7 
- BYTE Position
Position to jump to. Range: 0-255 
- VOID Return


Servo_SetPositionInt

Servo_SetPositionInt
Moves directly to the specified position with no interpolation. Uses a 16-bit position parameter to add extra precision. 
- BYTE Channel
The channel to assign the new position. Range: 0-7 
- UINT Position
Position to jump to. Range: 0-65535 
- VOID Return


Servo_SetTrim

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


Stepper_DecrementStep

Stepper_DecrementStep
Move the motor backwards by one step. 
- VOID Return


Stepper_DisableMotor

Stepper_DisableMotor
Turn off the motor. It will no longer respond to any other macros. 
- VOID Return


Stepper_EnableMotor

Stepper_EnableMotor
Turn on the motor. This must be done before it will respond to any other macros. 
- VOID Return


Stepper_IncrementStep

Stepper_IncrementStep
Move the motor forward by one step. 
- VOID Return


Property reference

Properties
Connection Type
 
DC Feedback type
Select if the feedback is a digital or analogue value. Note, if using an Arduino shield and port D is selected, then only digital type will be available.  
Connections
Port
Port C is not available on the Arduino shield, If port C is slected, it will default to port B. 
Servo
Trim
Pulse Width
Minimum (us)
Shortest pulse width that will be used in microseconds. 
Maximum (us)
Longest pulse width used for the PWM signals in microseconds.. 
Period Multiplier
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. 

Component Source Code

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

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