EMG Based Elbow Exoskeleton With Arduino Mega

by twinamic in Circuits > Microcontrollers

1082 Views, 3 Favorites, 0 Comments

EMG Based Elbow Exoskeleton With Arduino Mega

edir.jpg
PhotoFunia-1621777949.jpg
edit2.jpg
IMG_20210730_074611.jpg

By definition, it is a type of robot that is used to augment human work after the subject wears it. Though there are many types, the two commons in wearable robots are the exoskeleton and prosthetic. I am going to discuss the development of the upper limb elbow exoskeleton.


Working:

Two main components are: the primary and secondary systems, in the primary system which has the uttermost priority, is the data acquisition by sEMG. Once the EMG signal is acquired from the kit (which already rectifies and smooths it as the internal function of the kit), it is fed into the microcontroller. The microcontroller has programmed filters that are required for the acquisition of useful data and the removal of noise and motion artifacts from the signal.

Secondary input comprises state information from the two limit switches mounted on the motor pulley. At any instant, either one of them gets HIGH. The two limit switches allow us two know the limited two joint positions: fully flexed or extended and at any moment, either of them is achieved.

Now we have two sets of data, the joint position from the limit switches and the required EMG signal after filtering, but how do we know what the muscle intends to do, how much force is it exerting, and what position it wants the joint to move? this is done by feeding the EMG signal into the microcontroller which calculates the intended position by the Threshold Difference method. After the desired output, the microcontroller commands the motor unit to move the elbow joint. Feedback from the limit switches is again compared and this process keeps on iterating.

Threshold Difference method:

This method looks at what point the difference voltage (bicep – tricep) is and sends a signal to the motor indicating the direction of movement. when the user will flex his arm, the voltages will be more positive. However, when the user straightens his arm, the voltages will generally be more negative. At rest, the user will have a voltage difference closer to zero. Since there is a ripple voltage, there will always be some small inconsistencies with how the motor will move.


We can divide this project into two parts from here:

  1. Mechanical Design
  2. Electrical Design


Supplies

The following materials are required. You can buy from anywhere. I bought it from a local store but it has to be according given specifications.

  1. Elbow orthotic/brace
  2. Wiper motor (12v, 5A max)
  3. BTS7960 Motor Driver
  4. 2x. EMG Muscle Signal Sensor Module Kit
  5. 5Ah rechargeable Li-ion battery
  6. 2x. 9V AA battery
  7. Arduino Mega Board
  8. 2x. Brake cable wires.
  9. 4inch Rubber Pulley
  10. BMS (Battery Management System)
  11. 3x. Push button (SPST)
  12. 3D printed parts
  13. Any size screws.
  14. Plywood or Acrylic

Mechanical Design

arm.png
WhatsApp Image 2021-05-19 at 11.50.26 AM (1).jpeg
WhatsApp Image 2021-05-19 at 11.50.26 AM (2).jpeg
IMG_20210730_074518.jpg
emg2.png
emg3.png
emg.png

This specific orthotic comes with an adjustable lock mechanism at the joint position which can be seen in the above image. We have utilized this to our advantage as it will provide us more safety against high torque motor. You should buy the braces of the same dimensions as shown in the figure. The second phase is to calculate the size for the pulley to mount on the wiper motor, this can be done as follows:

Cable calculations:

To actuate the joint in the brace I used a Bowden cable to transfer the torque from the servo motor, located in the backpack to the elbow joint on the brace. As the steel cable were 56 cm long each. I calculated the diameter of the pulley by going through the following steps:

Attach the two Bowden tubes to the braces and let the brace be fully contracted to make 180 degrees, note down the steel wire coming out of its open end.

Fully flex the arm and note down the length of the wire that is now out of the other open end.

The difference in length will be as follows:

D = 26cm – 20cm

= 6cm

This value can be assumed as the quarter of the circumference of the pulley, which is required to move in order to take one cable from position 0 to point 6 cm.

Therefore, calculating for four quadrants, we get 24cm+_ 3cm. now to calculate the diameter of pulley, put values in the formula:

C= 2*pi*r

C = pi*d

d= 24/pi

= 8 – 9 cm approx.

 In inches, it becomes approx. 4 inches, so I got a pulley of that size from the store

Remember to cut the metal piece that comes along with the motor and weld it to the bearing of the pulley.

I've made the base of the Electronic and motor housing (The Box) with 3/4 inch plywood and the top and sides are made with a 5mm Acrylic sheet. You can make yours how you see best.

3D Printed Parts

emg complete assembly v2.png
Screenshot_20221009-181503.jpg
emgclip v3.png
Screenshot_20221009-181520.jpg
limitswitchbrac v3.png
Limit Switch Mount for wiper motor
EMG module 3D assembly v1

All the parts were designed in Autodesk Fusion 360 and printed using the CURA slicer. 1.75mm PLA filament was used for all the parts. Each design schematic is given in the "Mechanical Design" step above.

I attached the electrode bracket with the main bracket via Philips screw and put a spacer and small springs between them to give them a pushback while contracting the muscle.

Note: three files in two formats: f3d(for making changes) and stl(for 3d printing)

Electrical System Design

circuit.png
sdfsd.PNG
WhatsApp Image 2021-05-19 at 11.50.26 AM.jpeg
WhatsApp Image 2021-05-23 at 7.32.49 PM.jpeg
WhatsApp Image 2021-07-29 at 11.16.49 AM.jpeg
button.png

Motor driver (BTS7960):

I connected this driver to a 12V battery with peak current production of 6A. The control pins were connected by the following configuration:

BST 7960 Pin -->Arduino Pin

(RPWM) --> D5

(LPWM) -->D6

(R_EN) --> Arduino 5V

(L_EN)--> Arduino 5V

(R_IS)--> Un-connected

(L_IS)--> Un-connected

(VCC)--> Arduino 5V

(GND)--> Arduino GND


Battery pack:

The battery housing powering the whole project comprises of two different types of battery: Li-ion rechargeable battery pack and AA alkaline batteries. The 12V rechargeable battery is the main battery powering our motor and has the capacity to produce a high current up to 6 Amps whereas the other two AA batteries are connected as shown below to power the EMG kit.

One more 9V AA battery is used as a separate supply for the microcontroller (Arduino). The purpose of separating supplies for motor and microcontroller is purely for safety so in case of any failure, each section can be cut off on its own and we can save the other. We could have used rail-splitter supply for +-9V supply of EMG kit but the cost of it against AA batteries outweighed and we had to stick to it not just only to reduce cost but also complexity.

The 12v lithium rechargeable battery is monitored by BMS or Battery Management System. which manages it by protecting the battery from operating outside its safe operating area monitoring its state, calculating secondary data, reporting that data, controlling its environment, authenticating it, and balancing it. 3S 20A 12V Lithium Battery Charger Protection Board is used in this case.

Control buttons:

Three control buttons are installed for the manual mode feature that is added for the rehabilitation exercises for the patient. One is used for extending the arm whereas the other is for flexing. The motor only moves till the button is pushed otherwise will stop instantly. The center one is a spare button that is installed so it can be programmed for more functions in case of any need.

Limit switches:

These two switches are installed for the feedback section so the motor can know its position and move accordingly. One is for detection of flexion and the other for the extension.

All exact Arduino Pins to which the electronics are attached can be seen in the code file.

Programming

Upper Limb Elbow Exoarm
wiring.PNG

The program is designed to work in two modes:

  1. Manual (by pushing buttons)
  2. Auto (Extracting EMG signal and moving accordingly)

These two modes can be changed by the help of one main toggle switch.

Filtering the signal:

Once these two signals are acquired we will filter them through the method known as EMA  or Exponential Moving Average.

The EMA algorithm goes as follows:

S1=Y1

and for t>1:

St=α*Yt+(1-α)*Yt-1

where St is the result of the EMA at time tYt is the pot measurement at time t, and α is a coefficient in the range <0,1> that decides how many samples the EMA algorithm should take into account. A low α will be very slow to rapid input changes and take many samples into account. A high α will be fast, but the average over fewer samples. We can say that α is kind of a cutoff frequency in a low-pass filter.

Applying the Threshold Method:

After filtering the signals, I was left with more accurate signals that were acquired. I took the difference between both signals and had the third output.

You have to visualize this difference signal multiple times for both flexion and extension so you could pick threshold points for your motor to move. For different pickup points, bound the motor to do that certain action within those constraints. That’s how you got two sets of commands; one for flexion and the other for extension.

Downloads

Conclusion

EMG based ExoArm

Finally, you'll end up with half upper limb exoskeleton. You can design it aesthetically however you want. For practicality, I got a custom-made backpack for it so you can carry it around while wearing the brace.