muscle control — open bionics
DESCRIPTION
ElectronicsTRANSCRIPT
MUSCLE CONTROLJanuary 19, 2016
OVERVIEWThis tutorial will guide you through the process
of using Electromyography (EMG) muscle
sensors to control the Ada hand.
This tutorial is for:
Hand: Ada V1.0
Circuit Board: Almond V1.2
Firmware: Artichoke V1.0
You will need:
Ada hand with Almond circuit board,
running Artichoke V1.0 firmware
12V DC power supply
Micro USB cable
Computer running Arduino IDE
Soldering iron + solder
2 x Muscle Sensor V3 (or similar)
SIGN UP
Sign up for updates! *
Join our developer
community!
SIGN UP
ADA V1.0 ASSEMBLYINSTRUCTIONS
ARTICHOKE V1.0FIRMWARE USERGUIDE
Jan 26, 2016
Jan 19, 2016
HOME ABOUT BLOG SHOP DEVELOPER CONTACT US
2 x Sensor cables
5 x Sticky electrode pads
2 x 9V batteries
2 x 9V battery snaps
1 x 4 Pole 3.5mm headphone jack
(IMPORTANT, must be 4 Pole)
30cm Red wire
30cm Black wire
SENSORSElectromyography (EMG) sensors are used to
detect the electrical potential of your
muscles. A signal is picked up from a surface
electrode, placed on your skin, the signal is
then passed through a series of amplifiers and
filters to produce a 'clean' signal. The resulting
'clean' signal is within the usable range of a
microcontroller, so can be fed into an Analogue
to Digital Converter (ADC), where the
magnitude of the signal represents the
magnitude of the muscle activation, i.e. the
greater the signal magnitude, the harder the
muscle is tensing.
CONSTRUCTING THESENSOR
EMG sensors are becoming more widely
available; this tutorial involves the modification
and use of the Muscle Sensor V3 boards from
Advancer Technologies, however this tutorial
will also briefly cover the use of their new
MyoWare boards as well.
MUSCLE CONTROLJan 19, 2016
The first step is to
attach the battery
snaps to the Muscle
Sensor V3 boards.
1. Solder the negative (black) wire from the first
battery snap and the positive (red) wire of the
second battery snap, to the GND pad of the
Muscle Sensor V3 board
2. Solder the positive
(red) wire of the first
battery snap to the
'+Vs' pad on the
Muscle Sensor V3 board
3. Solder the negative (black) wire of the
second battery snap to the '-Vs' pad on the
Muscle Sensor V3 board
You should now have the first battery snap
connected between '+Vs' and GND, and the
other battery snap between GND and '-Vs'
4. Solder a 10cm
wire between the
'+Vs' pad on the first
Muscle Sensor V3
board to the '+Vs'
pad on the second Muscle Sensor V3 board
5. Solder a 10cm wire between the GND pad
on the first Muscle Sensor V3 board to the GND
pad on the second Muscle Sensor V3 board
6. Solder a 10cm w ire between the '-Vs' pad on
the first Muscle Sensor V3 board to the '-Vs'
pad on the second Muscle Sensor V3 board
The next step is to
attach the Muscle
Sensor V3 boards to
the headphone jack.
1. Solder the
GND pad on the second Muscle Sensor
V3 board to the GND connection on the
headphone jack
2. Solder a wire from the SIG connection on
the first Muscle Sensor V3 board to the
first signal pin (SCL/ADC6/RX) of the
headphone jack
3. Solder a wire from the SIG connection on
the second Muscle Sensor V3 board to
the second signal pin (SDA/ADC7/TX) of
the headphone jack
4. DO NOT CONNECT 5V as this may
damage the board
The EMG sensors should now be ready for us
to plug into the headphone jack on the Ada
hand, but first we need to connect the
electrodes.
POSITIONING THEELECTRODES
Each sensor board requires three electrodes to
attach to the skin; 2 electrodes used for the
muscle signal (red + blue) and a 3rd electrode
used for a body/ground reference (black).
However, when working with 2 channels we
are able to discard one of the body/ground
reference electrodes (black). The 5 remaining
electrodes should be placed on the forearm as
seen below.
1. Press each of the sticky electrode pads
into the electrode sensors
2. Peel off the paper backing of each sticky
electrode and apply to the skin in the
locations shown in the image below
3. The muscle signal electrodes (red + blue)
for each channel should be placed on
the area of the forearm with the greatest
muscle mass, with at least 2cm between
them
4. The body/ground reference (black)
electrode should be placed on an area of
the body without much muscle mass,
such as the elbow
Forearm electrode placement
Note that the sticky electrodes are single use
only, and the quality of the signal degrades
greatly after they are removed and reapplied.
FIRMWAREThe Artichoke firmware allows the Ada hand to
be controlled via muscle signals using EMG
sensors. The muscle signals are fed into the
ADC of the Almond board via the headphone
jack. Muscle mode is disabled by default, but
standard muscle control can be enabled by
entering the serial command 'M1', once enabled
this mode will stay enabled (even after a power
cycle) until it is disabled using 'M0'.
Once standard muscle mode is enabled, the
hand will take a sample of 150 muscle values
(takes 200ms), which it uses to generate the
initial baseline values for your muscles, called
the noise floor. This noise floor is the default
value of your muscles when they are not active,
and changes depending on a wide range of
factors, such as electrode placement, skin
contact due to sweat/hairs etc. Once
generated, we use this noise floor as the
baseline reading of your muscles and it is
recalculated constantly whilst the muscle is not
activated (a noise floor can be generated
manually by entering 'N').
The threshold value is generated by adding a
specified sensitivity value to the noise floor, if
the current muscle signal is greater than the
threshold value, the muscle is determined as
activated. The sensitivity value can be set via
serial by entering the command 'U###', where
# is a number between 0 - 1023.
With the EMG sensors connected to your
muscles and plugged into the hand, if you
enable muscle mode (M1), you can view a live
update of the values by entering the command
'M3'. This should continuously print out muscle
data in the following format;
M0 = 178 T0 = 369 N0 = 169 A0 = 0 M1
= 200 T1 = 384 N1 = 184 A1 = 0 DIR
None
M# - raw muscle signal
T# - calculated threshold (noise floor +
sensitivity value)
N# - noise floor
A# - whether the muscle is determined to
be active (0 = inactive, 1 = active)
DIR - calculated direction of the
combined muscle signal (open, close,
none)
With your muscles relaxed, both A0 and A1
should be 0, showing that the muscles are
determined to be inactive. If any of them is
detected as active, even when the muscle is
relaxed, try increasing the sensitivity value by
entering 'U###', where # is the new
value, typically between 100 - 300, where the
lower the number relates to an increase in
sensitivity.
MUSCLE
CONTROL METHODSOnce you have confirmed the EMG sensors are
working and wired correctly, you can start to
control the hand using your muscles.
The image on the right shows how the two
hand motions you should perform to activate
the inside and outside forearm muscles with
the least amount of effort.
If you find that the hand is responding to the
opposite command (i.e. you perform an open
movement and the hand closes) switching the
electrode sensor wires between the two
Muscle Sensor Boards.
STANDARD MUSCLECONTROL
The default control mode is standard muscle
control; the hand will either open or close,
depending on which of the muscles is tensed.
For example, when the outer forearm muscle is
tensed, the hand should open, and when the
inner forearm muscle is tensed, the hand
should close.
If the hand is open, and you hold the open
forearm muscle for 700ms, the hand should
cycle to the next grip pattern, you should then
be able to open and close as normal in this grip
pattern. The possible grip patterns are listed in
order below.
1. Fist - all fingers and thumb move
2. Palm - all fingers move, thumb stays
open
3. Thumbs up - all fingers stay closed,
thumb moves
4. Point - all fingers remain closed, only the
index finger moves
5. Pinch - all fingers remain open, only the
thumb and index move
6. Tripod - ring and pinky remain open,
index middle and thumb move
To enable this control mode, enter 'M1' over
serial, this method will also stay enabled after a
power cycle, unless it is disabled by entering
'M0'.
POSITIONAL MUSCLECONTROL
Positional muscle control is designed to
achieve finer control of the hand when using
muscle sensors, this mode also more closely
reflects how a robotic prosthetic hand is
controlled. The hand only moves when a
muscle is tensed, and the speed of movement
is proportional to the size of the muscle
activation/how much the muscle is tensed. This
means that you can move the hand slowly by
tensing gently and you can move the hand
quickly when tensing more firmly. To enable
this control mode, enter 'M2' over serial, this
method will also stay enabled after a power
cycle, unless it is disabled by entering 'M0'. For
this mode you may need to decrease the
sensitivity to allow for the 'gentle' tenses to be
picked up by the hand.
EXTRA
I2C MUSCLE SENSORS
An alternative solution for muscle sensing is to
use an I2C ADC. Instead of passing the raw
analogue signals down through a long cable to
the ADC on the Almond board, which could
result in an increase in noise, an I2C ADC could
be located as close as possible to the
muscles/EMG sensor. This would result in a
shorter cable length between the output of the
EMG sensors and the ADC, thus reducing the
chance of noise.
Artichoke is designed to use both analogue
(default) and I2C muscle sensors, in particular
the AD7995, a 4 channel 10-bit I2C ADC.
The library can be found at
www.github.com/Open-
Bionics/Arduino_Libraries, titled 'I2C_ADC.h'.
Once downloaded and installed, it can be
enabled within Artichoke by navigating to
'Globals.h' and uncommenting the following;
//#define USE_I2C_ADC
Uncommenting this line changes the muscle
controller to perform an ADC2.read( )
0 Likes
← Artichoke V1.0
Firmware User Guide
(I2C_ADC) instead of an analogRead( ), enables
the I2C_ADC to be initialised and pulls the ADC
pins high to configure I2C lines, as discussed
below.
IMPORTANT NOTE ABOUTI2C
The 2 data lines passed through the
headphone port on the Almond board are
connected to both I2C pins and analogue pins
(through a 10k resistor). If the headphone port is
being used for analogue data (e.g. muscle
sensors), you should not initialise I2C. When
using I2C, the analogue pins need to be pulled
high to act as the pull ups for the I2C lines.
pinMode(A6,OUTPUT);
pinMode(A7,OUTPUT);
digitalWrite(A6,HIGH);
digitalWrite(A7,HIGH);
Share
Home
About
Blog
Shop
Downloads
The Team
Contact Us
Investment
Opportunities
Developer Community
Tutorials
Forum
To contact us e-mail
(c) Open Bionics 2016