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






No comments:

Post a Comment