Thursday, October 22, 2009

important files for my project ( part-2)

5 . control system


A major drawback with many muscle controlled prosthetics is that a lack of user feedback makes many everyday functions difficult because things such as grip strength and object weight cannot be known by the user. The goal of this control system is to monitor gripper position, motor current and EMG signal magnitude together and supply the user with vibration feedback relaying information about grip strength.






The vibration feedback will be achieved using a small pager motor. This motor will be bound to the body in a location distant from the location that the EMG signal is being obtained to avoid unwanted noise, or motion artifact. The pager motor is a small 3 volt dc motor that will be controlled using pulse width modulated (PWM) signal. The servo used to control the gripper is constructed using a standard Futaba servo. In order to monitor current and position the servo will be taking apart and the internal potentiometer and motor will be directly accessed. Using AutoDesk Inventor the gripping mechanism was designed and is shown below. The servo is mechanically bound to the left gripper gear so motor position will directly correlate to the grippers position.



Figure -CAD of mechanical Gripper


The components for the gripper will be machined out of UHMW (ultra high weight molecular) plastic due to its ideal properties of high strength and its ability to flex under loads that other materials would snap.





The three parameters being monitored are motor current, gripper or motor position and EMG magnitude. The processing of this system will be achieved using a 14 pin PIC 16F684 microcontroller. Each value will be obtained by means of an 8 bit analog to digital conversion using the microcontrollers onboard ADC. The following subsections will esxplain in greater detail the motor control circuitry and the control algorithm.



The motor current will be monitored using a Maxim 472 high side current sensor. This current sensor uses a differential amplifier to measure the voltage drop across a sense resistor placed on the motor supply coil. Figure 10 shows the internal circuitry of the current sensor.
Figure - Internal Circuitry of MAX 472


As seen from figure . the current sensors outputs a current that is proportional to the voltage drop across the sense resistor, therefore, a resistor is needed on the output pin to obtain an output voltage. Equation 6.1 is used to determine values for the resistors RG, Rsense and Rout (located on the output pin to ground) to obtain a maximum output voltage of 5 volts for maximum current. The motors blocked rotor current is 16mA, using this value as the maximum motor current,


V out = R out * R sense * R load / R g .........................[6.1]

V out = 5 , R sense = 1 ohm , R g = 10 ohm there fore ,

R out = 3k ohm .



An L293 dual push pull H-bridge driver was used to drive the motor. The microcontrollers onboard half bridge PWM function was used to control the motor speed. A PWM frequency of 20 kHz was used as this frequency removes any audible noise that may otherwise be present. Table 1 shows the truth table for the motor control













Direction Input 1 Input 2

Counterclockwise H (modulated) L
Clockwise L H(modulated)
Stop (fast) H H
Stop (Free movement) L L


Table 1- Truth table for motor control



The hardware PWM function allows for true multitasking of the microcontroller. This is due to the fact that the timer register on the microcontroller can be manipulated at any time to vary the duty cycle (and thus motor speed) of the PWM signal, and this duty cycle will be maintained without interruption until the register is changed. Figure shows the schematic for this section.


Figure -Motor control Schematic



The protection diodes (D1 –D4) are added to prevent surge currents that may be cause by access flux in the motor when it is powered off suddenly.
The position encoder is implemented by a potentiometer mechanically bound to the motor shaft via a series of step down gears. This allows the grippers position to be determined directly from the voltage read from this potentiometer. All the pieces are now in place to control the motor via the EMG signal, the algorithm that was developed is detailed in the following section.




The control of the gripper is accomplished using three variables discussed previously, which are motor current, motor position and the EMG signal magnitude. All of these signals are conditioned so that they lie between the 0 and 5 volt range. The values are read using the internal ADC and an 8 bit value is obtained in memory. An LED is used for initial setup in order to properly configure the EMG input signal. When the device is first turned on the LED will be lit, with a relaxed muscle the user must use the bias adjustment potentiometer to zero the input signal. When the signal reaches a negligible value the LED will blink twice as an indication of the processes completion. This procedure is now repeated but this time the user will flex the muscle to its full potential, and use the variable gain adjustment in order to increase or decrease the signal to a value of 5 volts.

possible scenarios regarding gripper motion exist, the first of which is when the gripper is not in contact with an object, and no object is present in the grasping region. Under these circumstances the gripper position is proportional to the half of the value of the EMG signal. Therefore there are 127 possible gripper positions where a value of 0 corresponds to fully open and 127 corresponds to fully closed. The speed in which the motor travels to that position is defined by the difference between the current position and the desired final position (muscle force). This gives the user the ability to make controlled micro adjustments when the gripper position and the EMG signal values are close to one other. The other scenario that could be encountered is when an object is located in the grasping region of the gripper. Position and muscle force are related here the same as in the previous situation, however; once the gripper comes in contact with an object the microcontroller will see an increased motor current, which indicates a higher motor torque.
The reason for not making the value of the EMG voltage variable directly proportional to the gripper position becomes apparent here. When the object is encountered and the gripper is unable to reach the desired position, the difference between the current position and the muscle force is calculated and the resultant value is used to compute the desired motor current. Figure 11 on the right, shows the relation of these variables. If the gripper position and EMG voltage were directly related then the user would not be able to increase the grip strength of an object that was small (at the grippers fully closed position) because they would be incapable of increasing the motor torque. As seen in figure 11, the highest motor torque is created when the gripper encounters a large object and muscle force is maximized, whereas the lowest torque would be seen when the gripper has reached its desired position corresponding to the magnitude of the muscle force. This allows the user to grasp an object more firmly by flexing there muscle harder, and visa versa, equation 6.2 shows this relation. It should be noted that if the muscle is subsequently relaxed the reverse movement is obtained using the same process as in the first scenario.


Figure - Matlab plot of motor current relative to motor position and muscle force


for , V emg > @ ( called alpha ) gripper otherwise ,

I motor = ( V emg - @ gripper )^2 I motor = @ grriper -V emg


where , @ gripper is the greeper position.

Feedback vibration occurs when the motor current is increased, with the magnitude of vibrations relating to the magnitude of the current increase. Since this feature may not always be needed a simple button will be used to turn this feature on and off. The source code for this control systems implementation is located in appendix.



1. PCB Layout


Below is a view of the PCB layout for the electrode and main board. The electrode contains the components shown in figure . The connection from the electrode to the main board is achieved via an 8 pin RJ-45 connecter. This cable will supply the following signals: the positive and negative 9 volt rails, ground, reference voltage and the preamplifier output signal. Also slots are made for a Velcro strap that will be used to firmly secure the electrode to the users arm to avoid artifactual noise.



figure : pcb layout of electrode





figure: pcb layout of main board.blue - bottom , top layer -red.



conclusion


The amplifier proved itself quite well even without proper connections and with long leads the signal obtained from the forearm muscle contained very little noise. The need for the bias adjustment circuit was seen in the early stages of testing as the signal contained quite a bit of offset. An decoupling capacitor was considered but the decision to implement the user setup feature in the control algorithm made the bias adjustment critical.
The servo motor controller contained very little jitter and very few modifications were needed for this circuit. When the systems were combined the overall functionality was surprisingly good even in early stages of testing. Further tweaking will be necessary to achieve smoother and more precise motion but the potential for implementing this type of control on a larger scale is evident.







appendix


amplifier schamatic




control schamatic






Tuesday, October 20, 2009

important files [2] for my project. ( part -1 )



Abstract

The use of EMG as a means for control is a topic that has been studied by many different groups. The most common forms of myographic control allow the user to control prosthetics using a number of muscles. Controls are designed in a way such that the movement of the prosthetic is determined, and preprogrammed to follow certain routines when the state of each of the control muscles fit predetermined patterns. This method of control is safe and user friendly, however; limits the user feedback and the versatility of the prosthetic. The goal of this project is to create an EMG amplifier and servo motor controller to be used with a two degree of freedom mechanical gripper. The control of the gripper will be accomplished by directly relating the magnitude of the EMG signal obtained from a forearm muscle to the servo motors torque and the grippers position. The objective set out to achieve is to provide a user with the ability to manipulate the gripper with both fine and coarse adjustments and also have the ability to increase the gripping power. In addition, feedback via a light vibrating motor will allow the user to get a feel for the grip strength being applied.










Electromyographic (EMG) signals provide a very useful means of control of robotic prosthetics. In recent years research in biomedical engineering and other similar areas, along with advancements in electro mechanics, have led to the creation of advanced and accurate robotics prosthetics. The foremost problem encountered when dealing with physiological signals is isolating the desired signal from that of its like counterparts. When measuring motor unit action potentials, it can be hard to assure that the acquired signal is that of the muscle under examination.



Once obtained the EMG signal can be used for several applications. In applications such as determining muscle fatigue, the frequency spectrum of the signal possesses the desired information, whereas, for control applications the overall energy of the signal provides the preferred control parameter. The goal for this project is to use EMG signals obtained from the forearm to control a mechanical gripper. Not only will the focus be on obtaining an accurate signal from the muscle, but also creating an easily controllable servo mechanism that will provide user feedback. For gripping tasks, a drawback for the user can be their inability to identify grip strength. The goal of this project is to provide the user with a vibration sensation to indicate gripper strength, while allowing the user to vary this strength accordingly.








The process of muscle contraction begins in the brain and is transmitted through the spinal cord. From the spinal cord, motor neurons or axons branch several times before coming in contact with muscle fibers. The combination of these motor neurons and the muscle fibers which they connect to, make up what is called a motor unit. The motor neurons, however; do not necessarily connect exclusively to separate muscle fibers, any given segment of muscle may have fibers belonging to 20 – 50 motor units . The number of fibers in a motor unit dictates the muscles precision, generally muscles that make more robust movements contain more fibers per motor unit. An action potential propagates through the axons via an electrochemical gradient created within the cell body. This action potential causes a contraction, and depolarization, of the muscle fiber and thus the creation of an electrical potential within the muscle fiber. It is this electrical field that is the source of the signal that will be detected from the surface of a muscle using an electrode. When all of the fibers in a motor unit fire a motor unit action potential (MUAP) is created. This process is repeated many times by multiple motor units, giving the myoelectric signal its characteristic of a dense frequency spectrum up to around 500 hertz.








Almost every signal amplification, and even more commonly with physiological signals, noise removal plays a major role in signal acquisition. Generally an amplifiers quality is its ability to remove such noise and more accurately represent the desired signal. There are commonly 3 main types of noise to consider when obtaining EMG signals through surface electrodes. Electromagnetic radiation, inherent noise in electronics, and motion artifact will adequately cover the types of noise that will be encountered in obtaining the EMG signal. Maximizing the signal-to-noise ratio will come as a direct result of minimizing these factors when obtaining the desired signal.




Electromagnetic Radiation





Figure - Differential Amplification of EMG Signal



The human body acts much like an antenna for many different types of signals, the most important one of these signals to consider is that of the standard North American electrical power line, located at a frequency of 60 Hz. The magnitude of this noise at the skin surface can be in the range of 3 times that of the EMG signal making its removal inparative. Also as discussed in the previous section the majority of the EMG signal is located from 0 – 500 Hz, thus this 60Hz ambient noise must be removed to insure that the EMG signal is accurately represented. A high Q value notch filter would suffice for removing this interference, however; because the desired signal has energy located at this frequency a differential amplification process is a superior solution to this problem. The design that was implemented for this project uses just such a method. Figure below shows how a differential amplifier can be used to remove noise. Due to the fact that the electromagnetic interference is common to both electrodes subtracting the signals can remove the commonalities in the signal.





All electronics have inherent noise which can range from 0 to many thousand of hertz. As this noise cannot be removed, its existence must be considered and the choice of high quality components can be the best solution to creating a better amplifier.







Another common source of noise is motion artifact. The source of motion artifact is both by electrodes moving on skin surface and due to electrode wire movement. This motion usually causes lower frequency noise in the range of 0 – 20 Hz. The removal of this motion artifact is accomplished via a simple high pass filter with a cutoff frequency somewhere between 15-40 hertz. Due to the fact that this frequency band is in the range of the EMG signal eliminating noise of this type will ultimately cause EMG signal energy loss as well. A tradeoff must be made between signal energy loss and the elimination of motion artifact.








There are two types of electrodes for obtaining EMG signals, inserted (invasive) electrodes and surface (evasive) electrodes. The ease of use and lack of pain associated with surface electrodes makes their implementation for this project preferable. Surface electrodes come in many varieties, with most characterized by the number of contacts. Some different types of surface electrodes are monopolar, bipolar, tripolar and multipolar, all of whose geometry is described by there name. For the purpose of this project a bipolar electrode will be used along with a reference electrode in order to implement the differential amplifier.
Electrode placement is important when using any of the electrode types described above. With the bipolar electrode the optimal position of the electrodes is parallel to the muscle fibers in order to maximize the probability of reading the same signal. electrode placements and the resulting potentials. the desired position for electrodes is on the belly of the muscle and not on the outer edge of the muscle where other muscles could interfere with the muscle under examination
There are two types of electrodes for obtaining EMG signals, inserted (invasive) electrodes and surface (evasive) electrodes. The ease of use and lack of pain associated with surface electrodes makes their implementation for this project preferable. Surface electrodes come in many varieties, with most characterized by the number of contacts. Some different types of surface electrodes are monopolar, bipolar, tripolar and multipolar, all of whose geometry is described by there name. For the purpose of this project a bipolar electrode will be used along with a reference electrode in order to implement the differential amplifier.
Electrode placement is important when using any of the electrode types described above. With the bipolar electrode the optimal position of the electrodes is parallel to the muscle fibers in order to maximize the probability of reading the same signal. electrode placements and the resulting potentials. the desired position for electrodes is on the belly of the muscle and not on the outer edge of the muscle where other muscles could interfere with the muscle under examination.






The preferred method of amplification for this application is differential amplification using a bipolar electrode and instrumentation amplifier. It is this methods ability to remove electromagnetic noise that the body has picked up that make it the most attractive for this application. The main specification that must be considered when selecting an instrumentation amplifier for this task is its CMRR or common mode rejection ratio. When the input signals are subtracted and the difference amplified, there is a residual signal amplified that is common to both inputs. The CMRR, represented in dB, is the measure of the ratio of the amplified signal to the amount of amplification of the signal common to the inputs. In the case of EMG amplification the common signal is most commonly noise so this specification plays a critical role in acquiring an accurate signal. A reference electrode is used like that seen in figure this electrode is used to create a common body reference signal which will increase the amplifiers ability to remove the unwanted commonalities of the inputs.







The power for the device will come via two standard nine volt batteries supplying the positive and negative rail voltages. The logical voltage and motor voltage will be supplied using a LM7805 +5 voltage regulator.




The burr-brown INA 2128 instrumentation amplifier was selected for this design due to its high CMRR at high gain. The CMRR of the INA2128 at a gain of 1000 is about 130 dB, which is more than sufficient for this design. The first stage of the amplifier is shown in the figure 4, to calculate the resistance for a certain gain, equation 5.1 can be used



Ga =1+50k ohm /2R where,R =R1+R2 ....................[5.1]


for the first amplification stage a gain of around 1000 is desired


R = 50 K ohm/999*2 = 25 ohm ...............................[5.2]



figure 4. preamplifier stage
The initial amplified signal is high passed filtered; this filtering is used to remove the motion artifact of the signal. For this a cutoff frequency of 30 hertz was chosen. This value was chosen to make certain that all motion artifacts would be removed. It was decided that the frequency content that will be removed from the signal was negligible. For the reason that an active electrode will be used in this design, it is preferred to have a minimal amount of components in the first stage that will be located on the electrode. For this reason an active filter was not used for this high pass filter and a simple RC type filter was implemented.






After the initial amplification and filtering stage the signal is amplified further. Further amplification is needed due to the small magnitude of the signal being acquired. As stated earlier the signal can be in the microvolt range so an amplification of 20k or more is in the desired range. Using equation 5.3, the gain of this amplification stage was set to be variable between 0 and 200, giving a final maximum gain of 197k


Gpre = 1+50 k ohm/54 Gvar = 1+ r7/r5 ............[5.3]

Gpre = 926. Gmax var = 1+ 100 k ohm / 470 ohm
Gmax var = 213
Gtotal = Gvar*(means , multiplication) Gpre
= 197 k




figure . variable gain amplifier.........




Rectifier and Low Pass Filter



The control system that will be used for the servo gripper will read an analogue voltage.







figure : half wave rectifier


Since the nature of the EMG signal is alternating with many different frequency components the signal must be processed such that we obtain a smooth analog output. The first step to accomplishing this task is to rectify the signal and obtain the positive portion of the voltage waveform. Following this the signal must be low passed filtered to smooth the ripples in the signal. There is a tradeoff in selecting the low pass filter cutoff frequency however; that is a lower frequency will take longer to respond to changes in the users actual muscle force. A higher frequency cutoff on the other hand, will cause a higher ripple voltage which will give skewed data when an analog to digital conversion is made. A cutoff of 0.3 hertz was chosen experimentally as an optimal value for this application. Figure 6 and 7 show the implementation of this stage.





figure : low pass filter.





Bias Adjustment






The final stage of the EMG amplifier is a bias adjustment. The signal may have some DC offset at this point which is undesirable for the next stage of the servo control system. This stage, shown in figure 8 will be used to eliminate this DC offset using a summing amplifier with a variable, negative supply input. Equation 5.4 shows how this amplifier is used to adjust the dc offset of the signal.







figure :- bias adjustment.

V emg_ out = V in* Av + V bias.


where , Av = 1 + R20 / R19 + R 22 and ,

0<= V bias <= -9


Therefore it can be seen that this stage adds a negative voltage to an amplified version of the input signal, where the gain can vary from unity to 1.319.

control system part in second post. ( contd.)














































important files of my project..





[1]. A BLOCK DIAGRAM OF MYOELECTRIC HAND..




















[2]. HISTORY:-






Prosthetic hands give hope for amputees to recapture their ability to perform complicated
physical movements of the lost human hands. Electromyography (EMG) is a suitable approach
for human-machine interface in the prosthetic hands control. The first artificial hand controlled
by EMG was developed in Russia by A. E. Kobrinski in 1961. The Otto Bock Orthopedic
Industries developed an EMG controlled multi-finger hand in 1965. In 1980’s and 1990’s,
high-tech solutions were emerging which used new material and miniaturized components. Users
can comfortably wear the lightweight electrically powered prosthetic hands during an eight hours
day . Integrated with modern computer system the future prosthetic hand probably can
accept command direct from the human nerve system and perform multiple tasks. This technique
can also be used in robot hand control such as remote dextrous manipulation devices , or
teleoperation.






[3] ELECTROMYOGRAPHY:-





The Electromyography (EMG) is the signal measured by placing conductive elements or
electrodes on the skin surface, or invasively within the muscle. Surface EMG, or skin EMG is
used more often because its non-invasive character makes it safer and easier to use. The
Electromyography (EMG) is useful in the field of both medicine and engineering. This section
describes the relevant background knowledge on muscle architecture and how the muscle
electricity is generated and detected.




[3.1] muscle physiology:-





The skeletal muscles implement our body movements. They are attached to adjacent
bones via tendons, and function to induce movement at the joint formed where the two bones
meet. Skeletal muscle comprises the largest single organ of the body. Each of these individual
muscles is composed of single cells or fibers embedded in a matrix of collagen.
The muscle cells are roughly cylindrical, with diameters between 10 and 100 um but up
to a few centimeters long. They may be arranged in parallel and bound by a connective tissue
envelope into a homogeneous bundle. A myofiber is a multinucleated single muscle cell. It’s
basically water with some dissolved ions separated from the extra-cellular space that is mostly
water with some dissolved ions. It generates a potential difference across its cell membrane by
having different concentrations of ions.
The fibers are excitable cells. Excitation signals are received at the synapse. Then a rapid
depolarization occurs and is coupled with a contraction. It’s a process during which
electrochemical events occur. The action potentials are propagated along the sarcolemma, or cell
membrane, toward the end of the fiber and downward from the surface into the transverse tubular
system. The propagation of the action potential along a nerve or muscle fiber includes the flow
of ions and gives rise to extra-cellularly recordable potential gradient. These potential gradients,
moving in both time and space, constitute the electricity as recorded from active muscle fibers
. Thus the small currents are generated prior to the generation of muscle force.
The myofibers are the smallest complete contractile systems and are arranged in
functional units called motor units. A motor unit is simply the cell body (motor neuron), its axon
and all of the muscle fibers that it innovates (attaches to provide the signal for contraction). Each
motor unit has a characteristic innervation ratio that is the number of muscle cells (muscle fibers)
controlled by one neuron. The number of muscle fibers belonging to a single motor unit varies
widely from muscle to muscle. One whole muscle has many motor units.




[3.2] acquisition of emg :-





As the brain's signal for contraction increases, it both recruits more motor units and
increases the "firing frequency" of those units already recruited. All muscle cells within one
motor unit become active at the same time. By varying the number of motor units that are active,
the body can control the force of the muscle contraction. When individual motor contract, they
repetitively emit a short burst of electrical activity known as the motor unit action potential
(MUAP). It is detected by electrodes on the surface of the skin in proximity of the motor. The
detection is illustrated in the following figure ...









The function unit of a muscle is the motor. All the fibers which belong to one motor are
activated at the same time. The motor unit action potential (MUAP) is the electrical response to
the impulse from the axon. A MUAP looks like the following figure.action potential per one motor unit..









The primary factors that determine the shape of a MUAP are the diameter and
geometrical arrangement of the muscle fibers, the tissue filtering effect, and the properties of the
recording electrode and instrumentation.
The contraction of a muscle recruits a number of motors during a period of time. When
several motor units are active (the timing of the electrical burst between distinct motor units is
mostly uncorrelated), a random interference pattern of electrical activity results. The time
between successive bursts is somewhat random for each motor unit.
EMG technology enables us to record the action potentials from an entire muscle or a
large portion of it by putting electrodes on the surface on the skin. It is a summation of the
interfered motors’ MUAP, which is also the summation of small currents from the fibers
belonging to variant motors. Therefore it looks quite different with MUAP. The following Figure
shows how the detected EMG signals and its spectrum appear. We can observe that the EMG
signal of greatest amplitude is detected by put the electrode at proper locations on the surface the
muscle .



It is well established that the amplitude of the EMG signal is stochastic (random) in
nature and can be reasonably represented by a Gausian distribution function. The instantaneous
value of EMG signal contains no information. The random nature of the action potential of the
motor makes EMG to be stochastic. The usable energy of the signal is limited to the 0 to 500 Hz
frequency range. Usable signals are those with energy above the electrical noise level . There
are many factors that influence the EMG signals’ detection. These include the electrode structure
and its placement on the surface of the skin above the muscle. The physiological, anatomical and
biochemical characteristics of the muscle can also influence the EMG signals
.

[4]. blockdiagram description of upper figure shown first..


The nerve system sends action potentials to the muscle cells. Then small currents are
released immediately. The EMG signals are detected with the electrodes on the skin surface of
the amputees remaining limb. The raw analog EMG signals are collected and pre-processed
(filtering, sampling, etc.) and then converted to the raw digital EMG data. These digital data are
sent to an integrated microprocessor system for the feature extraction and classification. Then
signals for position and force control are computed. The motors’ drivers produce the actual hand
motion based on the control signals.
This control scheme is capable of recognizing a multitude of volitional prehensile
movements, making the hand control transparent in a sense that the subject can move the hand in
a most natural way as if he/she would do with a healthy hand .
The feature extractor and grasp classifier modules are important to this control scheme
because the real time response depends much on if a shorter time period of signal can be used to
produce a good classification accuracy.

Friday, October 16, 2009

first of all starting with my project THE DESTINATION.



THE DESTINATION





















now my last sem.is going to come means the sem. of project and training so i have decided to do a project on something different means a good one...
so , when i was thinking abt that i suddenly saw a link of artificial arm, controlled with emg signal. than i thinked about it. it was quite desirable. i choosed it . and decided my partners {means- project}. name of them are ANKUR , PRAFFUL and ofcouse me.
finally , THE DESTINATION starts...
i know i definitely done.....[ A MYOELECTRIC PROSTHIC { ROBOTIC } ARM ]...........