Spring 2017 Prosthetic Arm: Critical Program Module/Firmware

The Robot Company | CEO Professor Gary Hill

Blog Post Created by Project Manager | Bianca Esquivel

Project Code Written By Electronics and Control Engineer | Mikael Movsisyan

Table of Contents

Preliminary Information

Design Objective

Purpose: To satisfy requirement L2.2.1 Wrist Rotation (System) – The prosthetic arm shall provide a 90 degree of rotation at the wrist (clockwise and anticlockwise) and requirement L2.2.2 EMG (System) – The Prosthetic Arm shall acquire input from at least one electromyographic sensor that detects electromyogram (EMG) signals from muscles in user’s upper arm or stump.

Iterative Coding Process

First Iteration

The first step was to control the action of a motor using an analog sensor and a MCU. A simple light-dependent voltage divider circuit was built with a photoresistor and the voltage across the photoresistor was fed as analog input to the MCU. A threshold analog input was selected, above which the motor would be turned. Below this value the motor was turned off. Below is the image of the set-up.

The Arduino Code can be found at this link:

https://drive.google.com/open?id=0B6kkqAMmUffrWFotYkRKSmp3S0U

The conclusion from this simple test was that rotation of the wrist, using a servo as the actuator, can be controlled by an analog sensor such as the MyoWare EMG sensor. A threshold value (representing muscle contraction) can be selected above which the wrist will turn.

Second Iteration

The code was slightly altered to control a servo base on the analog input from the MyoWare EMG sensor. The Arduino code can be found at the link below:

https://drive.google.com/open?id=0B6kkqAMmUffrajQ1QXZNekFTWXM

This code was used to rotate the wrist of the rapid-prototyped arm model as shown below. With this code the wrist will turn clockwise when muscle is contracted and return to its original position when the muscle is relaxed.

Third and Final Iteration

Finite state machine code was added to ensure that wrist rotation was triggered by immediate muscle relaxation following muscle contraction had to occur to rotate wrist. The FSM was added to prevent wrist rotation when the muscle is contracted accidentally e.g. when the arm is bent. The link to the FSM code is shown below.

https://drive.google.com/open?id=0B6kkqAMmUffrbTRQZnJfYzloUjg

Purpose: To meet requirement L1-4 Safety – The operating temperature of the prosthetic arm shall not exceed 50 degrees C for safety reasons.

Verification: Heat the sensor to 50oC and see if the MCU will shut itself down.

In compliance with this requirement a power down sleep ISR code was obtained from the Arduino website. The MCU will be put to sleep whenever the analog input from the temperature sensor exceeds a threshold value corresponding to 50 degrees Celsius. A conditional statement was introduced such that the MCU will be put to sleep whenever the condition is met. The code for the sleep interrupt with the conditional statement can be found at the link below:

https://drive.google.com/open?id=0B6kkqAMmUffrSnEwSjlTWTBCODQ