A suite of software useful in experimenting with small robotic arms. Use as a teaching framework with a low barrier to entry for robotics and programming.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Kevin Matz fe41af0c6d return wherami coordinates in preset format 4 months ago
firmware return wherami coordinates in preset format 4 months ago
language requirement for python packages 4 months ago
.gitignore initial commit 4 months ago
ArmCtlListener.py return wherami coordinates in preset format 4 months ago
LICENSE.md initial commit 4 months ago
README.md return wherami coordinates in preset format 4 months ago
__init__.py requirement for python packages 4 months ago
activity_2.txt activity 2 example script 4 months ago
activity_3.py include an python activity example 4 months ago
armCtl.py move robot module to firmware package directory 4 months ago
robot.cfg slow down the serial port 4 months ago

README.md

armCtl

Summary

A suite of software useful in experimenting with small robotic arms. Use as a teaching framework with a low barrier to entry for robotics and programming.

History

Whilst an expansive scope, the principal development and implementation happened over 3 days in the summer of 2019.

Software Components

  1. An Arduino firmware to recieve commands and position the robot arm.
    • firmware/armCtl/armCtl.ino
  2. A streaming serial command & control protocol to communicate with the Arduino from a computer.
  3. A Python3 module that is a threaded serial reader/writer, and state machine for the arm.
    • firmware/robot.py
  4. An Antlr4 domain-specific scripting language for maneuvering the robot.
    • language/ArmControl.g4
  5. A Python3 implementation of that language for the Robot module.
    • ArmCtlListener.py
  6. A Python3 module to interface the scripting language to the robot module. When called directly, this module also provides an interactive shell for the scripting language.
    • armCtl.py

Hardware Components

This BOM is one possible configuration. Substitute parts are available, and any servo controlled arm is acceptable.

Part Cost
Arduino Uno $22
Arduino Sensor Shield V5 $7.19
Power Supply 25W 5V 5A $9.50
6-Axis Desktop Robotic Arm $170

Activities

  • Control the arm interactively.
> ./armCtl.py
command# go jib 90
command# wait
command# go home
  • Script a simple sequence of moves.
# my_script.txt
go jib 90
wait
go home

> ./armCtl.py my_script.txt
  • Write a Python3 script for complex movements.
#!/usr/bin/env python3
import armCtl as arm

arm.command("go jib 90")

arm.r.target = [90, 120, 10, 95, 90, 90]
arm.r.move()
while arm.r.isMoving():
    pass
print(arm.r.angle)

Reference

Scripting Commands

Multiple script commands given on the same line must be seperated with a semicolon (;).

go coordinates | axis_name vale | preset_name

Set target coordinates for the arm. Movement will not begin until the command statement is complete, or before a wait or pause command. The word ‘go’ my be omitted provided the axis or preset name does not match the name of a command.

coordinates

Go to the coordinates given as {value, value, value, value}. Values must be integers. Values may be given in either decimal or hexadecimal notation. Omitted values will be accepted as null and will not effect the arm position.

axis_name value

Move the named axis to the given value. Names must be defined in the configuration file as the integer index of the axis in the command protocol. Values must be integers. Values may be in decimal or hexadecimal notation.

preset_name

Move the robot to the named coordinates defined in the configuration file. Coordinates must be defined in decimal notation.

pause time

time

Do nothing for the length of time.

wait (time)

Wait for the arm to stop moving.

time

If time is given, pause for that amount of time after movement has completed. If time is omitted, do the next command immediately after movement stops.

pass

Do nothing.

whereami

Print out the current coordinates of the arm.

Shell Commands

exit

End the shell session.

quit

Same as exit.