Robot Arm

Public summary: 

Learn how to programme in scratch by controlling this robotic arm,

Programme a robot using scratch!
Useful information
Kit List: 

Robotic arm and USB interface
Laptop with installed software
something to pick up (can, lego)

Scratch 2.0 Offline (Note version 3.0 lacks support for HTTP Extensions)
Python (2.7 defo but probs recent ones too) + pip
pyusb package (run pip install --pre pyusb)
libusb (python script)
maplinArm.json (scratch extension)


Set up
You'll need to check you have all the software on the laptop. If I remember there'll be a USB with it all on in the box however the internet has it available.
Firstly connect the arm and make sure it is switched on, then open a python terminal and run 'python' which will execute the python script. A message saying the server is running should be displayed, leave it running all the time. Then you'll need to load the arm functions into scratch, press shift, then click file while holding shift. Go to "Install experimental HTTP Extension" then select 'maplinArm.json'. In scratch you should be able to access these under more blocks, then a 'MaplinArm' drop down. There should be a green dot next to 'MaplinArm' to indicate the communication is working.
[What you've done here is start up a HTTP server in python, this receives packets from scratch saying which instruction and then it runs some python which via some reverse engineering of the arm control protocol, a robotic arm library and USB wizardry to actually control the arm. Without the whole mechanism of HTTP this is a bit like an interpreter from Scratch into Python, if you wanted to talk about this and compilers feel free...]
My code for this is also on the CHaOS github.

Using it
It's like scratch but with some extra blocks that control the arm. The kids can probably figure it out simples even if you can't. Get them to pick things up, move them around and put them down again. You can talk about general robotics, what might you use this for? Problems? (I'd guess this could crush an empty can if you weren't careful) Maybe think about loops, automated processes in a factory. You could ask about improvements? Maybe fit a camera and then sort based on colour (you couldn't do this in scratch though!).

Risk Assessment
Date risk assesment last checked: 
Thu, 26/12/2019
Risk assesment checked by: 
Date risk assesment double checked: 
Mon, 27/01/2020
Risk assesment double-checked by: 
Polly Hooton
Risk Assessment: 

Programming a robotic arm using scratch

Hazard Risk Affected Person(s) Likelihood Severity Overall Mitigation Likelihood Severity Overall
Entrapment Getting hair trapped or fingers caught in movements of the arm. All 2 2 4 Keep back from the arm while movements are happening. 1 2 2
This experiment contains mains electrical parts, see separate risk assessment.