Component: Robot Arm v2 (AllCode)

From Flowcode Help
Revision as of 09:11, 12 October 2020 by BenR (talk | contribs) (XML import)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search


Author Matrix TSL
Version 1.0 (Release)
Category AllCode


Image Robot Arm v2 component

Drives the Matrix Robot Arm v2 hardware via the AllCode API. Allows connections via USB, Bluetooth and WIFI.

Examples

No additional examples


Downloadable macro reference

WhileMoving

Blocking call that waits up to 10 seconds for the current movement operation to complete.

Returns when complete.

Return of 1 indicates movement complete, 0 indicates timeout.

Parameters

This macro has no parameters


Return value

BOOL : Returns true if the operation is a success, else false


Simulation macro reference

SetWIFIPort

Sets the WIFI port number

Parameters

UINT Port
Default 1245


Return value

This call does not return a value


SetWIFIPassword

Configures the WIFI Password string and stores into the none volatie memory onboard the robot arm.

Call the SetWifiMode macro after this to action the change.

Parameters

<- STRING Password
Password String, Max 32 Characters
This parameter may be returned back to the caller


Return value

This call does not return a value


SetCalibrationLengths

Sets the lengths of parameters A and D used as part of the kinematics calculations

to get and set the angles using XYZ coordinates

Parameters

FLOAT LengthA
FLOAT LengthD


Return value

This call does not return a value


SetMovementSpeed

Controls the movement speed of the arm and the ramping increment

Parameters

UINT Speed
Range 0-10000 default 8000
UINT Increment
Range 0 to 5000, default 50


Return value

This call does not return a value


SetGripper

Sets the new position of the gripper

Parameters

BYTE Position
0 = Closed, 255 = Fully Open


Return value

This call does not return a value


SetCalibrationPosition

Called when the arm gripper is in the calibration position of X0 Y300 Z5

Reconfigures the kinematics calculations based on this.

Performed in factory to calibrate the arm, warning calling this function will effect factory calibration.

Parameters

This macro has no parameters


Return value

This call does not return a value


StoreAngles

Stores the specified joint angles into an internal none volatile memory location.

Parameters

BYTE PositionIndex
Range: 0 to 40
FLOAT AngleA
Range 0.0 to 359.0
FLOAT AngleB
Range 0.0 to 359.0
FLOAT AngleC
Range 0.0 to 359.0


Return value

This call does not return a value


GetWifiIP

Collects the IP address of the robot arm WIFI connection.

Parameters

This macro has no parameters


Return value

STRING


GetColourSensor

Samples and returns the RGB values read by the colour sensor

Parameters

BYTE RGB
Byte Array To Hold the RGB sensor values


Return value

This call does not return a value


SetMotor

Sets the step position of a single motor

Parameters

BYTE Motor
0=A, 1=B, 2=C
UINT Position


Return value

This call does not return a value


IsMoving

Checks to see if the robot arm or gripper is moving.

Returns 0 if the arm is not moving and 1 if the arm is still in transit.

Parameters

This macro has no parameters


Return value

BOOL : Returns true if the operation is a success, else false


ResetToBoot

Resets the board into bootload mode for reprogramming.

Comms port will be closed on calling this macro,

Parameters

This macro has no parameters


Return value

This call does not return a value


SetAngle

Sets the angle of a single motor

Parameters

BYTE Motor
0=A, 1=B, 2=C
FLOAT Angle
Range 0.0 to 359.0


Return value

This call does not return a value


SetXYZ

Moves the machine so that the end tool is in the specified XYZ position.

Returns 1 if the coordinates are within range of the Arm else returns 0.

Parameters

INT X
INT Y
INT Z


Return value

BOOL : Returns true if the operation is a success, else false


SetBluetoothPin

Configures the Bluetooth pin and stores into the none volatie memory onboard the robot arm.

Call the SetBluetoothMode macro after this to action the change.

Parameters

<- STRING Pin
Pin String, 4 Numeric Characters e.g. "1234"
This parameter may be returned back to the caller


Return value

This call does not return a value


HomeAll

Function to automatically home all motors.

Macro blocks until complete.

Parameters

This macro has no parameters


Return value

This call does not return a value


SetRelay

Allows the vacuum relay to be switched on and off.

Parameters

BOOL State


Return value

This call does not return a value


SetCalibrationRadius

Sets the lengths of parameters A and D used as part of the kinematics calculations

to get and set the angles using XYZ coordinates

Parameters

FLOAT Radius


Return value

This call does not return a value


GotoPosition

Recalls a position from the selected internal none volatile memory location.

Performs linear interpolated movement to the selected position.

Parameters

BYTE PositionIndex
Range: 0 to 40


Return value

This call does not return a value


SetAngles

Sets the angle of all motors

Parameters

FLOAT AngleA
Range 0.0 to 359.0
FLOAT AngleB
Range 0.0 to 359.0
FLOAT AngleC
Range 0.0 to 359.0


Return value

This call does not return a value


SetWifiMode

Configures the WIFI mode.

When enabled the robot arm can either create its own WIFI network or join an existing WIFI network,

Parameters

BYTE Mode
0=Disabled, 1=Host Network, 2=Join Network


Return value

This call does not return a value


DisableMotors

Disables all motors

Parameters

This macro has no parameters


Return value

This call does not return a value


GetAngles

Collects the current joint angles of the motors.

Parameters

FLOAT Angles
Float Array To Hold the step position return values


Return value

This call does not return a value


HomeAxis

Function to automatically home a specific motor.

Macro blocks until complete.

Parameters

BYTE Axis
0=A, 1=B, 2=C


Return value

This call does not return a value


StoreMotors

Stores the specified step position into an internal none volatile memory location.

Parameters

BYTE PositionIndex
Range: 0 to 40
UINT PositionA
UINT PositionB
UINT PositionC


Return value

This call does not return a value


SetCanId

Stores the specified CAN ID into an internal none volatile memory location.

Parameters

UINT ID


Return value

This call does not return a value


GetAPI

Gets the API version number

Parameters

This macro has no parameters


Return value

BYTE


SetMotors

Sets the step position of all motors

Parameters

UINT PositionA
UINT PositionB
UINT PositionC


Return value

This call does not return a value


SetCanMode

Configures the CAN mode.

Parameters

BOOL Mode
0=Disabled, 1=Enabled


Return value

This call does not return a value


SetWifiSSID

Configures the WIFI SSID string and stores into the none volatie memory onboard the robot arm.

Call the SetWifiMode macro after this to action the change.

Parameters

<- STRING SSID
Netword ID String, Max 32 Characters
This parameter may be returned back to the caller


Return value

This call does not return a value


GetPosition

Collects the current step positions of the motors.

Parameters

UINT Positions
UINT Array To Hold the step position return values


Return value

This call does not return a value


StoreCurrentPosition

Stores the current position into an internal none volatile memory location.

Parameters

BYTE PositionIndex
Range: 0 to 40


Return value

This call does not return a value


GetXYZ

Collects the current XYZ position of the end tool.

Parameters

INT XYZ
INT Array To Hold the X, Y and Z return values


Return value

This call does not return a value


SetBluetoothMode

Configures the Bluetooth mode.

Parameters

BOOL Mode
0=Disabled, 1=Enabled


Return value

This call does not return a value


Initialise

No additional information


Parameters

This macro has no parameters


Return value

BOOL : Returns true if the operation is a success, else false


SetBluetoothName

Configures the Bluetooth device name and stores into the none volatie memory onboard the robot arm.

Call the SetBluetoothMode macro after this to action the change.

Parameters

<- STRING Name
Bluetooth Device String, Max 20 Characters
This parameter may be returned back to the caller


Return value

This call does not return a value



Property reference

Simulation Mode

This property is of type Fixed list of ints and can be referenced with the variable name SimMode.

No additional information


Comms Method

This property is of type Fixed list of ints and can be referenced with the variable name CommsMethod.

Selects the method to communicate with the Matrix 3 Axis Robot Arm.

USB connection requires the USB drivers to be installed.

Bluetooth connection requires the device first be paired using the Windows Bluetooth control panel.

WIFI connection requires the connection settings to be configured first on the robot using USB or Bluetooth.

CAN connection does not simulate and works on embedded hardware e.g. the MIAC.

Autodetect

This property is of type True or false and can be referenced with the variable name Autodetect.

Autodetects the COM port, only works for USB AllCode connection.

COM Port

This property is of type Fixed list of ints and can be referenced with the variable name COMPort1::COM_port.

Selects which port to communicate with, only lists ports which are currently available.

Refresh COM Ports

This property is of type True or false and can be referenced with the variable name COMPort1::Refresh.

When set to yes the COM port list is rescanned for newly connected or available ports.

Note that refreshing the ports list may take a few seconds depending on the number of connected ports.

Network Interface

This property is of type Fixed list of ints and can be referenced with the variable name NetworkComms1::NetworkInterface.

Some computers may have several network interfaces such as ethernet ports and wifi access.

Select the correct network interface for the network you wish to connect to.

Use the IP address to confirm you are connected to the right network.

Local IP Address

This property is of type Line of text and can be referenced with the variable name NetworkComms1::IPAddress.

IP Address of the selected network interface.

Arm IP Address

This property is of type Line of text and can be referenced with the variable name ArmIP.

IP address of the robot arm.

You can find the Arm IP address by connecting using USB and running the GetIP component macro.

You may first need to configure the Robot Arm by providing the network SSID and Password.

Port

This property is of type Unsigned integer and can be referenced with the variable name Port.

Allows the Robot Arm TCP/IP Port to be selected. Default 1245.

Channel

This property is of type Fixed list of ints and can be referenced with the variable name can1::CHANNEL_CAN.

Switches between Internal CAN peripheral and External CAN controller IC MCP2515.