International Journal of Scientific & Engineering Research Volume 2, Issue 12, December-2011 1

ISSN 2229-5518

Active Prosthetic Knee Fuzzy Logic - PID Motion

Control, Sensors and Test Platform Design

Ammar A. Alzaydi, Albert Cheung, Nandan Joshi, Sidha Wong

AbstractThe purpose of this paper is to describe and evaluate the design and testing of a control system and test platform for an Active Prosthetic Knee (APK). The research scope includes mechanical design, sensing system, and motor (motion) controller of the Active Prosthetic Knee. The main objective is to produce an affordable yet rugged active prosthetic for above-the-knee amputees in developing countries. The main advantage of an active prosthetic is its ability to more accurately mimic the motion of a healthy limb without producing strain on the patient’s muscles. The APK needs to be able to decide when to move by analysing the motion of the healthy leg without the use of expensive sensory system.

Index TermsActive Prosthetic, Controller Design, Fuzzy Logic, Gait Cycle, PID Control, Platform Design

—————————— ——————————

1 INTRODUCTION

he field of prosthetics has been in development for thou- sands of years. Historical records show that research into prosthetics was undertaken during the time of the ancient Romans, Egyptians, and Greeks. Modern day prosthetics can be divided into active and passive devices. Passive prosthetics require the patient to move the prosthetic device with their own effort. Often times this can be difficult since passive prosthetics cannot fully mimic the motion of a healthy, func- tioning limb. Active prosthetics aim to solve this problem by using their own power source and sensors placed on the pa-
tient to move with the patient [1].

1.1 Background

Current active prosthetic knee joints such as the Ottobock C-Leg offer the most advanced treatment for above-the-knee amputees. However, this technology comes at a high price and is far too expensive for amputees in countries such as Afghanistan where the average salary is only $300/yr [2]. The only type of above-the-knee prosthetics available in such countries are passive devices which are cumbersome and do not fully restore a person’s previous degree of mobility and freedom.

1.2 Needs Assessment

Currently there are between 300,000 and 400,000 people around the world living with landmine related injuries. Most of these injuries involve leg amputations. Current active pros- thetics cost between $30,000 and $45,000, placing them out of reach of most of the people that are affected by landmines [3]. In addition, current active prosthetics need to be calibrated to suit each individual patient and it is impractical for them to be mass manufactured and deployed around the world. There- fore there is a clear need for an affordable, reliable, and prac- tical active prosthetic knee device.

————————————————

Ammar A. Alzaydi: B.Sc., M.A.Sc., Ph.D. Student, Mechanical and Me- chatronics Engineering. University of Waterloo, Waterloo, On., Canada. E-mail: aalzaydi@engmail.uwaterloo.ca

1.3 Problem Formulation

The goal of this project is to develop an active prosthetic knee that uses the position of the healthy leg to determine the position of the prosthetic knee. The position of the healthy leg is tracked using sensors mounted on the healthy tibia and fe- mur. This data is sent to a controller that modulates the amount of torque applied to the prosthetic knee. The purpose of this project is to continue the work started by three previous masters’ level collegues who finished the fabrication of the APK prototype. This work includes: designing a sensor sys- tem to track the motion of the healthy leg, programming a controller to manipulate the prosthetic knee, and designing a test platform to evaluate the performance of the completed system. Specific design constraints for each of the project’s components are discussed in the next section.

1.4 Design Criteria and Design

The sensing system and the controller should work to- gether to accurately mimic the human gait cycle [4]. Specifi- cally, the sensor and control system should meet the following constraints:
1. Mimic a human gait at a steady walking speed of 1.5 m/s.
2. Control the knee over a range of motion of between 0°
and 30°.
3. The sensors should require little to no calibration.
4. The sensors should be easy to wear and should not inhibit the motion of the healthy leg.

5. The wireless sensors should accurately measure the angle of the femur and tibia and wirelessly transmit the data to the controller.

The test platform is being designed to evaluate the perfor- mance of the APK over a steady walking cycle for a 50th per- centile male [5]. The APK will be mounted to an artificial fe- mur that will replicate the motion of an amputated femur. Specifically, the test platform should meet the following re- quirements:

IJSER © 2011

http://www.ijser.org

International Journal of Scientific & Engineering Research Volume 2, Issue 12, December-2011 2

ISSN 2229-5518


1. Replicate the femur’s range of motion of -20° to 30°.
2. The system should match a walking speed of 1.5 m/s.
3. The swing speed and acceleration should be 5.08 rad/s and 230 rad/s2, respectively.
Overall, the entire APK should cost under $3000, be com- patible with a broad range of physiques with minimal calibra- tion, and generally have an aesthetic appearance.

2 PATENT SEARCH

A search of the Canadian Intellectual Property Office and US Patent databases shows five different approaches towards the design and control of an active prosthetic knee. Although all five patents discuss new and novel methods for controlling an active prosthetic, none of the patents use the control ap- proach outlined in this paper or utilise the same pulley-ball screw mechanism as the APK. Therefore the project described in this paper is patentable. The patents are discussed in detail in the following paragraphs.
Fig. 1. Operation: The knee joint (18) is connected to the ti- bia (10) via a hydraulic fluid control unit (20). The hydraulic piston lengthens and shortens to simulate the movement of a knee.
Key Differences: Use of hydraulics to actuate the knee joint.
No mention of how the speed of the piston is controlled.
Fig. 2. Operation: The amputated femur (104) sits in a
housing (102). A variable-torque damping system (130) is con-
trolled by (120) to simulate movement of the knee. A knee-
angle sensor measures the angle of the prosthetic knee, and
compares this value with a pre-programmed gait cycle to de-
termine the next movement.
Key Differences: Angle sensor is mounted on the prosthetic knee. Use of MR fluid to provide knee actuation.

Fig. 2. Speed-Adaptive and Patient-Adaptive Prosthetic Knee: CIPO

#02405356

Fig. 3. Prosthetic Knee Joint: CIPO #02108378

Fig. 1. Hydraulic Control Unit for Prosthetic Leg: CIPO #02056134


Fig. 3. Operation: The amputated femur sits in a housing (28) which is connected to the knee mounting plate (24). A motor (16) in the tibia section drives a worm gear (44). The worm gear turns the main drive gear (46) which uses cables to turn a gear segment (36). The gear segment simulates the knee joint by rocking back and forth along the rack gear (32).
Key Differences: Use of cables and pulleys to actuate knee joint. Proposes the use of myoelectric (EMG) sensors for con- trol.

IJSER © 2011

http://www.ijser.org

International Journal of Scientific & Engineering Research Volume 2, Issue 12, December-2011 3

ISSN 2229-5518

Fig. 4. Electromechanical Joint Control Device: US Patent #6834752


Fig. 4. Operation: A controller operates a linear solenoid (156) which extends or retracts to turn the knee joint (183). Two force sensors mounted on the sole of the foot send vary- ing electrical signals based on what part of the gait cycle the foot is operating in. An angle sensor mounted on the knee provides feedback.
Key Differences: Use of force sensors on prosthetic foot. Use of solenoid to actuate the knee joint.
Fig. 5. Operation: A hydraulic damper (26) actuates the
knee joint (30). The gait cycle is programmed into the micro-
controller. Four strain gauges mounted on the prosthesis
monitor the bending moment strain on the frame. Each part of
the gait cycle is associated with a certain bending moment. A
Hall-effect sensor monitors the angle of the knee for feedback.
Key Differences: Use of strain gauges to determine phase
of gait cycle. Use of hydraulic damper to actuate knee joint.

3 ABSTRACTION

The mechanical prototype of the APK has already been fa- bricated by previous collegues who worked on this project. Therefore, this section will focus on the different alternatives considered for the design and implementation of the sensor system, wireless angle measurement, fuzzy logic controller, and APK test platform.

Fig. 5. System for Controlling Artificial Knee: US Patent #5571205

3.1 Sensing System

The input sensors are required to determine the position of the leg with respect to the human gait cycle shown in Fig. 6. The sensors are part of a feedback control system where the system has the ability to know the exact state the user is in and the capability to forecast later states based on previously en- countered information [6].

The two sensors considered are electromyography (EMG) sensors and accelerometers. The sensors will be installed on the healthy leg to determine which phase the prosthetic knee should be in.

Fig. 6. Phases of the Human Gait Cycle

IJSER © 2011

http://www.ijser.org

International Journal of Scientific & Engineering Research Volume 2, Issue 12, December-2011 4

ISSN 2229-5518

Fig. 7. Stick Diagram of Gait Cycle


Electromyography (EMG) is a technique for evaluating and recording the physiological properties of muscles at rest and during contraction. An EMG sensor detects the electrical po- tential generated by muscle cells when these cells contract, and also when the cells are at rest. The accelerometers are used to calculate the angle of the healthy femur and tibia dur- ing the course of the gait cycle. The angle of the healthy femur and tibia is used to pin point the user’s movement during the gait cycle and provide the information required to predict the timing for future phases [7].

3.2 Wireless Sensor System

A wired or wireless approach can be taken for communica- tion between the sensors and the microprocessor. The wired solution has the advantage of transmitting information at rela- tively high speeds in a dedicated channel for communication that is not as susceptible to interference as a wireless solution. The limitation of the wired solution is the length of the cable connecting the sensors to the microprocessor. In order to in- crease the practical applications of the APK the wireless solu- tion has been given focus to improve the device after success- fully proving the working system with a wired solution. Standardized communication protocols such as Wifi, Blu- etooth, and Zigbee are considered within the various wireless solutions available. Solutions that do not have standardized communication protocols consist mainly of hardware operat- ing at specific frequencies, for which the method of handshak- ing that occurs between the transceivers needs to be deter- mined as part of the project specifications [8].

3.3 Controller Design

As mentioned in section 1.3 – Problem Formulation, the goal of this project is to develop an active prosthetic knee which uses the position of the healthy leg to control the mo- tion of the active prosthetic knee. The challenge associated with gait analysis and control is the uncertainty in tracking the human locomotion within a gait cycle. In addition, the chang- ing dynamics of the system such as the variable ground reac- tion forces require a system that is either highly adaptive or modular. This idea motivates the research of implementing an artificial neural network or fuzzy logic based controller. Each approach has different characteristics which are outlined in
the following points.
 Neural networks systems are excellent interpolators
whereas fuzzy logic systems are highly modular and can handle uncertainty.
 A fuzzy logic system does not require training whereas a neural network does require training.
 Continuous online-training of the neural network makes it computationally expensive.
 A neural network has to be retrained if disturbances are
introduced to the system whereas fuzzy logic can make intelligent decisions even with imprecise input data.
 Fuzzy logic implementation allows for use of inexpensive sensors which reduces overall cost.
Both implementations are valid solutions for developing the intelligent control system. However, both cost and effi- ciency need to be considered when selecting one design over another.

3.4 Test Platform Design

The purpose of the test platform is to simulate the human gait cycle during a steady walking motion. In other words, the test platform must allow the APK to match the position of the tibia shown in Fig. 7. As Fig. 7 shows, the entire leg has motion in the vertical, horizontal, and angular directions. Therefore, 3 DOF are required to accurately simulate the mo- tion of the human gait cycle.

The three designs considered for the test platform are de- scribed in the following paragraphs.

Fig. 8. Angled Piston Design

Angled Piston Design: The first design uses three pistons to provide the 3 DOF. As seen in Fig. 8 each pneumatic piston provides one DOF. The horizontally mounted piston slides along in a machined groove, while the vertically oriented pis- ton replicates the movement of the hip. The blue piston

IJSER © 2011

http://www.ijser.org

International Journal of Scientific & Engineering Research Volume 2, Issue 12, December-2011 5

ISSN 2229-5518

changes the angle of the femur by pivoting the vertical piston about the joint connecting the horizontal and vertical pistons. The vertical piston represents the femur.
walks along the treadmill it will move in the vertical direction along 4 rods. This design is shown in Fig. 10.

Fig. 9. Cartesian Piston Design


Cartesian Piston Design: A simpler version of the pre- vious design can be seen in Fig. 9. In this design the 3 pistons still provide 3 DOF but are installed in a more conventional arrangement. The blue piston provides horizontal movement, the beige piston provides vertical movement, and the red pis- ton changes the angle of the femur (shown in white).

Fig. 10. Single Piston Design

Single Piston Design: This design uses a single position to simulate the angular movement of the femur, and a set of springs to simulate the limited vertical movement of the hip. Horizontal movement is not simulated directly as in the other two designs. Instead, the APK will be made to walk along a treadmill mounted in the base of the platform. As the APK

Fig. 11. APK Mechanical Design

4 PROPOSED SOLUTION

The APK is a microcontroller-operated knee prosthetic de- vice with a single degree of freedom (DOF) at the knee joint. A DC motor is connected to a pulley system that drives a nut. The nut moves a ball screw up and down to create a pivoting action about the knee joint. The prototype and its main com- ponents are shown in Fig 11.
The entire structure is fabricated from an aluminium 6061 alloy for enhanced weight-strength characteristics. The proto- type is designed to handle a maximum dynamic load of 2000
N to replicate the mass of a 70 kg subject, with a safety factor of three. The motor is a high-speed, high-torque DC brushed motor with a peak operating speed of 7468 RPM. Since the focus of this project is on the design of the sensors, control system, and test platform, the following sections will provide more detail into the proposed solutions for these components instead of the design of the APK.

4.1 Sensing System Proposed Solution

The two approaches considered for the sensing system have a number of differences. The main difference involves the electronic aspect of the control system. The EMG signal must be amplified and filtered to produce a usable data set for the microprocessor. The angular model requires additional inputs in the form of foot contacts to further complete the var- ious gate cycle phases. Table 1 compares the two alternatives using five key criteria. Each alternative is assigned a grade between 0 and 5, with 5 being the highest grade.

IJSER © 2011

http://www.ijser.org

International Journal of Scientific & Engineering Research Volume 2, Issue 12, December-2011 6

ISSN 2229-5518

TABLE 1

EMG SENSOR VS. ACCELEROMETERS

Design Criteria

EMG Sensors

Accelerometers

Number of Sensors

5

4

Calibration Re- quired

2

4

Reliability

3

5

User Comfort

2

4

Ease of Implementa-

tion

2

4

Total

14

21

Based on the evaluation criteria the accelerometers are the favoured solution for the sensing system.

4.2 Wireless Sensor System

The chosen solution uses the Bluetooth protocol within the Nintendo Wiimote as the main transceiver. The advantage of this solution is that the accelerometers can be used to measure angle of the human femur and tibia bones, which are also the inputs for the control system. To narrow down the list of de- sign alternatives only wireless solutions with a set of standar- dized communication protocols are considered since the de- velopment of such protocols is not part of the project scope. In addition, the technical specifications of the protocols are ex- amined to determine which method does not meet the project specifications. Lastly, protocols with specifications which best meet the operating conditions of the project are evaluated. Based on these criteria Bluetooth is the only viable wireless protocol. To ease the implementation off-the-shelf units such as the Nintendo Wiimote and the Sony Playstation SIXAXIS controllers are considered since both use Bluetooth for com- munication and have built-in accelerometers built. A compar- ison of the two controllers is shown in Table 2. Each alterna- tive is assigned a grade between 0 and 5, with 5 being the highest grade.

TABLE 2

WIIMOTE VS. SIXAXIS

4.3 Control System Proposed Solution

The uncertainty involved in tracking the walking patterns of the human gait necessitates the use of a fuzzy logic or artifi- cial neural network based controller. However, as mentioned previously, using a neural networks approach requires online supervised-training of the system due to the varying dynamics of the system. The issue with online training is it requires more processing time which may slowdown the system re- sponse and reduce the performance of the controller. Al- though this can be overcome by using a faster and more po- werful processor one of the main objectives is to develop a cost-effective solution. A morphological table comparing the use of neural networks to fuzzy logic for the controller imple- mentation is shown in Table 3. Each criterion is assigned a grade between 0 and 5 where 5 represents the highest score and 0 is the lowest score.

TABLE 3

NEURAL NETWORK VS. FUZZY LOGIC

Design Criteria

Neural Networks

Fuzzy Logic

Speed of Computa- tion

2

4

Minimal Level of

Training

2

4

Ability to Handle

Uncertain Data

3

5

Reduced Sensor Cost

3

4

Ease of Implementa-

tion

2

4

Total

12

21


The approach of using a fuzzy logic based controller enables the system to integrate human intelligence into the control system while benefiting from reduced processing asso- ciated with online training. The initial fuzzy logic-based con- troller is shown in Fig. 12.

Input Data Output

Thigh Angle

Leg Angle

Fuzzy-Logic

Controller Knee Torque

Fig. 12. Feed Forward Fuzzy Logic Control Architecture

The Nintendo Wiimote is chosen based on its superior support and lower cost. In terms of hardware community support and the number of functions that meet the project specifications, the Nintendo Wiimote has a hardware commu- nity that is much larger and can give much needed support during the project development and also provide adequate functionality.

4.4 Test Platform Proposed Solution

As mentioned earlier, the purpose of the test platform is to provide a platform that can be used to evaluate the perfor- mance of the APK under a steady walking gait cycle. There- fore the chosen design must satisfy the performance con- straints associated with the steady walking gait, and meet the proposed budget of $1000. The three designs are evaluated in the morphological Table 4. Each design is evaluated accord- ing to four criteria and is assigned a grade between 0 and 5, with 5 being the highest grade.

IJSER © 2011

http://www.ijser.org

International Journal of Scientific & Engineering Research Volume 2, Issue 12, December-2011 7

ISSN 2229-5518

TABLE 4

TEST PLATFORM DESIGN EVALUATION

The radial acceleration measured by each accelerometer in the x direction is:

(1)

Where ω is the angular velocity. The radial acceleration
measured by accelerometer 2 is:
(2)
The difference of the two accelerometers yields the result below:
Design 3 is the clear victor in this comparison since it has the simplest design, can simulate vertical and angular move- ment, can replicate the gait cycle, and has the lowest projected cost.

5 DESIGN

Each section requires a detailed design to meet the re- quired criteria and constraints. This section builds on the pro- posed solution outlined in the previous section by describing the design of the sensing system, controller, and test platform.


(3) (4)
Also, the tangential acceleration (y-direction) can be meas- ured by the equation:
(5) Where α is the angular acceleration. The tangential accele-
ration measured at accelerometer 2 is:

5.1 Sensing System Design

Accelerometer Setup: The sensing system is designed us- ing two three-axis accelerometers mounted on each axis of the human leg. In other words two accelerometers are mounted on the healthy femur and two more are mounted on the tibia. Although one accelerometer can be used to record a static an- gle, it is difficult to record a dynamic angle using just one ac- celerometer. The difficulty in cancelling out the motion of the

Again, taking the difference:
(6)
(7) (8)
leg can be overcome by using two accelerometers with a one- axis methodology.
This algorithm utilizes two accelerometers separated by a
distance D to determine the angular acceleration and velocity.
Using this, the result can be integrated to find the angle tra-
velled. The downside to this algorithm is that the leg will re-
quire occasional calibration. The theory involves two accele-

rometers mounted a distance D (r2-r1) apart as in Fig. 13.

Fig. 13. Accelerometer Placement


It is important to note that the center of rotation does not
matter; only the distance between the two accelerometers, D.
The readings are taken by the microcontroller at a certain fre-
quency and this can be used to find the angle travelled.
The angle and the sign of the movement can be determined
using the velocity and acceleration. The measurements in this
study can verify that two linear accelerometers can be used to determine angular rotation rates.
This method works best when the rotational motions are quick, and have large angular accelerations to avoid any di- vide-by-zero errors. Drift is not a problem since integration only takes place for a short time. Angular accelerations need to be lower than the accelerometer sensing range. This me- thod does not work as well when angular accelerations (αy and
αz) are very small since the algorithm relies on knowing the
sign (+/-) confidently. There is some sensitivity to offset and
sensitivity differences between the two sensors. Therefore,
some method is needed to compensate for sensor mismatch,
such as a calibration on start-up. Selection of the ω threshold
(ω ) is dependent on sensor performance and the expected

t

motions in the application.

IJSER © 2011

http://www.ijser.org

International Journal of Scientific & Engineering Research Volume 2, Issue 12, December-2011 8

ISSN 2229-5518

Circuit Design: The circuit is designed to take the output of the two accelerometers, compare them ( and

), and output the resultant voltage to the microcon- troller. The op-amp circuit shown in Fig. 14 performs the sub- traction of and and also increases the gain of the system.

Fig. 16. DC-DC Converter

Fig. 14. Accelerometer Circuit

It is important to note the supply of 7.2 V from the DC to DC converter. This is the voltage of the battery; however for the purposes of the circuit the supply voltage has to be regu- lated to 5 V and inverted to -7.2 V.
The voltage is regulated to 5 V for the accelerometer supply using a standard 7805 voltage regulator and a DC-DC converter shown in the circuit in Fig. 15. Since the capacitors in this circuit are used to ―smooth‖ out or remove noise from the circuit their value can be varied depending on the desired characteristics. For this project the capacitors are not needed to obtain a high quality accelerometer rating and are removed altogether.

5.2 Wireless Sensor System Design

software development of the wireless communications is divided into three phases which helps systematically work from the flexible programming language of C++ to the highly specialized C code for the specific microprocessor used for this project.
Phase 1 involves the development of a utility in C++ that can connect with the Wiimote through the USB Bluetooth dongle and access the accelerometer measurements from both the Wiimote and the Nunchuck controller.
Phase 2 involves porting the C++ code into C code before it is modified to operate on the microprocessor in the third phase. Design of the wireless communication involves the Nintendo Wiimote which initially communicates with the computer via a USB Bluetooth module in the first two phases of the software development stage.

Phase 3 of the software development includes the Wiimote connecting to a Bluetooth module on the microprocessor side instead of a computer. The Bluetooth module connected to the microprocessor communicates through the serial port and acts as a transceiver between the Wiimote and the microprocessor.

Fig. 15. Voltage Regulator

The inverting circuit is used to invert the voltage from a +
7.2 V value to a -7.2 V value. This is done using a DC-DC con- verter shown in Fig. 16. Providing a supply voltage to pin 8
will result in a negative voltage of the same magnitude from pin 5. This chip is very useful since prior to this a negative power supply was used alongside of a positive to provide the negative value.
The schematic of the overall circuit is shown in Fig. 17.

IJSER © 2011

http://www.ijser.org

International Journal of Scientific & Engineering Research Volume 2, Issue 12, December-2011 9

ISSN 2229-5518

Fig. 17. Overall Sensor Circuit

5.3 Control System Design

The fuzzy logic-based controller consists of a feed forward architecture designed from nominal empirical data. Conse- quently, a feed forward architecture is only sufficient under nominal conditions and will fail if excessive disturbance is introduced into the system. Therefore, the initial controller architecture is modified to include a feedback loop containing a proportional-integral (PID) controller which tracks the actual position of the APK. The error signal is calculated by compar- ing the actual APK position to the desired APK position and is fed into the PID controller which outputs a control signal (tor- que command) that supplements the output of the fuzzy logic controller. Hence the feed forward fuzzy control predicates which phase of the gait cycle the APK is in and outputs a no- minal output torque corresponding to the determined phase. Meanwhile the PID control compensates for excessive ground reaction forces (disturbances) by supplying additional torque to drive the APK to its desired position. The final control ar- chitecture consists of a fuzzy-PID controller which is shown in Fig. 18.

Fuzzy Logic Design: As mentioned previously, angular data from the healthy leg is fed into the fuzzy logic controller which determines the current phase of the APK and outputs an associated torque command to the motor. The fuzzy infe- rencing system (FIS) consists of two components: a set of input membership functions that map angular data to a set of phases within the gait cycle and a set of if-then rules which describe the human-like reasoning mechanism of the FIS. Each of the seven phases in the gait cycle has an associating membership function corresponding to the angle of the healthy femur and tibia. The membership function for both angular inputs is shown in Fig. 19.

IJSER © 2011

http://www.ijser.org

International Journal of Scientific & Engineering Research Volume 2, Issue 12, December-2011 10

ISSN 2229-5518

Fig. 20. Fuzzy Inferencing Mechanism (Simplified)

Fig. 18. Fuzzy-PID Control Architecture


A set of output membership functions for each rule is trig- gered based on the firing strength of its antecedents, similar to mapping angular data using a set of input membership func- tions. The implication (or fuzzified output) is aggregated to produce an overall fuzzy output which is then defuzzified using a centre of heights method. A simplified diagram show- ing the entire FIS mechanism is shown in Fig. 20.

Fuzzy Rule Base: The following points show the basic rules used to design the knowledge base of the fuzzy inferenc- ing system, where X1 and X2 are the angular inputs from the femur and tibia respectively. The seven phases LR, MST, TST, PSW, ISW, MSW, and TSW correspond to the loading re- sponse, mid stance, terminal stance, pre-swing, initial swing, mid swing, and terminal swing, respectively.

IF X1 is LR

AND

X2 is LR

Then Y is LR

IF X1 is MST

AND

X2 is MST

Then Y is MST

IF X1 is TST

AND

X2 is TST

Then Y is TST

IF X1 is PSW

AND

X2 is PSW

Then Y is PSW

IF X1 is ISW

AND

X2 is ISW

Then Y is ISW

IF X1 is MSW

AND

X2 is MSW

Then Y is MSW

IF X1 is TSW

AND

X2 is TSW

Then Y is TSW


As with all control systems a method of tuning the system to optimize performance is an important aspect of the control- ler design. In the case of the fuzzy logic controller the parame- ters associated with the input and output membership func- tions (Gaussian distribution) such as the mean and standard deviation need to be tuned. The method used to tune the fuzzy parameters is known as ―adaptive network-based fuzzy inference system‖ (ANFIS). Similar to training an artificial neural network, training data is fed into the ANFIS which then outputs a set of optimized fuzzy parameters to be used in the actual fuzzy logic controller.

Fig. 19. Input Membership Functions

IJSER © 2011

http://www.ijser.org

International Journal of Scientific & Engineering Research Volume 2, Issue 12, December-2011 11

ISSN 2229-5518

Fig. 21. Software Main Loop

Embedded Design: The fuzzy-PID controller is developed on a 16-bit PICMicro microcontroller (MCU) operating at

32MHz obtained through an 8MHz internal clock with a 4x- phase-locked-loop (PLL) [9]. The 80-pin MCU is chosen since it satisfies all the necessary I/O and serial communication re- quirements, sufficient built-in flash memory capacity, and ex- ternal memory expandability at a low cost. The embedded system interfaces with all external peripherals such as the mo- tor driver, angular sensors, and a Bluetooth module. The em- bedded software for the overall controller is interrupt driven for the following purposes:

 Capturing encoder pulses used for acquiring speed and position data

 Ensuring all incoming serial data is properly received and stored in a buffer for processing

 Timer interrupts used in functions requiring integration

(i.e., integral control of the PID)

Aside from the interrupts used in the software the main program consists of sampling the ADC channels for accelero- meter data from the femur and tibia where a total of 4 ADC channels are used (2 for each segment of the healthy leg). The ADC data is converted to an angular velocity and using known initial conditions (initial position of the leg) the angu- lar velocity is integrated to get the angular position. The an- gular position of the leg is then passed into the run_fuzzyControl function which returns the output torque command and desired knee position of the APK. The run_PIDControl function takes in the desired knee position data and uses it to calculate the proportional, integral, and derivative terms of the PID control signal which is then con- verted to a secondary output torque command and sent to the motor driver via the Digital-to-analog Converter (DAC). Fig.
21 shows the execution path of the main loop of the software.

5.4 Test Platform Design


Based on anthropometric measurements the length of the femur is equal to the length of the tibia. Since the APK proto- type has a tibial length of 0.36 m, the length of the artificial femur is also 0.36 m. The femur is actuated by a pneumatic piston acting at the femur’s midpoint. Based on the required range of motion of -20° to 30° the required piston length is calculated to be 152mm using the geometry shown in Fig. 22.

Fig. 22. Piston Stroke Calculation

IJSER © 2011

http://www.ijser.org

International Journal of Scientific & Engineering Research Volume 2, Issue 12, December-2011 12

ISSN 2229-5518

Fig. 24. Revised Pneumatic Reciprocating Circuit Design

Fig. 23. Initial Pneumatic Reciprocating Circuit Design

The pneumatic system will reciprocate at a user-defined speed to replicate the motion of the femur. The speed of the piston is variable to allow the APK to be tested at higher speeds in the future. The bore of the piston is determined us- ing the maximum acceleration of the femur. Based on a mass of 6 kg for the entire leg assembly and an acceleration of 230 m/s2 the required bore diameter is 0.020m (see Appendix A for calculations). A 0.025 m bore diameter piston is used for a small factor of safety. Based on a required swing speed of 5.08 rad/s, the piston should have an extension speed of
0.9144m/s and a flow rate of 0.449 l/s based on a 0.025 m bore. Therefore the pneumatic system will require a double- acting piston with a 0.025 m bore and a flow rate of 0.449 l/s. The preliminary design of the reciprocating circuit is shown in Fig. 23.
The final cost of this design is $798.62. Since the budget for the test platform is only $1000, a simpler circuit needs to be designed. The new circuit is shown in Fig. 24. The total cost for this revised design is only $326.72.
The hip joint and pneumatic piston are supported by a top
plate that moves up and down a set of 1‖ diameter CRS shafts
to simulate the vertical movement of the hip. The APK will walk along a small treadmill mounted in the base of the plat- form. The top plate also provides a platform on which to mount weights to simulate the mass of a person. A labelled diagram of the test platform is shown in Fig. 25. The foot at- tachment is not shown in Fig. 25.

Fig. 25. Detailed Test Platform Design

6.0 DESIGN ANALYSIS

Based on the design outlined in the previous section this section will describe whether the proposed design meets the required specifications.

6.1 Sensing System Design Analysis

Consider the two three-axis accelerometers separated by distance D with X-axes aligned as shown in Fig. 26. The radial and tangential accelerations should be able to determine the angular velocity around the Y-axis (ωy, roll rate) and the Z-axis
z, yaw rate).

IJSER © 2011

http://www.ijser.org

International Journal of Scientific & Engineering Research Volume 2, Issue 12, December-2011 13

ISSN 2229-5518



(11)
When ω is nonzero ωy and ωz can be determined by inte- grating αy and αz. Thus the relative magnitude and direction of rotation are calculated from the integrals of the tangential accelerations.
(12)

Fig. 26. Two Three-Axis Accelerometers On a Rotating Rigid Body

The X, Y, and Z-axis accelerations of both accelerometer #1 and accelerometer #2 are sampled to calculate the rotational rates. Keeping a running average (around 5 samples at 60 Hz) of the accelerations will reduce noise. The total rotation rate magnitude (ω) is calculated directly from radial acceleration as shown in Eqn. 9. Any ω that is below a threshold (ω ) is set to 0

t

(13)
Since the angular accelerations, αy and αz , rise before ω, it is necessary to add the integral of αy and αz from several time steps before ω crosses the ω threshold. This timing is shown

t

in Fig. 28.
[10].
When ω ≥ ω

t

ω = 0 when ω < ω


(9)

t . The magnitude of the total rotation rate

magnitude calculated using equation 9 is shown in Fig. 27.
vector sum of ωy and ωz from Eqns. 12 and 13 is equal to the
magnitude of the total angular rotation rate, ωtotal.


(14)

Fig. 27. Total Rotation Rate Magnitude

Using the total rotation rate magnitude calculated in Eqn. 9 and the relative magnitude and direction of rotation obtained from Eqn. 12, we can determine the yaw and the roll.
The total rotation rate is now known but the direction (sign) and the rotation rate about the Y-axis (roll) and the Z- axis (yaw) are still unknown. The angular accelerations about the z-axis and y-axis are calculated from the Y-axis and Z-axis accelerations using equation 8:

(10)


(15) (16)
An example of the calculated yaw and roll rates is shown
in Fig. 29.

IJSER © 2011

http://www.ijser.org

International Journal of Scientific & Engineering Research Volume 2, Issue 12, December-2011 14

ISSN 2229-5518

Fig. 30. Normalized Knee Torque Vs % Stride

Fig. 29. Examples of Yaw and Roll Rates

6.2 Wireless Sensor Design Analysis

The basic requirement of this aspect of the project is to fur- ther improve the system by using a wireless communication method. The use of the Bluetooth modules in the first and second phase of communication development meets this basic requirement. Use of Bluetooth also meets the requirements of improving the comfort of the device and also meets the small power requirements. The Wiimote accelerometers also meet the requirement of filtering the sensor signals and implement- ing a method for using the sensors to determine the phase of the gait cycle of the healthy leg.

6.3 Control System Design Analysis

To show that the design of the fuzzy logic system meets expectations, a database of simulated input data (training da- ta) is inputted into the controller. The graph in Fig. 30 represents the normalized knee torque vs. % stride where the vertical lines on the graph shows the torque deviation. As shown in Fig. 31, the ANFIS output resulting from the training data set follows the desired knee torque trend of Fig. 30. This theoretical analysis in Matlab proves the fuzzy logic controller produces highly accurate results under nominal conditions.

6.4 Testing Platform Design Analysis

The test platform has been designed to simulate a range of motion between -20° and 30° [11]. This range of motion is met in the design and is shown in Fig. 32.
The extension and retraction speed of the reciprocating pneumatic has also been verified to be correct.

7.0 MANUFACTURING, TESTING, AND COMMISSIONING

This section will discuss the results of the finished proto- type and whether it met the specified design requirements. Overall the system met the specified design requirements.

Fig. 31. ANFIS Output Result from Training Data

Fig. 32. Test Platform Range of Motion

7.1 Sensing System

The algorithm can be tested by mounting two accelerome- ters on a rigid body separated by a distance of 9.2cm. A gyro is also mounted on the rigid body to compare the angular rate determined by the two accelerometers to the angular rate out- put of the gyro. Fig. 33 and Fig. 34 show the results of the test- ing.

IJSER © 2011

http://www.ijser.org

International Journal of Scientific & Engineering Research Volume 2, Issue 12, December-2011 15

ISSN 2229-5518



As seen in the measurements this method works very well for short motions (<2seconds) of medium magnitude (140
°/sec to 1200 °/sec). Low magnitude (<140 °/sec) motions are not sensed because they are below the system resolution. Dur- ing long motions (>2 seconds) the integration error becomes large. Very large magnitude (>1200 °/sec) motions will cause error because the accelerometer outputs saturate. The finished accelerometer circuit is shown in Fig. 35.

7.2 Wireless Sensor System

Testing of the Wiimote and Nunchuck in the first and second phases of the software development involved success- fully acquiring the measured accelerometer of each controller. Initial tests confirmed that there were slight differences in the measurement of the two controllers even when they were oriented in the same position. A calibration process was then introduced to the program to allow for an initial calibration which would attempt to eliminate any offset that is present between the Wiimote and the Nunchuck.

Fig. 35. Completed Sensor Circuit


In the modified third phases of the software development where the first phase with the addition of the serial code be- came the replacement for the Bluetooth module to be con- nected to the microprocessor, initial testing involved sending specific strings of data to the microprocessor to determine if the serial communication had been properly set up. On both sides, a null modem was connected to first determine if both the computer and the microprocessor were indeed sending and receiving properly. Once the bugs for that stage were fixed, a serial link between the computer and microprocessor was established. After testing of the static string used in data transmission between the two components was successful, the actual accelerometer measurements were sent to the micro- processor from the computer. Additional code was added to the computer for converting the accelerometer readings into angle readings with the assumption that vertical and horizon- tal acceleration is not significant (for testing of working con- cept).

7.3 Controller

As mentioned in the previous section the final design of the control system differed from the initial design due to the lack of simulating a ground reaction force. As a result, posi- tion control is used in place of torque control. Therefore the feed forward fuzzy control portion is modified to contain only one output - the desired knee position of the APK. The feed- back portion consisting of the PID controller is modified to a proportional-integral (PI) controller since adding a derivative term resulted in an over-aggressive compensation for over- shoot. This overly aggressive overshoot compensation is a highly undesirable as it reduced the smoothness of the motion while adding some additional unwanted jerk. The resulting control system architecture is shown in Fig. 36.

IJSER © 2011

http://www.ijser.org

International Journal of Scientific & Engineering Research Volume 2, Issue 12, December-2011 16

ISSN 2229-5518


ceeding the allowable range of motion
Third, the Sony Playstation SIXAXIS controller should also
be tested to determine whether the gyroscopes in the SIXAXIS
controller provide a better measurement for controlling the
APK. The current use of the Wiimote and Nunchuck requires
two sets of such controllers to effectively cancel out the effects
of the horizontal and vertical accelerations associated with
walking. Using gyroscopes over accelerometers may reduce
the number of sensors required to properly determine the
phase of the gait cycle.
Further work on the implementation of four three-axis ac-
celerometers should be investigated to verify that vertical and
horizontal acceleration can be cancelled resulting in a purely
angular input for the control system. The current simplified
system uses only two sets of three-axis accelerometers as in-
puts to the control system. Errors in control can occur when a
significant vertical and horizontal acceleration is measured.
To fully test out the control system the extra vertical and hori-
zontal accelerations need to be removed from the input to the
control system.

Fig. 36. Final Fuzzy-PID Control Architecture

Fig. 37. Test Platform Final Design

APPENDIX A







Pneumatic Sizing Equations


7.4 Test Platform

The final design of the test platform for the APK is shown in Fig. 37.
The finished test platform assembled from aluminium ex- trusions and provides 2 DOF. One DOF is provided by the pneumatic piston whereas the second DOF is provided by a set of springs in the hip joint that allow the joint to move in the vertical direction.

8 RECOMMENDATIONS

Based on the analysis in this paper the following initiatives are recommended.
First, the existing DC motor should be replaced with a ligh- ter unit to reduce the weight of the device. The current APK has a mass of approximately 6 kg, most of which can be attri- buted to the motor.
Second, as a safety measure, limit switches should be inte-
grated into the APK design to prevent the knee joint from ex-

9 SUMMARY

There is a large and growing need for affordable and rugged active prosthetics around the world. The aim of this project is to develop an active prosthetic knee that will use the position of the healthy leg to determine the torque required to actuate the prosthetic knee. The purpose of this paper is to describe the development of the control system and the test platform for the active prosthetic knee (APK).
The goal of this project is to develop a cost-effective,
rugged, and easy to calibrate prosthetic knee for above-the-
knee amputees. The scope of this paper includes the design
and implementation of: a sensor system to measure the posi-
tion of the healthy leg, a Wiimote to measure the position of

IJSER © 2011

http://www.ijser.org

International Journal of Scientific & Engineering Research Volume 2, Issue 12, December-2011 17

ISSN 2229-5518

the healthy leg, a fuzzy logic control system to control the DC motor, and a test platform to evaluate the performance of the finished prototype. Since a prototype of the APK has already been designed and fabricated by previous collegues this paper will not discuss in detail the mechanics of the prosthetic knee. Instead this paper focuses on the development of the control system and test platform.
Different methods are considered for the design of the sensing and control system. One of the main findings is the superiority of accelerometers over EMG sensors to determine the position of the healthy leg since accelerometers are more comfortable to wear and require less calibration. A fuzzy logic controller is used over a neural-network approach since a fuzzy logic approach is more capable at handling uncertainty in data and is based on empirical methods whereas a neural network requires training.
The completed prototype is capable of replicating a steady
walking gait and can receive angular measurements via the
accelerometers or the Wiimote. The test platform can fully
mimic the gait cycle of a 50th percentile male and is currently
being used to test the performance of the prototype.

ACKNOWLEDGMENTS

The authors would like to thank Waterloo Intelligent Ro- botics Experiments Incorporated (WIRE Inc.) for their technic- al and financial suport. Also, thanks to Roozbeh Borjian, James Lim, Boyd Howell, and Kenneth Lee for their help and sup- port during this project.
Gait, 2nd edition, 1991
[13] B. Khamesee, W. Melek, J. Lim, R. Borjian, K. Lee, Per-
sonal Communication, May- July 2007

REFERENCES

[1] World Extremities, Retrieved July 2007, http://www.worldextremities.org/
[2] James Lim, ―Active Prosthetic Leg.‖ University of Water- loo, 2005.
[3] David A. Winter, ―Biomechanics and Motor Control of
Human Gait.‖ Second Edition. John Wiley & Sons, 1990.
[4] David A. Winter, ―The Biomechanics and Motor Control of Human Gait: Normal, Elderly and Pathological.‖ Second Edition. Waterloo Biomechanics, University of Waterloo, 1991.
[5] ―CDC Growth Charts: United States – Stature-for-age percentiles: boys, 2 to 20 years.‖ Centers for Disease Con- trol and Prevention. May 30, 2000.
[6] Stashuk, Dan. "SYDE 444 Biomedical Engineering". Wa- terloo, ON: University of Waterloo, 2008
[7] ―CDC Growth Charts: United States – Body mass index- for-age percentiles: boys, 2 to 20 years.‖ Centers for Dis- ease Control and Prevention. May 30, 2000.
[8] Nintendo, Retrieved October 2007,

http://www.nintendo.com/wii

[9] Microchip, Retrieved May-July 2007,

http://www.microchip.com/

[10] Nintendo, Retrieved October 2007,

http://www.nintendo.com/wii

[11] ASCII Tables, Retrieved July 2007,

http://www.asciitable.com/

[12] D. Winter, Biomechanics and Motor Control of Human

IJSER © 2011

http://www.ijser.org