Friday, June 18, 2010
Thursday, October 22, 2009
important files for my project ( part-2)
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.
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.
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
Tuesday, October 20, 2009
important files [2] for my project. ( part -1 )
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.
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 examinationThere 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.
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.)
[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