UBC Theses and Dissertations

UBC Theses Logo

UBC Theses and Dissertations

A microprocessor-based 3-D anthropometer Saunders, Carl G. 1986

Your browser doesn't seem to have a PDF viewer, please download the PDF to view this item.

Item Metadata

Download

Media
831-UBC_1986_A7 S27.pdf [ 8.32MB ]
Metadata
JSON: 831-1.0096920.json
JSON-LD: 831-1.0096920-ld.json
RDF/XML (Pretty): 831-1.0096920-rdf.xml
RDF/JSON: 831-1.0096920-rdf.json
Turtle: 831-1.0096920-turtle.txt
N-Triples: 831-1.0096920-rdf-ntriples.txt
Original Record: 831-1.0096920-source.json
Full Text
831-1.0096920-fulltext.txt
Citation
831-1.0096920.ris

Full Text

A MICROPROCESSOR-BASED 3-D ANTHROPOMETER by CARL G. SAUNDERS B.Sc, Engineering Physics, Queen's University, 1978 A THESIS SUBMITTED IN PARTIAL FULFILLMENT OF THE REQUIREMENTS FOR THE DEGREE OF MASTER OF APPLIED SCIENCE in THE FACULTY OF GRADUATE STUDIES (Department of Electrical Engineering) We accept this thesis as conforming to the required standard THE UNIVERSITY OF BRITISH COLUMBIA February 1986 (c) Carl G. Saunders, 1986 f 8 In presenting this thesis in partial fulfilment of the requirements for an advanced degree at the University of British Columbia, I agree that the Library shall make it freely available for reference and study. I further agree that permission for extensive copying of this thesis for scholarly purposes may be granted by the head of my department or by his or her representatives. It is understood that copying or publication of this thesis for financial gain shall not be allowed without my written permission. Department of E l e c t r i c a l E n g i n e e r i n g The University of British Columbia 1956 Main Mall Vancouver, Canada V6T 1Y3 Date March 26, 1986 DE-6(3/81) ABSTRACT Three-dimensional measurement, in relation to the human form, i s reviewed and a need i s perceived for a workstation which i s capable of gathering three-dimensional data around an object such as a limb. A new device i s presented to f i l l this measurement niche. Incorporating an instrumented spatial linkage and a stand-alone microcomputer, the device is portable and programmable. Technical and c l i n i c a l t r i a l s indicate i t s accuracy and working volume are appropriate for anthropometric applications. Cost is estimated to be comparable to that of commercially existing three-dimensional digitizers. i i TABLE OF CONTENTS ABSTRACT i i TABLE OF CONTENTS i i i LIST OF TABLES vi LIST OF FIGURES v i i ACKNOWLEDGEMENTS v i i i 1. INTRODUCTION 1 1.1 The Problem - Interfacing Devices to the Human Form 1 2. BACKGROUND 4 2.1 Introduction 4 2.2 Prosthetic Terminology 4 2.3 Traditional Methods of Socket Fabrication 6 2.4 Computer Aided Socket Design 8 2.4.1 Overview - Reference Shape Modelling 9 2.4.2 Progress to Date 11 2.4.3 Potential Areas of Improvement 13 2.5 Summary 14 3. SHAPE DETERMINATION TECHNIQUES IN REVIEW 15 3.1 Introduction 15 3.2 Non-contact Measurement Systems 15 3.2.1 Photogrammetry 15 3.2.2 Moire topography and holography 18 3.2.3 Automatic triangulation 20 3.2.4 Time-of-f light 22 3.2.5 3D Imaging 23 3.3 Contact Measurement Systems 25 i i i 3.4 Anthropometric Shape Modelling 29 3.4.1 Scaling and Orientation Techniques 30 3.5 Summary 32 4. TOWARDS A NEW ANTHROPOMETER 33 4.1 Introduction 33 4.2 Criteria and Constraints for a New Measurement Device 33 4.3 Choosing an Appropriate Technology 34 4.4 Overview of the Proposed Design 36 4.5 Summary 39 5. THE MERU ANTHROPOMETER - MECHANICAL DESIGN 40 5.1 Introduction 40 5.2 The Spatial Linkage 40 5.2.1 Design Considerations 40 5.2.2 Design Details 41 5.3 Algorithm for Stylus Coordinate Determination 44 5.4 Resolution and Error Analysis 46 5.5 Summary 49 6. ELECTRONIC HARDWARE DESIGN 50 6.1 Introduction 50 6.2 Hardware Overview 50 6.3 Data Processing Circuitry 52 6.4 Transducer Selection 52 6.5 Transducer Interface Circuitry 55 6.5.1 The State Decoding Circuit 55 6.5.2 The Counting Circuit 58 6.5.3 The Index Signal Detection Circuit 60 6.6 Input/Output Circuitry 62 6.7 Summary 64 XV 7 . SOFTWARE DESIGN 65 7 .1 I n t r o d u c t i o n 65 7 . 2 F u n c t i o n a l D e s c r i p t i o n 65 7 . 3 Measurement Mode - The M a i n P r o c e s s i n g L o o p 68 7 .4 I n t e r r u p t S e r v i c e R o u t i n e s 70 7 . 5 Summary 73 8 . EVALUATION OF THE ANTHROPOMETER 74 8 .1 I n t r o d u c t i o n 74 8 . 2 T e c h n i c a l T r i a l s 74 8 . 2 . 1 P r o c e d u r e 74 8 . 2 . 2 R e s u l t s 76 8 . 2 . 2 . 1 A c c u r a c y 76 8 . 2 . 2 . 2 R e p e a t a b i l i t y 78 8 . 3 C l i n i c a l T r i a l s 81 8 . 3 . 1 P r o c e d u r e 81 8 . 3 . 2 R e s u l t s 83 8 .4 C a p a b i l i t i e s and L i m i t a t i o n s 86 8 . 5 The N e x t G e n e r a t i o n 90 8 .6 Summary 92 9 . CONCLUSIONS 93 REFERENCES 95 APPENDIX I: PROGRESS MADE WITH THE CASD SYSTEM 100 APPENDIX I I : TECHNICAL TRIAL DATA 104 APPENDIX I I I : CL IN ICAL TRIAL DATA 110 APPENDIX I V : PROGRAM L IST ING 114 v L I S T OF TABLES 1. C l i n i c a l R e s u l t s w i t h t h e CASD System 12 2. Summary o f Automated T e c h n i q u e s f o r C i r c u m f e r e n t i a l Shape Measurement 35 3. R e s o l v a b l e S t a t e s f r o m t h e E n c o d e r S i g n a l s 57 4. Reduced Measurement D a t a f r o m T e c h n i c a l E v a l u a t i o n 79 5. T e c h n i c a l E v a l u a t i o n R e s u l t s 80 6. D i s t a n c e Measurements C a l c u l a t e d f r o m C l i n i c a l T r i a l D a t a 85 7. C l i n i c a l E v a l u a t i o n R e s u l t s 85 8. A n t h r o p o m e t e r S p e c i f i c a t i o n s 87 9. Summary o f Automated Measurement T e c h n i q u e s I n c l u d i n g t h e MERU A n t h r o p o m e t e r 88 v i LIST OF FIGURES 1. Components of a Transtibial Prosthesis 5 2. Dependence of Socket Shape on Bone Distribution 7 3. Caliper Measurements Used in CASD 10 4. The MERU Anthropometer 37 5. Schematic of the Mechanical Linkage 42 6. The Joint Design 43 7. Homogeneous Transformations for the Five Joints 45 8. Electronic Hardware Block Diagram 51 9. System Memory Map 53 10. Single Channel State Decoding Circuit and Waveforms 56 11. Anthropometer's State Decoding and Counting Circuit 59 12. Index Signal Detection and Keypad Interface Circuit 61 13. Measurement Switch Interface 63 14. System Operation State Diagram 66 15. State Diagram for the Main Measurement Loop 69 16. State Diagram for the Process Point Mode 71 17. Experimental Set-up for Technical Trials 75 18. Sample Linkage Configurations Used in Technical Trials 77 19. Measurement Protocol for Clinical Trial 82 20. Experimental Set-up for Clinical Trial 84 v i i ACKNOWLEDGEMENT Fir s t l y , I would like to thank Tom Steinke for the a l l the idea sessions, the help with debugging, and the encouragement to keep at i t . Dr. Ito i s thanked for his trust and patience over the course of the project. My other colleagues at MERU: Jim Foort, Dave Cooper, Marg Bannon, and Sylvia Mosterman are acknowledged for their continuous support and tolerance. I am grateful to both Dave Fletcher and Al MacKenzie for doing such a beautiful job on the linkage, not only once but twice! To Andrezj Wrotek, who came in off the street last March and wanted to help rebuild the electronic hardware, I also express my gratitude. In addition, I would like to acknowledge Larry Panych and Aleksey Novicov for their small, but key contributions. In an odd way, I also thank the thief who stole the first Anthropometer since I am now quite sure that the original linkage would never have worked! Special thanks are given to my wife, Dawn, who really stood by me, especially around the time of the theft, when I needed her most. Finally, the financial support of the B.C Science Council and Health and Welfare Canada are gratefully acknowledged. v i i i CHAPTER 1 INTRODUCTION 1.1 The Problem - Interfacing Devices to the Human Form In today's world, a tremendous importance is placed on shape. Shape is important for two reasons: a) i t has intrinsic social and aesthetic value b) i t is a major factor in the intimate mating of special equipment to the human form. Examples of the first are most commonly seen in nature and in art; the erosion of rock by the sea and the molding of clay by the sculptor generate forms which are soothing to the psyche. A l l of us are faced with the issue of mating specialized equipment to the body when we purchase clothing. Though fashion has sometimes dictated an interest in the 'baggy' look, there has always been a strong consumer orientation to goods which f i t 'just right'. These goods include everything from hats to blouses, to pants, to shoes. In most cases, a strong emphasis is placed on fashion rather than function in identifying a 'proper fit ' . Shape is more of a functional issue in such items as sporting gear and automobile seats. In these industries, several technologies have been developed which deal with the issue of providing a 'custom f i t ' . Foam injection techniques and inflatable air bladders are very recent additions to downhill ski boots. The Toyota Corporation provides automobile seats with nineteen different adjustments which the driver manipulates to achieve a comfortable driving position. Medical treatment involving rehabilitation is another area where shape has functional importance. The provision of prostheses for amputees, 1 spinal braces for teenagers with scoliosis, special seats for disabled children, and appropriate footwear for the elderly, a l l present shape dependent problems. Appropriate shape solutions for each of these problems are formulated on the basis of force transfer requirements. In the case of the amputee, the forces which are generated during ambulation must be transferred from the prosthetic foot and distributed over areas of the residual limb which can tolerate repetitive loading. The mechanical or shape interface between the amputee's residual limb and the rest of his prosthesis, called the socket, i s not the negative of the amputee's topographical shape, but rather a biomechanically suitable shape. This biomechanical shape, which is a distortion of the topographical shape, accounts for variations in density and pressure tolerance of different tissues, and specific biomechanical requirements related to support and control. At the present time, the task of providing appropriate interfaces to the body rests with skilled artisans. Since the design of biomechanically suitable shapes is a complex process, the required skills are difficult to master, d i f f i c u l t to teach, and are spread thinly in terms of the population in need. The result i s that expertise i s gathered slowly by novice artisans and the quality of shape dependent components varies widely from artisan to artisan. If the shape management procedures, used by the skilled artisans, were automated, then objective data relating to the design process could be accumulated. By analyzing this data, the artisan skills themselves could be readily quantified. This would in turn greatly facilitate the transfer of these skills. To achieve these objectives, i t has been suggested that the solution 2 to the problems inherent in clinical shape management could be resolved by the implementation of a "shape management plant" [50], This plant would incorporate the following three components: a) a device for measuring anatomical shapes b) a method for systematically modifying shape c) a machine for replicating the designed shape. This thesis focusses on the f i r s t component of the automated shape management plant: the measurement device. Goals of the project include reviewing the current state-of-the-art in prosthetics and shape measurement, defining the criteria and constraints for a new type of automated measurement instrument, designing and building a prototype, and evaluating i t s performance. While emphasis has been placed on the design of a clinically useful device, efforts have been made to ensure that the instrument has the f l e x i b i l i t y to be used in a wider range of anthropometric and industrial applications. 3 CHAPTER 2 BACKGROUND 2.1 Introduction The purpose of this chapter i s to provide background information which defines the term prosthesis, reviews the current artisan techniques used to design and fabricate prostheses, and updates the progress being made with computer-aided design systems in the prosthetics f i e l d . 2.2 Prosthetic Terminology Prosthesis i s the medical term for a mechanical replacement of an anatomical part. Using the lower limb as an example, a prosthesis f o r a transtibial (below-knee) amputee consists of an a r t i f i c i a l foot, a shaped mechanical interface to the residual limb (called the socket), a pylon connecting the foot to the socket, and two alignment units which orient the foot with respect to the prosthetic socket (Fig. 1). Being the interface between the amputee and the rest of the prosthesis, the socket must transfer the forces generated during ambulation over areas of the residual limb which can tolerate repetitive loading. The shape of the socket used to achieve this goal i s not the negative of the amputee's topographical shape; rather, i t i s a biomechanical shape which i s designed to deal with v a r i a t i o n s i n the density and pressure tolerance of the tissues i n the re s i d u a l limb, d a i l y f l u c t u a t i o n s i n the tissue volume, and specific requirements related to support and control. This biomechanical shape, which i s a distortion of the topographical shape, i s achieved by loading pressure-tolerant tissues, such as muscles, and relieving load-intolerant bony prominences [12,13]. Typically, tissues are 4 Components o f a t r a n s t i b i a l p r o s t h e s i s . 5 leaded by reducing the socket volume in those areas, while bony prominences are relieved by increasing the socket volume over them [3]. Bone d i s t r i b u t i o n i s a major determinant i n socket shape design. Pressure on bone must be minimized without l o s i n g the intimate contact which prevents excessive movement of the socket r e l a t i v e to the skin [12,13]. The dependence of socket shape on bone d i s t r i b u t i o n i s demonstrated i n Fig. 2. With the exception of the hamstring tendons, a l l pressure sensitive areas occur where the bone i s on or near the surface of the residual limb. When a biomechanically suitab l e socket i s applied to the residual limb, the soft tissues d i s t o r t to accommodate the socket shape. If the socket shape includes a constriction above the femoral condyles, then the r e s u l t i n g tissue d i s t o r t i o n suspends the socket during the non-weight bearing portions of the gait cycle. With such intimate contact required between the socket and the res i d u a l limb, i t can be understood that a properly f i t t i n g socket i s essential to the prolonged use of a prosthesis. 2.3 Traditional Methods of Socket Fabrication Currently, artisans produce sockets for a l l levels of amputation. The f i r s t step i n the traditional process involves wrapping the residual limb with a series of plaster bandages. Usually, this plaster wrap, while i t i s s t i l l on the residual limb, i s 'encouraged1, by sk i l l e d hands, into a more biomechanical shape. Once the wrap has suitably hardened, i t i s carefully removed so as to minimize distortions to i t s shape. From this, a positive plaster model i s fabricated. The plaster model, already encouraged into a more biomechanical shape, 6 L a t e r a l V i ew A) A n t e r i o r V i ew F i g . 2. Dependence o f s o c k e t shape on bone d i s t r i b u t i o n . 7 is then modified to provide the functional features mentioned above. Using rasps and plaster, the plaster model i s sculpted until a suitable socket shape is achieved. In the next step of the socket fabrication process, the socket is laminated over the modified plaster model. Once the laminating material cures, the plaster model i s shattered to free the socket. The result of this last procedure is that the shape modification information present in the plaster model is lost. Thus, any future fittings of the same amputee usually require the prosthetist to start anew with a plaster wrap of the residual limb. The main disadvantages of the traditional socket fabrication process are that the techniques used to produce comfortable sockets are time consuming and difficult to quantify. 2.4 Computer Aided Socket Design An alternate method of socket production, using computer graphics technology, has been developed at the Medical Engineering Resource Unit (MERU), University of British Columbia. The MERU Computer-Aided Socket Design (CASD) system software allows systematic modification of a primitive socket database using techniques which are analogous to those used by prosthetists with rasps and plaster. When combined with computer-controlled fabrication technology, comfortable polypropylene sockets can be produced in less than 2 hours [7,50,52], There are several other features of the CASD system which are superior to the traditional methods of socket fabrication. For example, when a CASD design session i s terminated, the database corresponding to the fin a l socket shape i s stored and a quantified record i s maintained of a l l the modifications used to generate that shape. 8 2.4.1 Overview - Reference Shape Modelling Reference shape modelling has been the basis for the CASD system for transtibial amputees. In this case, a socket model, contoured to simulate biomechanical properties of a typical socket, has been partitioned into four separate modules and represented in the computer as a d i g i t a l database. On the basis of several caliper measurements of the amputee's loaded stump (Fig. 3), the CASD software scales each of the modules in size, orients them to one another, and blends the spaces in between [7]. The resulting shape, referred to as the 'primitive' socket shape for the amputee, can be manipulated and modified on a graphics terminal. Any anatomical shape can be managed in a like manner to derive a shape which will provide the biomechanical properties required. In the case of an orthopedic shoe, for example, the needs are optimal distribution of support forces and clearance between the shoe and sensitive areas of the foot. These requirements are analogous to those required in the force transfer between an amputee's residual limb and a prosthetic socket. The alternate approach, to sizing and blending biomechanical reference shapes on the basis of measurements, is to use shape sensing technology to quantify the topographical shape [10,11], While this method gives vast three-dimensional information about external shape, the problem of determining a biomechanically suitable shape from this data remains unresolved. In studying this problem, the Rehabilitation Engineering group at Baylor College of Medicine, Texas, has been working on a f i n i t e element model of the transfemoral (above-knee) amputation stump and underlying bone. The objective is to develop a model of the stump, in terms of strain, tissue quality, and volume constraints, so that given a desired loading 9 10 configuration, the shape of the socket is automatically determined [27]. While this technique may eventually be successful in determining an appropriate biomechanical shape for a transfemoral socket, extension of the f i n i t e element method to applications which involve more than one bone surrounded by tissue may be difficult. In summary, reference shape modelling has the potential to derive a biomechanically suitable shape for a given pathology because i t is based on manipulating reference shapes which already have appropriate 'built-in' biomechanical features. Because the reference shape method relies on several key external measurements, the measuring instrument required can be simpler and less costly than current sophisticated shape sensing systems. The disadvantage of the reference shape modelling approach lies in its inherent assumption that negligible variations are required within the reference shapes themselves. If these variations are required, then they must be managed by the interactive modification capabilities of a companion computer-aided design system, such as CASD. 2.4.2 Progress to date A summary of the results from the most recent round of c l i n i c a l t r i a l s i s given in Table 1. On the basis of these results, MERU's conclusions are: a) the CASD system can be used to design well-fitting sockets for transtibial amputees b) several iterations are required to achieve a successful result. Thus, the logical next step is to investigate methods for reducing the number of iterations required to design an appropriate socket. A more 11 CLINICAL RESULTS - CASD - ROUND 2 Ratings: (1) - Can not enter socket (2) - Can stand on socket, but not walk (3) - Can walk, but with discomfort (4) - Can walk with minor discomfort (5) - Comfortable; can walk 5 laps of a course with no discomfort 300 metre Amputee Number Highest Rating Achieved Number of Sockets F i t t e d 1 5 14 2 4.8 8 3 5 10 4 5 3 5 4.8 4 6 5 8 7 4 6 Table 1. C l i n i c a l r e s u l t s with the CASD system. 12 detailed description of the technical and clinical progress made with the CASD system can be found in Appendix I. 2.4.3 Potential areas of improvement One of the problems with the current CASD system is that, even though precautions are taken during the patient measurement phase, the simple "touch" measurements, obtained with the outside caliper, are inaccurate. Since the calipers only yield linear dimensions, i t is extremely difficult to ensure that a l l the measurements are taken in the same plane. A second problem i s that no information i s obtained about the distribution of bone versus tissue within the residual limb. In the CASD system, the primitive shape is determined on the basis of an assumed bone and tissue distribution. This distribution i s altered by an heuristic function which uses the linear caliper measurements as parameters. It is quite likely that additional shape and tissue quality data could be used to improve the algorithms for socket shape generation. Having even a crude estimate of the bone shapes superimposed inside the socket shapes would act as a very useful cue in doing interactive modifications. Another issue is that the current model based on four reference shapes may be too crude. It i s entirely possible that more than four reference shapes should be used to construct the primitive socket shape. The use of more reference shapes would provide more control over the shape of the socket and accommodate a greater variability in socket shapes. Of course, more measurement data would have to be collected in order to properly locate and orient the additional shape modules. The common element in a l l of these issues is the measurement system. Clearly, successful refinement of the CASD system is largely dependent on 13 improvements i n the type of data collected, in the accuracy and repeatability of the data collection process, and in the methods which use the measurement data to generate the starting or primitive socket shape. The focus of this project i s to develop a measurement tool which addresses the fi r s t two improvements mentioned above. 2.5 Summary This chapter has included reviews of terminology, current artisan methods, and computer-aided design techniques as related to the prosthetics field. A need has been identified for an appropriate measurement instrument to link into a CAD system for prosthetics. When used, this measurement device should increase the amount and the accuracy of clinically relevant data being delivered to the CAD system. This, in turn, should help to improve the quality of the primitive socket shape and therefore reduce the number of iterations required to design appropriate sockets using CAD techniques. 14 CHAPTER 3 SHAPE DETERMINATION TECHNIQUES IN REVIEW 3.1 Introduction The focus of this chapter is to review various methods of quantifying three-dimensional anatomical shapes. Various types of measurement systems are described, as well as techniques for modelling shape. Measurements systems have been divided into those which require mechanical contact with the surface of interest and those which do not. Shape modelling techniques are presented which estimate shape on the basis of a few measurements and prior knowledge in the form of a database. The relevance of these various shape determination techniques to prosthetic socket design is investigated. 3.2 Non-contact Measurement Systems Non-contact methods of shape measurement f a l l into several categories: a) Photogrammetry b) Moire Topography and Holography c) Automatic Triangulation d) Time-of-Flight e) 3D Imaging. 3.2.1 Photogrammetry Photogrammetric methods of shape sensing include stereo-photography and structured light techniques. If stereo-photography is used to measure a particular surface, a stereo-camera is used to simultaneously produce two photographs of the surface. For recording the shape of a limb, six or more 15 stereo-cameras, at different angular positions around the limb, would have to be activated simultaneously. The three-dimensional position of any point on the surface i s calculated from the known position of the cameras and the location of the point of interest in both photographs. Pairs of stereophotographs are digitized using a stereocomparator, a precision instrument which permits and records stereo-measurements of photo coordinates. This technique has the potential for high accuracy, but i s a lengthy and tedious process requiring a skilled technician to operate the stereocomparator [17,26]. In some photogrammetric applications, image correlators are used to reduce the digitization time [17]. The operator's measurements of discrete points is substituted by automatic stereo-scanning, performed along pre-programmed directions of the photograph. Analytical plotters are another means of implementing the correlation function in photogrammetric measurements [17]. Stereo-photogrammetric techniques involve high equipment costs, skilled personnel, and lengthy digitization times. They are generally used in applications which require highly accurate measurements of several pre-determined landmarks on a surface. Alternate photogrammetric techniques have involved the use of structured light. Early developments included systems which superimposed s l i t s of light onto a surface, and, at 90 degrees to the projected light, photographed the resulting contours [5,64], Referred to by some as the "light cutting" method, this technique suffered from the same limitation as silhouetting techniques, the inability to sense concave surfaces [5,18]. An enhancement of the light-cutting method involves projecting a grid pattern onto a surface and photographing the resulting distorted pattern 16 from an acute angle [46], By including several "control points" into the photograph, and knowing the linear dimensions of the grid, i t is possible to reconstruct the surface under investigation. The control points and the intersections of the grid lines are digitized by a technician using a digitizing tablet interfaced directly to a computer. Surface coordinate data can be produced to an accuracy of better than +1 mm, however the system i s limited by the need for a skilled operator and the requirement for several cameras and projectors to produce simultaneous photographs around the limb [28], Attempts to automate the structured light methods of shape sensing include recent advancements in raster stereography [14,19]. This technique involves projecting a series of parallel lines (i.e. a raster) onto the surface of an object and observing the resulting "deformed grating" with a sensor. In practice, a linear array device i s mechanically translated across the f i e l d of view, and the deformed grating image i s fed directly into a microcomputer. Image processing i s simpler in Raster stereography than in other techniques (see section 3.2.2 - Moire topography). The projected raster pattern is coded to enable analysis to start from a known reference line. The deformed grating lines have predictable order and structure which simplifies their recognition. Discontinuities which arise are corrected by algorithms which assume a typical shape for the deformed grating lines. Reconstruction i s achieved by a triangulation calculation or by internal calibration. The latter is done by having several control points in the field of view and calculating the coordinates of other points from their relationship to the control points. This desensitizes the sensing system to errors in positioning the projector or the sensor. Accuracy in 17 the calculated 3D coordinates is quoted to be ±1 mm. Currently, some user interaction is required and only single views of an object have been measured. Plans are to fully-automate the system by implementing array camera technology and enhancing the image processing software. While the photogrammetric systems mentioned are safe to use and provide the accuracy required for sensing shape around a limb, the cost associated with multiple cameras or sensors remains high. In addition, the time required to process the photographs or digital images is often longer than is ultimately desired. 3.2.2 Moire topography and holography Moire topography and holography are both optical interference techniques for obtaining three-dimensional data from surfaces. In holography, the three-dimensional shape of an object is recorded as a two-dimensional diffraction grating using coherent (laser) light. Because of the short wavelength of laser light, a holography apparatus must be mounted securely and aligned precisely. The short wavelength i s also responsible for the high accuracies (0.001 mm) which can be achieved [16], Unfortunately, holographic imaging produces fringe patterns which are d i f f i c u l t to analyze or relate back to specific sites on the original object [47]. Moire topography does not require a laser light source, in fact inexpensive, mono-filament, white light bulbs have been used extensively [18,56,58], This bulb acts as a "point source" of light and casts a shadow of a mechanical grating on the object of interest. When the object is viewed at a different angle through this same grating, an interference 18 pattern results which, under special geometric conditions, closely resembles contour lines. This pattern may be photographed and/or recorded digitally for analysis in either a semi- or a fully-automated fashion. Moire topographs have been used successfully for the three-dimensional digitization of various types of anatomical shapes ranging from shoe lasts to entire bodies [51,57]. In one application, the surface of a rotating shoe l a s t i s captured on a single photograph using Moire p e r i -contourography [7,48]. The resulting Moire pattern is manually digitized at the intersections of the fringes and vertical lines occuring at 5 degree intervals along the photograph. This painstaking manual digitization process requires up to 2 hours per shoe last. RIFRAN and the MC5000 represent two of the better known systems for semi-automated analysis of Moire topographs [15,23,66]. Both of these machines implement video frame store memories to eliminate the need for photographs. Due to their interactive nature, these two systems require the operator to make numerous decisions. This limits the speed at which data can be extracted from the Moire images and increases the time required to process this data. Ongoing research is attempting to bypass much of the user interaction by automating more of the data processing. Unfortunately, the costs of both these systems is high ($100,000+). Fully-automated Moire systems have been developed in order to offer a solution to the long data processing times associated with semi-automated Moire systems. In fact several centres have independently investigated fully-automated Moire systems [40,60,61], One approach is to create Moire patterns by generating so-called "virtual" gratings in electronic hardware and superimposing these on images of deformed grating patterns. Software automatically modifies the phase and pitch of the virtual grating and 19 therefore resolves the concave-convex ambiguities present in single Moire images. This greatly facilitates data processing. An alternate approach to the analysis of Moire fringe patterns i s phase-locked analysis [37], A detector selects a particular fringe and then scans the object at that particular fringe depth. Scanning of a surface is reported to take 15 seconds. A unique approach to profile testing using Moire topography has been implemented [31]. A computer-generated Moire map for a particular surface profile is used as the observation grating in a projection Moire apparatus. A perfect match of the surface is characterized by a uniformity in illumination or fringes (depending on the algorithm which i s used to generate the observation grating). This system is an innovative approach for assessing change in shape over time or determining characteristic profiles. A l l of the Moire systems are accurate and safe. The problem of lengthy data processing time has been tackled with varied success. The major drawback of Moire technology in sensing shape around a "live" limb is that the cost of multiple systems is prohibitive. 3.2.3 Automatic triangulation In the last decade, a significant effort has been placed on automated triangulation-based systems. One system, designed to measure undulation and geometric shape of a surface, encountered severe limitations. The system could not measure the surface shape of an object which contained shapes which were inclined at more than 4 degrees to the planar surface being sensed [55]. More recent systems, developed at other centres, are capable of sensing surfaces which are inclined up to 75 20 degrees [10,21,65], These systems are fully automated, are able to acquire and process the shape data quickly, and produce the ±1 mm accuracy required of anatomical measurements. One of these instruments has been configured specifically for the measurement of transtibial amputation limbs [11]. A cylindrical lens projects a vertical line of laser light onto the residual limb. This line is viewed from several acute angles by video cameras and its locus on the video image is stored in digital form. The entire surface of the residual limb is measured by causing the line of light to rotate around the limb and viewing that limb with nine stationary cameras. A single measurement, involving 17,280 sets of cylindrical polar coordinates, requires 1.2 seconds. This data i s stored on computer magnetic media for teaching purposes and for future use by the MERU computer-aided design system (CASD). A similar instrument, developed at the Oxford Orthopaedic Engineering Centre to measure the surface deformity of the back in scoliosis patients, is now commercially available [59]. A video camera/computer system is used to measure the distortion of a line of ordinary white light as i t i s scanned over the surface. In practice, one shape scan of 4000 Cartesian coordinates requires one second to complete. A third machine has been developed which implements solid-state linear imaging arrays and an X-Y optical scanner [65]. The X-Y scanner deflects a laser beam over the field of interest, and at any instant, the location of the laser spot i s imaged onto one vertical and three horizontal pairs of cylindrical lens/linear array sensor combinations. As a compromise between accuracy and the ability to measure concave surfaces, the three horizontal sensors are separated by 45 degrees. A configuration for complete 360 21 degree three-dimensional shape measurement is described consisting of eight horizontal sensors spaced every 45 degrees, and four vertical sensors placed 90 degrees apart. A l l three systems require calibration processes to relate the digital position of the imaged spot or line with its three-dimensional location in space. The automatic triangulation techniques offer significant advantages over other shape sensing methods in terms of speed of data collection and automatic data processing. The measurement accuracy of a l l three is ±1 mm. The use of a non-laser light source, such as the one present in the second system, makes these systems reasonably safe to use. Disadvantages of these systems include their high cost ($30,000+) and their difficulties in imaging surfaces with steep contour changes. 3.2.4 Time-of-flight Another approach to shape sensing is range finding using either light or sound. The major hardware differences between these two techniques are a result of their different wave velocities. The free-space velocity of electromagnetic waves (3 x IO** meters/second) is five orders of magnitude greater than the velocity of ultrasonic waves (1.5 x 103 meters/second) in water. To achieve a range accuracy of +1 mm, requires a time discrimination of +0.67 microseconds using ultrasonic ranging and +3.3 picoseconds using light ranging. These requirements indicate that much more sophisticated electronics are needed to implement light ranging than ultrasonic ranging. The problem with low frequency ultrasonic ranging is poor resolving power due to too l i t t l e energy being returned to the detector. This occurs 22 in two situations: a) i f the surface normal is at too large an angle to the propagation direction of the incident waves then much of the energy rebounds away at an angle and b) i f the surface consists of small variations relative to the wavelength of the ultrasonic source then specular reflection results. High frequency ultrasonic ranging (i.e. greater than 0.25 megahertz) might alleviate these problems [47]. At visible light frequencies, specular reflectance problems can be overcome, however the electronics must be capable of time discrimination in the order of picoseconds. One such system, a pulsed laser scanner, has operated at an accuracy of +2.5 mm in a cubic volume (32 centimeters on a side) 1 to 4 meters from the exit lens [47], A surface was measured as a 64 x 64 matrix in under 4 seconds. A much more sophisticated device i s reported with an accuracy in excess of 0.02 mm and a single-view scan time of 0.5 seconds [47]. Because a two-dimensional scanning mechanism and/or multiple sources are essential components of time-of-flight systems, the cost of these systems i s high. Range finding systems are relatively safe for use with live subjects. 3.2.5 3D imaging Three-dimensional imaging techniques have the advantage that shape information i s obtained about internal structures as well as external topography. Unfortunately, with the exception of Nuclear Magnetic Resonance Imaging (NMRI), most of these techniques are invasive in nature. Ultrasonic imaging i s appealing because i t has the additional capability of measuring the viscoelastic properties of tissues. Ultrasonic computerized tomography is now being investigated where cross-sectional 23 images are produced yielding the spatial distribution of the attenuation of sound waves in tissues [20,27]. Innovative work has been reported on the three-dimensional modelling of f a c i a l contours and skull structure using radiographic computerized axial tomography (CT) technology [32,62], On the basis of 2 mm interval, high resolution CT scans of the head, three-dimensional images of the face and skull are displayed on a graphics terminal. The data from the CT scanners is stored on magnetic tape and transported to a mainframe computer for processing. One system, with the additional capabilities of surgical editing and carving moulds for prosthetic implants, i s now commercially available [6]. CT scanning has also been used at MERU to gather data on the shapes of the bones in the lower limb. Approximately 30 minutes were required to collect 30 medium resolution slices of the shank. In addition to the problems of radiation exposure and long data collection times, this technique is limited by the availability and accessibility of CT scanning machines. An alternate radiographic technique is stereoradiography [1,54]. This technique uses the same principles as stereophotogrammetry except that two radiographs are produced instead of two photographs. If care i s taken in postioning the subject, then conventional X-ray equipment can be used for this purpose. Resolutions of 2 - 5 mm have been reported. As with stereophotogrammetry, this technique requires that the landmarks of interest are present in both radiographs. Thus, the technique is not really suitable as a general shape quantification tool. A recent adjunct to the imaging armementarium is the NMRI machine. This technique does not involve harmful radiation exposure, and can produce 24 images of internal tissue structures to a resolution of 2 mm [45]. Because high contrast can be achieved between the external surface of the body and surrounding air, this technique i s also a possible approach to external shape sensing. Due to the imaging of the internal tissues, one can also observe the shape and location of underlying bone. The quality of the bone image is not as good with NMRI as with CT since bony areas show up only as unexposed black regions in the NMRI photographs. As with CT, data collection time can be traded off for resolution in NMRI. However, the minimum data collection time for the collection of 6 slices, 10 mm thick, with low resolution (but enough to determine the skin-to-air interface for each slice) is s t i l l 4 minutes [9], Thus the speed of data collection presents the same problems for NMRI as for CT. The major advantage of this technology over CT is that i t is non-invasive. However, the availability and accessibility of these machines is even poorer than the CT scanners. 3.3 Contact Measurement Systems In contact shape measurement, the measuring device interfaces directly with the object being examined. This method is used in profile measuring systems which incorporate a stylus-based instrument to obtain shape data [4,24], One reported system is a point-encoder device, interfaced to a computer through an A/D converter, which records points on a surface in spherical coordinates [2], A similar device, called a vector stereograph, has been designed for measuring anatomical landmarks [43]. It consists of 3 multiturn potentiometers mounted at the apices of a 1.5 meter per side, equilateral triangle. The potentiometers are connected to constant-torque, 25 spring-loaded bobbin reels which are wound with nylon thread. The free ends of the thread are brought together at a plastic pointer. When a button is pressed, the three voltage signals from the potentiometers are digitized by an A/D ci r c u i t and fed into a computer. A program, resident in the host computer, then calculates the three-dimensional coordinates of the plastic pointer. While reasonable accuracies have been quoted for these two devices (i.e. ±1 mm for each coordinate axis), neither i s properly organized for measuring around a limb. Instrumented linkages are another family of devices which provide a means for measuring three-dimensional surfaces. One such device i s the Bio-Curve tracer which incorporates four links and a combination of linear and rotational potentiometers [63]. It has a working volume of a hemisphere of radius of 100 centimeters, has limited capability to reach around obstacles to take a measurement, and claims a resolution of between 1 and 4 mm depending on the location of the stylus in the work volume. The coordinate calculations for the stylus position are performed by an LSI 11/23 host computer. Two other instrumented linkages are currently being sold through Micro Control Systems Inc. [34,35], The Space Tablet i s the least expensive (approximately $2000) and consists of 3 or 4 arms linked together by rotational joints; each of the joints is instrumented by a potentiometer having a linearity of 0.5% and a resolution of 1300 states over a 320 degree working angle. The specifications of the device include a working volume equivalent to a sphere quadrant of radius 35 cm., a "rule of thumb" resolution of 1 mm in each Cartesian coordinate axis, and the requirement for either an Apple II or IBM PC as the host computer. Since the linkage 26 consists of rotational joints, the resolution in Cartesian coordinates varies with the pointer location within the work volume. Towards the extremes of the specified volume, the resolution degrades to 2.5 mm. The second device, the Perceptor, i s significantly more expensive (approximately $10,000), but i t offers several more features. To offload the host computer, the A/D and processing circuitry are incorporated into the base of Perceptor's work surface. The linkage has a 42 cm. reach and five degrees of freedom, four rotational and one translational. Precision potentiometers at each joint convey position data to an on-board Z80 microprocessor, which then calculates the stylus 1 exact coordinates to a resolution in Cartesian coordinates of 0.2 - 0.5 mm (depending on the location of the stylus in the work volume). The Perceptor has four switch-selectable operating modes: point, continuous stream, delta time, and delta distance. In stream mode, the Perceptor has a maximum digitization rate of 7 Cartesian coordinates per second. The three dimensional data i s transmitted over an RS-232 serial link to a host computer. Instrumented linkages offer acceptable accuracy and the a b i l i t y to take measurements around a limb. Their disadvantage is that the mechanical linkages can be cumbersome to manipulate. Efforts have been made to design three-dimensional digitizers which are free of restrictive arms, threads, and linkages. Commercial devices now exist which incorporate either electromagnetic receivers or broadcast frequency sound-emitters in the tip of the measurement stylus. In these instances, the measurement device consists of a pen-shaped stylus linked to associated circuitry by a simple electronic cable. The 3SPACE Digitizer and Tracker, an electromagnetic three-dimensional digitizing system, is made up of two coil assemblies, each consisting of 27 three-orthogonally mounted small coils wound on a ferrite sphere [42,44]. One coil assembly is located beneath a non-conductive reference surface and acts as the magnetic source. The second c o i l i s located in the hand-held stylus and acts as the sensor. The three source coils are sequentially excited by a sinusoidal current, causing responses in each sensor c o i l which are related to each sensor coil's distance from and orientation to each excited source coil. An electronic unit houses circuitry which sorts the sensor signals and calculates the three-dimensional coordinates of the end of the stylus as well as the angular orientation of the stylus in space. Once digitized, data points can be output in either binary or ASCII format over an RS-232-C interface to a host computer. The system i s configured to measure coordinates to an accuracy of 0.8 mm, at a digitizing rate of up to 50 points per second, on a non-metallic model up to 50 x 50 x 25 cms in size. Larger models (125 x 125 x 50 cms) can be measured but with less accuracy. Because of their effect on the electromagnetic signals, metallic objects must be kept well away from the measurement volume. Though ideal in terms of accuracy, on-board computer, and ease of use, the 3SPACE device i s limited because of i t s high price ($30,000 U.S.) and the requirement to ensure a non-metallic environment for its use. A recently released, sonic digitizing system incorporates four microphone sensors which are mounted on a plane and a hand-held stylus which contains a 70 Khz sonic impulse emitter [53]. When a foot or hand switch is pressed, a "spark" is emitted and four clocks are activated. Each clock stops when the sound signal reaches its corresponding microphone. The four resulting time-of-flight distances are then sent over an RS-232-C link 28 to the host computer for processing into Cartesian coordinates. Operating specifications include a measurement volume of up to 300 x 300 x 300 cms, an accuracy of 0.5 millimeters in each coordinate axis, and a digitizing rate of up to 80 points per second. The sonic digitizer offers excellent accuracy, large working volume, and ease of use at a reasonable price ($12,000 U.S.). Its disadvantages include potential occlusion problems and the requirement that a host computer perform the coordinate calculations. The advantages of stylus-based three-dimensional measurement devices are that they can be more readily used to identify key landmarks on an object, have the potential to measure around obstacles, have acceptable accuracy and are relatively inexpensive when compared to non-contact techniques. A major disadvantage arises when contact-based devices are used to measure objects with soft surfaces since the shape distorts as the stylus i s traced over the surface. Depending on the accuracy required, a non-contact measurement technique may be more appropriate in this case. A common feature of contact shape measurement systems i s that a significant amount of time i s needed to collect three-dimensional shape data. Also, the object which i s to be measured must be kept motionless throughout the measurement process. However, for applications which only require a few strategic measurements, these systems are ideal. It then becomes worthwhile to investigate methods by which a reduced amount of three-dimensional data can be used to generate a suitably accurate shape. 3.4 Anthropometric Shape Modelling As discussed previously, reference shape modelling has been the basis for the CASD system for t r a n s t i b i a l amputees. In t h i s approach, 29 biomechanically-appropriate reference shapes are sized and blended, on the basis of key measurements from the client, to estimate the shape of a suitable socket for that client. Because the reference shapes contain curves and surfaces which are representative of the types of curves and surfaces desired in the end-product, techniques which can be used to manipulate these shapes to generate the end-product are worthy of investigation. 3.4.1 Scaling and Orientation Techniques Anthropometric scaling techniques are commonly used during internal force analysis of human locomotion [41]. The objective in this case is to determine the three-dimensional location of the insertions and origins of various muscles and ligaments in a "live" human subject. Since this data is inaccessible, position data, associated with these various anatomical structures, is taken from cadaver studies and transformed through various scaling procedures to give appropriate locations in the live subject. While the application of providing custom shape has slightly different objectives (i.e. the scaling of shapes rather than specific positions), the same general principles can be applied. Scaling transformation matrices are determined by matching the three-dimensional coordinates of palpable landmarks on the subject with the coordinates for the corresponding points on the reference shape. If homogeneous changes to the reference shape are required, then only one transformation matrix i s used. Where non-homogeneous shape changes are required, two or more matrices are used. The calculated shapes are obtained by multiplying the coordinates of each point on the reference shape by the transformation matrices. 30 Several methods of anthropometric scaling and orientation have been described, however most of the focus has been on three techniques: uniform dilation, independent scaling along three orthogonal axes, and independent scaling along three non-prescribed axes. Uniform dilation is often chosen for scaling landmarks which have few palpable landmarks [29]. The advantage of this scaling technique is that only two landmarks need to be measured to calculate the entire invivo shape. The disadvantage is that non-homogeneous changes in shape cannot be predicted. The second technique, independent scaling along 3 orthogonal axes, uses a 3 parameter scaling method in a local shape coordinate system with the axes aligned along the critical dimensions of the shape [36], Expansion or contraction along these axes i s done according to the three different proportions. A minimum of 3 landmarks per shape are required to implement this technique. In the third technique, independent scaling along three non-precribed axes, the principal directions of deformation are determined by the location of the measured landmarks and not the reference shape's principal axes [30]. Recently used at MERU to estimate bone shapes in the residual limbs of transtibial amputees, this scaling technique requires a minimum of four landmarks per shape and can be very accurate in determining non-homogeneous shape changes. However, i t is much more sensitive to reference point measurement error than scaling along 3 orthogonal axes. In a comparison of the scaling techniques applied to the femur and tib i a , scaling about 3 non-prescribed axes was found to be the most accurate, followed by scaling about 3 orthogonal axes, then scaling by uniform dilation [30]. 31 The advantage of these scaling techniques is that they allow the shape of an internal structure, the bone in this case, to be determined from a pre-established shape database and a few three-dimensional measurements, thus obviating the need for invasive measurement methods. In future work at MERU, such scaling techniques are expected to be useful in the determination of biomechanically-appropriate external shapes, such as those found in orthopedic shoes and spinal braces. 3.5 Summary Various types of shape determination techniques have been described, ranging from f u l l three-dimensional shape sensing through to the application of shape modelling techniques based on the measurement of key fiduciary landmarks. It i s in the context of the latter that a need i s perceived for an improved measurement tool. 32 CHAPTER 4 TOWARDS A NEW ANTHROPOMETER 4.1 Introduction As described in the previous chapter, numerous methods for three-dimensional measurement of the human form have been proposed. The objectives of this project have been to select one of these techniques, develop a clinically-useful measurement tool, and evaluate its performance. In this chapter, the c r i t e r i a and constraints for a new type of measurement system are described. A solution embodying the concept of a measurement workstation i s proposed, with details following in ensuing chapters. 4.2 Criteria and Constraints for a New Measurement Device While the main thrust of t h i s project has been to develop a measurement device for use with the CASD prosthetic socket design and manufacturing system, many of the design c r i t e r i a have been selected to give the tool a broader range of application. The most significant of these i s that the new measurement system should be, in fact, a portable workstation capable of three-dimensional measurements. The workstation concept imposes several criteria of its own including: a. The device must be capable of stand-alone operation, that is be able to request that a measurement be taken, accept a measurement, calculate the coordinates and store them internally for use later. b. It must be reliable. c. It must rarely, i f ever, need calibration. 33 d. It must have a non-volatile data-logging capability. e. It must have a communications interface so that measurement data can be downloaded to a host computer. f. It must have a convenient user-interface. g. It must be able to run several different measurement applications. h. It must be able to store up to 1000 sets of Cartesian coordinates. For the new system to be suitable for use in prosthetic measurement applications, the following design criteria have been added: i . It must be able to reach around an obstacle such as a limb. j . It must have a minimum working volume of 100 cm x 40 cm x 40 cm. k. It must yield measurements which are accurate to within ±1 mm in each Cartesian coordinate inside the minimum working volume. The constraints imposed on the design are related to market requirements; the new device must be easy to use, quick to set up, use, and take down, and have a cost which is less than that of comparable devices. 4.3 Choosing an Appropriate Technology Once design c r i t e r i a are established, the next task i s to select an appropriate technology to solve the problem. Table 2 summarizes the various automated measurement systems discussed in Chapter 3 in terms of factors relevant to c l i n i c a l shape measurement. For prosthetic applications, a system which can measure shape around the limb i s particularly useful. Thus, a l l the systems lis t e d in Table 2 are assessed in terms of their potential for circumferential shape measurement. In reviewing the design criteria, the appropriate method of obtaining three-dimensional data for prosthetic application would appear to involve contact measurement technology. 34 SYSTEM CIRCUMFERENTIAL SHAPE MEASUREMENT CAPABILITY ( i n present form) PORTABILITY WORKING VOLUME ACCURACY PROCESSING TIME SENSING TIME AVAILABILITY COST ($U.S. x 1000) A. Non-Contact: 1. Stereophotogrammetry no no good e x c e l l e n t poor e x c e l l e n t no 100(+) 2. Structured L i g h t no no e x c e l l e n t good good e x c e l l e n t no 50(+) 3. Holography no no good e x c e l l e n t poor e x c e l l e n t no n/a 4. Semi-Automated Moire yes no good good poor e x c e l l e n t yes 100(+) 5. F u l l y Automated Moire no no good good good e x c e l l e n t no 100(+) 6. T r i a n g u l a t i o n yes no e x c e l l e n t good(-) good e x c e l l e n t yes 30 - 50 7. Tim e - o f - F l i g h t no no poor good (+) good good(+) no n/a 8. Stereoradiography no no good poor(+) poor poor no 100(+) 9. Computerized Tomography yes no good good poor poor yes 500(+) 10. NMR Imaging yes no good good(-) poor poor l i m i t e d 500(+) B. Contact: 11. Vector Stereograph no no e x c e l l e n t good good good no n/a 12. Bio-Curve Tracer l i m i t e d no good good good good no n/a 13. Space Tablet l i m i t e d no poor poor good good yes 2 14. Perceptor l i m i t e d no poor(+) good e x c e l l e n t good yes 10 15. 3SPACE (Magnetic) yes no good(+) good(+) e x c e l l e n t good yes 30 16. GP-8-3D (Sonic) yes no e x c e l l e n t good(+) good good yes 12 I LEGEND: POOR GOOD EXCELLENT WORKING VOLUME (cmxcmxcm) less than 100x40x40 up to 100x100x100 100x100x100 or better ACCURACY (mm) worse than + 1 + 1 +0.1 or better PROCESSING TIME (rain) more than 5 up to 5 none (3D data already provided) SENSING TIME (min) more than 3 up to 3 0.05 or better Table 2. Summary of automated techniques for cir c u m f e r e n t i a l shape measurement. The need to relate the socket shape to key anatomical landmarks and areas of support, on the patient, i s consistent with the a b i l i t y of contact measurement systems to locate landmarks which can only be identified by palpation. Furthermore, contact measurement devices can be easily organized to be portable and have minimal risk of needing to be recalibrated as a result of being moved from place to place. Finally, the need to measure landmarks a l l around a limb or body segment involves marginal added cost when compared the significant cost associated with adding multiple sensors in non-contact measurement systems. Commonly cited disadvantages of contact measurement systems include: a) the shape being measured has to be supported and held in a stable position for what can be a long measurement process, b) the recording of multiple data points can be cumbersome and time consuming, and c) measurements of tissue regions are difficult due to the distortion which results as the stylus is traced over the surface. Both a) and b) suggest that a long time i s involved in contact shape measurement, however this does not have to be the case. As discussed previously, the use of shape modelling techniques greatly reduces the number of points to be measured. With few measurements being required, the problems associated with the time factor are greatly diminished. In addition, the disadvantage of greater error in the measurement of tissue areas is not as critical as i t may appear since the tolerances, on the f i t of the socket, are relatively greater in these areas. 4.4 Overview of the Proposed Design The proposed design, called the MERU Anthropometer, consists of an instrumented spatial linkage and a stand-alone microcomputer (Fig. 4). The 36 F i g . 4 . The MERU Anthro p o m e t e r . 37 l i n k a g e h a s f i v e r o t a t i o n a l j o i n t s , e a c h o f w h i c h i s s e n s e d b y a 1 2 - b i t r e s o l u t i o n o p t i c a l e n c o d e r . T h e l e n g t h o f t h e l i n k a g e e l e m e n t s a n d t h e number o f d e g r e e s o f f r e e d o m have b e e n c a r e f u l l y o p t i m i z e d t o e n a b l e t h e l i n k a g e t o r e a c h a r o u n d a l i m b a n d t a k e a m e a s u r e m e n t w i t h t h e r e q u i r e d a c c u r a c y . A c l a m p i s p r o v i d e d , a t t h e b a s e o f t h e l i n k a g e , t o l o c k t h e A n t h r o p o m e t e r s e c u r e l y t o a t a b l e , b e d f r a m e , o r t u b u l a r s u p p o r t f i x t u r e . When u s i n g t h e d e v i c e , t h e o p e r a t o r h a s a c h o i c e o f " p o i n t " o r " s t r e a m " m o d e s o f o p e r a t i o n . P o i n t mode a l l o w s t h e o p e r a t o r t o f i n d a l a n d m a r k b y m a n u a l p a l p a t i o n a n d t h e n r e c o r d i t s t h r e e - d i m e n s i o n a l c o o r d i n a t e s . S t r e a m m o d e , o n t h e o t h e r h a n d , p r o v i d e s t h e m e a n s f o r g a t h e r i n g d a t a p o i n t s a s t h e s t y l u s i s t r a c e d o v e r a s u r f a c e . T h e A n t h r o p o m e t e r 1 s p r o c e s s i n g c i r c u i t r y c a l c u l a t e s t h e C a r t e s i a n c o o r d i n a t e s o f t h e m e a s u r e d p o i n t s a n d s t o r e s t h e m i n n o n - v o l a t i l e m e m o r y . When r e t u r n e d t o t h e l a b , t h e A n t h r o p o m e t e r c a n be c o n n e c t e d t o a h o s t c o m p u t e r f o r t h e p u r p o s e o f d o w n l o a d i n g t h e measurement d a t a . The u s e r - i n t e r f a c e c o n s i s t s o f a s e t o f h e a d p h o n e s w h i c h i s c o n n e c t e d t o a s p e e c h s y n t h e s i z e r i n s i d e t h e A n t h r o p o m e t e r c o m p u t e r . D u r i n g t h e e x e c u t i o n o f a n a p p l i c a t i o n p r o g r a m , t h e s p e e c h s y n t h e s i z e r c o m m u n i c a t e s a p r e - p r o g r a m m e d s e q u e n c e o f i n s t r u c t i o n s v i a t h e headphones t o t h e o p e r a t o r . T h i s a l l o w s t h e o p e r a t o r t o c o n c e n t r a t e o n t h e measurement t a s k , s i n c e he d o e s n o t have t o t u r n h i s h e a d t o r e a d i n s t r u c t i o n s f r o m a v i s u a l d i s p l a y . T h e u s e r s i g n a l s t h e c o m p u t e r t h a t h e i s r e a d y t o t a k e a m e a s u r e m e n t b y p r e s s i n g a s w i t c h a n d i n p u t s o t h e r i n f o r m a t i o n t h r o u g h a k e y p a d o n t h e f r o n t o f t h e c o m p u t e r . A f t e r t u r n i n g t h e m a c h i n e o n , t h e o p e r a t o r may c h o o s e one o f s e v e r a l a p p l i c a t i o n p r o g r a m s w h i c h r e s i d e i n t h e d e v i c e . I f i n s t e a d a c u s t o m a p p l i c a t i o n i s d e s i r e d , t h e n by s i m p l y p r o v i d i n g a v o c a b u l a r y c o n s i s t i n g o f 38 t h e s e q u e n c e a n d t y p e o f m e a s u r e m e n t s d e s i r e d , a new memory c a r d c a n b e s u p p l i e d w i t h t h e c u s t o m a p p l i c a t i o n i n p l a c e . The m e c h a n i c a l l i n k a g e and t h e s t a n d - a l o n e computer a r e c o n n e c t e d by a l o n g f l e x i b l e r i b b o n c a b l e . I n t h i s manner, t h e e l e c t r o n i c s p a ckage c a n be k e p t s e p a r a t e f r o m t h e m e c h a n i c a l l i n k a g e and t h e r e f o r e n o t r e s t r i c t t h e measurement volume o f t h e d e v i c e . F o r eas e o f p o r t a b i l i t y , t h e computer, c a b l e , headphones, and m e c h a n i c a l l i n k a g e pack c o n v e n i e n t l y i n a c a r r y i n g c a s e . B y p r o v i d i n g t h e a b o v e c a p a b i l i t i e s i n t h e d e s i g n , t h i s d e v i c e r e p r e s e n t s t h e f i r s t t h r e e - d i m e n s i o n a l measurement w o r k s t a t i o n o f i t s k i n d . 4.5 Summary T h e d e s i g n r e q u i r e m e n t s f o r a w o r k s t a t i o n c a p a b l e o f s t a n d - a l o n e t h r e e - d i m e n s i o n a l measurement have b e e n i n v e s t i g a t e d . P e r f o r m a n c e c r i t e r i a have b e e n f o r m u l a t e d and t h e r a t i o n a l e f o r i m p l e m e n t i n g a c o n t a c t method o f shape measurement h a s been e x p l a i n e d . T o meet t h e c r i t e r i a , a d e s i g n h a s b e e n p r o p o s e d w h i c h i n c o r p o r a t e s a n i n s t r u m e n t e d s p a t i a l l i n k a g e a n d a s t a n d - a l o n e m i c r o c o m p u t e r . A n o v e r v i e w o f t h e d e s i g n , f r o m t h e u s e r ' s p e r s p e c t i v e , h a s b e e n p r e s e n t e d . 39 CHAPTER 5 THE MERIT ANTHROPOMETER - MECHANICAL DESIGN 5.1 Introduction The need for a measurement system to be used in conjunction with anthropometric shape modelling techniques prompted the design and development of the MERU Anthropometer. This instrumented spatial linkage provides the capability to record, with high accuracy, three-dimensional position data of fiduciary landmarks. In this chapter, the linkage design i s discussed, the algorithm for determining the three-dimensional coordinates of the tip of the stylus is explained, the minimum resolution calculation i s presented, and various sources of error are reviewed. 5.2 The Spatial Linkage 5.2.1 Design Considerations One of the complicating factors in designing a linkage-based measurement device for prosthetic application is that the device must be able to locate landmarks a l l around the amputee's residual limb. Thus, the linkage must have articulations which allow i t to a) reach around to the far-side of the stump and b) fold-up when a landmark is to be measured near the base of the device. Similar design requirements might be considered in robotic applications where a manipulator is to be used in an environment which contains physical obstacles. The other possibility i s to allow the entire measurement device to rotate around the object to be measured. The d i f f i c u l t i e s with this approach are that attachment of the device to a readily available structure 40 becomes more complex, rigidity of the design becomes more of a factor, and most significantly, a greater volume is needed in which to use the device. As a result, the proposed design incorporates a mechanical linkage mounted on a fixed base. This configuration poses many design questions, with perhaps the most significant one being the accuracy versus number of articulations trade-off. Several articulations enhance the ergonomics of the device. Providing the ability to reach the same point in space with several orientations of the linkage ensures that the operator is not forced into specific mechanical movements which might feel unnatural or cumbersome. Unfortunately, as w i l l be shown later in this chapter, error propagation increases and minimum resolution requirements become much more stringent as the number of joints increases. In addition, the cost of the device increases because the mechanical design becomes more complex, the number of transducers increases, and more support circuitry is required. In the end, the linkage configuration shown in Fig. 5, was determined to be a reasonable compromise between the human engineering issue and the straight technical requirements. The minimum number of joints necessary to meet the technical criteria was four, and a fifth was added to improve the ergonomics. Physical modelling of various linkage configurations, based on representative anatomical dimensions for the lower limb, yielded the link lengths and joint orientations shown. 5.2.2 Design details The link arms are made of aluminum, and the joints are steel. The basic joint design involves two ba l l bearings rotating on a steel shaft, (Fig. 6). The shaft i s press-fit into the inner race of each bearing, and 41 L l = 125.0 mm L2 = 254.3 mm L3 = 306.4 mm L5 " 127.0 ram F i g . 5. Schematic of the mechanical linkage F i g . 6 . The j o i n t d e s i g n the bearings are themselves press-fitted into the aluminum arms. Teflon sleeves have been placed between the articulating arms to improve the glide between them. Separation of the bearings i s between 2.5 and 7.5 centimeters; this variation allows the linkage to fold down to a compact size without compromising i t s structural rigidity. The steel shaft protrudes from one side of the linkage for the purpose of attaching a transducer. The base of the device is a modified, small, adjustable vise. Already incorporating a universal joint and a screw clamp, the vise has been adapted to include an aluminum plate which supports the mechanical linkage and a connector box. One issue which has yet to be addressed is the addition of springs or conterweights to the linkage. This would provide a means by which the linkage could support i t s weight and might make the device easier to manipulate. 5.3 Algorithm for Stylus Coordinate Determination Calculation of the coordinates of the end of the stylus i s a single-value problem. Reference frames are attached to each of the joints and 4x4 matrices are used to describe the position and orientation of the second joint with respect to the f i r s t , the third joint with respect to the second, the fourth joint with respect to the third, and so on. The five homogeneous transformations associated with this linkage design are shown in Fig. 7. These are given using the Denavit-Hartenberg notation [39]. By multiplying these matrices together, the position of the end of the stylus relative to the base of the digitizer can be determined. The result of this matrix multiplication is given below: 44 A s s u m i n g the n o t a t i o n : cos6;= C-u s i n © i = S L So.. = c, 0 s, 0 I ha = - s 2 0 L* C2 s, 0 -c, 0 Sx c 2 0 L * S 2 0 1 0 L, 0 0 1 0 0 0 0 1 0 0 0 1 -- S 3 0 L 3 C 3 B3.4 " " l 0 0 cf S3 c 3 0 s3 0 - s 4 0 0 0 1 0 0 s« C4 0 0 0 0 1 0 0 0 1 S4.S-" 0 0 s s 0 0 1 0 0 0 0 1 ( N o t e : t h e change i n f o r m a t of H d u e to^ t h e f a c t t h a t © + r o t a t e s a b o u t the i , a x i s i n s t e a d of the i ^ a x i s ) F i g . 7. Homogeneous t r a n s f o r m a t i o n s f o r t h e f i v e j o i n t s . C, ( C J J C J - SJJC^ s f ) + S, Sj C, ( - C i s S , - S , j C 4 C f ) + S, Cj-C, SjjSf + s, c 4 C, ( L s C j C j 3 - L j - S j C 4 S i 3 + L j C „ ) + C, L 2 C 2 + S, L j S s S4 S, ( C , s C y - SJJC^SJ- ) - C , S + Sy S, ( - C ^ S j - s i 3 c 4 Cj- ) S, S,jS+ S , ( L S C S C 2 3 - L s S j C 4 S 2 J + L 3 C 2 3 ) + S, L 2 C 2 - C ^ L j S ^ S ^ " s « s s + c5ac+cs-+ L 2 + L , 0 0 0 (1) Expressions for the components of the position vector for the end of the stylus are found in the last column, in x, y, and z order. These expressions have been coded and now reside in the system program of the Anthropometer. The remaining equations correspond to the orientation vectors of the stylus relative to the reference frame at the base of the digitizer. While not implemented at the present time, these orientation vectors might be provide useful data for other applications. 5.4 Resolution and Error Analysis By taking partial derivatives of the expressions in the last column of the transformation matrix given in equation (1), i t i s possible to determine the minimum resolution a transducer must provide to achieve a 1 millimeter resolution in the calculation of any coordinate. Assuming that the linkage has been perfectly machined, and the errors in each of the 46 joint angles are due only to the resolution of the angular transducers, then the equations below relate the resolution in each position vector component to the resolution of the angular transducers at those joints. APx = [ L J C - C . C ^ S J - C , S N C 4 C R + S, S, C S + C , S 5 . S 2 3 S 4 + S, Sg C 4 - 2 C , C j S i 3 - 2c | s s c^c 2 S - S,CS<V S>SSC*S2.i+ C , S S S 4 ) + L 3 ( - 2 C , S B - S , C „ ) + L 2 ( - C , 8 2 - S,CZ)]-A6 ... (2) APy = [ L F ( - S , C J J S J - S . S J J C ^ C J - C , S 4 C S + 8,8,8,^- C, Sy C„ - 2 S , C S S „ - 2 S ( S 5 C 4 C 2 3 * C L C S C 2 J - C { S ; ^ S i 3 - S L S S S 4 ) + L 3 ( - 2 S , S M + C , ^ ) + L ^ C - S , S x + C . ^ ) ] - * © — ... (3) APz = [ Lgt-S^Sf* C SC 4C^ 3- S SS^C 2 3- CyC^- SfC4C,,+ 2 ( ^ 0 , - 2 S ^ S , , ) + 2 L 3 C I 3 + L 2 C 2 ] ... (4) rhere*@is the minimum angular resolution of the transducers These equations demonstrate that the resolution in each position vector component varies as a function of the joint orientations used to reach that position, the link lengths, and the resolution of the angular transducers. Thus, the error in any measurement depends on the linkage configuration used to record that measurement. Using equation (4) as an example, i t i s clear that the error in the z-component i s large when the sum of joint angles 2 and 3 approaches 0 or 180 degrees, and small when this sum nears 90 or 270 degrees. By assuming equal-length l i n k segments and worst-case joint 47 orientations, i t can further be shown that the error in the position vector component increases with each additional joint. Notice that the number of terms in the error expression for the z-coordinate is less than the number of terms for the error in either the x-or y-coordinate. This i s due to the fact that only four joints in the system affect the z-coordinate whereas a l l five affect the other two coordinates. Using the x-coordinate equation, and a worst case orientation of the linkage, the appropriate angular transducer resolution, given the chosen link lengths, has been determined to be 12 bits. In practice, however, several factors may contribute to errors in the calculated coordinates. Inaccuracies in the machining and assembly of the linkage can lead to some joints being slightly out of square, thereby affecting the actual position vector of the stylus. There also exists the potential problem of joint play which would contribute to errors in the position vector along the direction of the play. These have been minimized by contracting the mechanical fabrication to a skilled machine shop and choosing bearings which have minimal play. However, by far the most serious source of error i s the incorrect transduction of the angles of the joints. Caused by either an incorrect i n i t i a l setting or a gradual shift in orientation (due to movement of the transducer relative to the joint i t measures, lost counts in d i g i t a l counting circuitry, or worn track in potentiometric transducers), this error propagates through equations (2) - (4), and adversely affects the coordinates of the stylus. By choosing an appropriate transducer and designing its support circuitry with these factors in mind, this source of error can be diminished. These elements of the design are discussed in Chapter 6. 48 Errors may also r e s u l t i f the operator has to tw i s t or bend the linkage slightly i n order to reach a landmark of interest. To reduce this possibility, the Anthropometer has been designed with a) a larger working volume than s p e c i f i e d by the design c r i t e r i a , b) ca r e f u l attention to ri g i d i t y and c) b u i l t - i n redundancy which allows multiple orientations of j o i n t s to reach a given point i n space. Droop of the device, due to i t s own weight, i s not a s i g n i f i c a n t factor since i t i s supported by the operator's hand when in use, and by i t s base when idle. 5.5 Summary Key f a c t o r s i n the design of a s p a t i a l l i n k a g e f o r use i n anthropometric measurement have been reviewed. Specific features in the design of the link segments and the joints have been described. The algorithm for the determination of the position vector of the t i p of the stylus r e l a t i v e to the base of the device has been presented and then used to quantify the effect of transducer resolution limitations and transducer error. Potential mechanical sources of error have been discussed. With c a r e f u l attention to the mechanical design and fa b r i c a t i o n , i t i s clear that a linkage can be b u i l t which meets the c r i t e r i a for anthropometric measurement. 49 CHAPTER 6 ELECTRONIC HARDWARE DESIGN r 6.1 Introduction As mentioned previously, the MERU Anthropometer i s a measurement workstation consisting of an instrumented spatial linkage and a stand-alone microcomputer system. The electronic hardware involved in instrumenting the linkage, gathering the angular position data, computing the coordinates of the stylus, and storing and displaying the result, w i l l now be discussed. This chapter begins with a general overview of the electronic hardware, followed by a detailed description of each of the key elements in the hardware design. 6.2 Hardware Overview The block diagram in Fig. 8 shows the main building blocks of the MERU Anthropometer electronic hardware: a microcomputer, several angular displacement transducers, an interface between the transducers and the computer, and some output circuitry for communicating the measurement results to the outside world. Under control from a resident PASCAL program, the microcomputer gathers joint position data from the transducer interface and, using the algorithm presented in Chapter 5, calculates the position vector of the stylus at any given moment. This position data is stored in non-volatile memory as Cartesian coordinates. Depending on user requirements, this data can be communicated immediately, over an RS-232-C serial link, to a host computer, or saved for downloading at a later time. 50 INCREMENTAL OPTICAL ENCODERS DIGITAL INTERFACE - state decoding & counting c i r c u i t r y - index s i g n a l d e t e c t i o n c i r c u i t r y EXTERNAL MEMORY CARD I I I I KEYPAD KEYPAD INTERFACE MENT SWITCH SWITCH INTERFACE CPU CARD - 8085 uProcessor - main program memory DOWNLOAD PORT SERIAL COMMUNICATIONS CARD HOST COMPUTER HEADPHONES SPEECH SYNTHESIZER! F i g . 8. Electronic hardware block diagram. The operator wears headphones and is prompted to take each measurement by an electronic voice command generated by an ECHO speech synthesizer. The type and sequence of measurements desired can be altered by changing the Anthropometer's vocabulary. To indicate that he i s ready to record a measurement, the operator simply presses a switch. A 16-button keypad provides the means for entering patient data or overiding a measurement request. The electronics are contained in a Prolog 721A enclosure which includes a power supply and a 13-slot motherboard. 6.3 Data Processing Circuitry The STD-bus family of microcomputer products has been chosen for the implementation of the stand-alone microcomputer. The CPU card consists of 2K of PROM for booting and restart functions, 20K of PROM for the main system program, an 8085 microprocessor running at 4.0 Mhz, a jumper for access to on-board counter timers and priority interrupts, and associated support circuitry. A 32K memory card provides room for 6K of RAM for stack and scratch area, 10K of battery backed-up RAM for measurement data storage, and 16K of PROM for application vocabularies. A memory map for the system may be seen in Fig. 9. 6.4 Transducer Selection After a review of manufacturers' literature concerning angular position transducers, incremental optical encoders have emerged as the transducer of choice. The PMI series 15, modular incremental optical encoders, with 1024 lines per revolution, and three output signals, A, B, and I, have been purchased. The A and B signals, being 90 degrees out of phase, provide the means for generating the 12 b i t resolution needed in 52 FFFFH C800H 9800H 8000H 5800H 0800H OOOOH APPLICATION VOCABULARIES NON-VOLATILE DATA STORAGE STACK AND SCRATCH AREA UNUSED MAIN SYSTEM PROGRAM BOOTING/RESTART VECTORS Fi g . 9 . System memory map. 53 this application. Each encoder's I, or index, signal i s used to obtain an absolute position for that encoder. The advantages of using incremental optical encoders are a) excellent linearity, b) compact size, c) non-contact transduction, d) good stability over time, e) no need for calibration (since there are no problems with wear), f) simple attachment to a linkage, and g) f u l l 360 degree operation with no dead spots. Disadvantages include a) the need for support circuitry to count pulses and check for the index signals, and b) the cost ($125 U.S.) for each encoder. Because of the cost factor, potentiometers were seriously considered as alternative transducers. However, the 12 bit resolution requirement and the desire to minimize the need for calibration curves for each transducer prompted a search for a potentiometer with a linearity of 0.025%. A potentiometer was found which met this specification, however its size and weight were greater than the PMI encoder and its cost was comparable. Because of their high r e l i a b i l i t y and simpler support circuitry, absolute optical encoders were also investigated, but their cost was three times that of the incremental encoders for the same resolution. Synchro-resolvers can be used to obtain 15-bit resolution angle transduction, however their support circuitry is more complex and costly than that for incremental optical encoders. Inductosyn devices are capable of extremely high angular resolution (16-bit), but their cost i s significantly higher than that of optical encoders. Thus, including cost, incremental optical encoders are appropriate transducers for this application. 54 6.5 Transducer Interface Circuitry Since the PMI incremental optical encoders provide digital outputs, a completely digital interface circuit has been designed. While only five channels are necessary to support the instrumented linkage, the interface c i r c u i t has been designed to support up to six channels. This might be useful in an application which required that the base of the Anthropometer translate along a linear track. The transducer interface consists of three parts: the state decoding circuit, the counting circuit, and the index pulse detection circuit. 6.5.1 The state decoding circuit Adapted from Johnson [25], the state decoding c i r c u i t generates the 12-bit resolution required, and eliminates the problems of false counting due to vibration or partial occlusion. The method involves sampling the encoder outputs and latching them to be presented to a specially coded PROM. Fig. 10 shows the state decoder circuitry and waveforms for a single channel. The D f l i p - f l o p pairs act as 2-bit shift registers. At each clock pulse, the contents of two of the D flip-flops are transferred to another two D fl i p - f l o p s so that four latched outputs are presented to the PROM. Two of these outputs are the current values of the encoder signals and the other two hold the previous values of the encoder signals. The lines drawn vertically through the encoder waveforms indicate the four different transitions that can be decoded from the A and B encoder signals. These transitions are used to determine whether or not the encoder has moved. Table 3 summarizes the 16 different states that are available and the resultant movements associated with each state. Notice 55 B C— High Frequency Clock C>~— D Q CLK D Q •CLK D Q CLK D Q CLK Current A Previous A Current B Previous B AO 256 x 4 PROM Al A2 A3 F i g . 10. S i n g l e c h a n n e l s t a t e d e c o d i n g c i r c u i t r y and w a v e f o r m s . 56 Allowable PROM Inputs Comments PROM Outputs State Changes B P BC A p A c UP DOWN 1 — 1 0 0 0 0 no change 1 1 1 — 2 0 0 0 1 count up 1 0 2 — 1 0 0 1 0 count down 0 1 2 — 2 0 0 1 1 no change 1 1 1 — 4 0 1 0 0 count down 0 1 1 — 3 0 1 0 1 i l l e g a l 0 Q 2 — 4 0 1 1 0 i l l e g a l 0 0 2 — 3 0 1 1 1 count up 1 0 4 — 1 1 0 0 0 count up 1 0 4 — 2 1 0 0 1 i l l e g a l 0 0 3 — 1 1 0 1 0 i l l e g a l Q 0 3 — 2 1 0 1 1 count down 0 1 4 — 4 1 1 0 0 no change 1 1 4 — 3 1 1 0 1 count down 0 1 3 — 4 1 1 1 0 count up 1 0 3 — 3 1 1 1 1 no change 1 1 Table 3 . Resolvable states from encoder si g n a l s . 57 that there are four possible i l l e g a l or error states meaning that an intermediate state has been skipped. This wil l occur i f the frequency of the encoder signals comes too close to the sampling frequency. To eliminate this possibility, this design incorporates a 2 Mhz sampling frequency; this is two orders of magnitude greater than the maximum encoder signal frequency which would result from free-rotation, due to gravity, of the linkage arms about the joints. The PROM is coded so that its outputs represent direction. One output pulses when the signals from the encoder indicate a rotation in the UP direction, while the other pulses when the signals indicate a rotation in the opposite, or DOWN direction. Thus, in the case of a vibration, the result i s alternate toggling of the UP and DOWN outputs. Over several sampling intervals, the same number of UP pulses are emitted as DOWN pulses and no net movement of the encoder is deduced. The decoding c i r c u i t designed for this application interprets the A and B signals for up to six incremental encoders. Shown in Fig. 11, i t consists of six integrated circuits: three 74LS273 octal D flip-flops and three specially coded DM74S287 ROMs. 6.5.2 The counting circuit As seen in Fig. 11, the counting circuitry consists of four 8253-5, 16-bit counter chips, providing a total of 12 counter channels. Since two counter channels are needed per encoder, one for the UP counts, the other for the DOWN counts, this hardware has the capacity for 6 incremental encoders. The net movement of an encoder, computed from the difference between its UP and DOWN counts, coupled with its index position data (see next section), yields the absolute orientation of the joint. 58 s DO >-Dl D2 D3 •CLK D4 D5 D6 D7 DO Dl D2 D3 CLK D4 D5 D6 HD7 QO Ql Q2 Q 3 ro r-. co 3 04 C-Q5 Q6 Q7 MR  S L c ^ 5V QO Ql Q2 Q3 Q4 Q5 Q6 Q7 -O-SV DO Dl D2 D3 iCLK. D4 D5 D6 D7 QOj Ql Q2 Q3 Q4 Q5 Q6 Q7 - f e 5V AO Al A2 A3 A4 A5 A6 A7 QO Ql Q2 Q3 I AO QO Al Ql A2 Q2 A3 Q3 A4 A5 DM74S28; A6 A7 "1 F? AO QO Al Ql A2 Q2 A3 DM74S287 Q3 A4 DM74S287 A5 A6 A7 1 F.9 — US CCO CCl CC2 [C RD WR AO Al des C CO GC1 CC2 0 RD rlqWR AO Al CCS DO Dl D2 D3 D4 D5 D6 D7 GO Gl G2 •5V DO Dl D2 D3 D4 D5 D6 D7 GO Gl G2 -0-5V WR RD CRD -O CO CI C2 WR AO Al CS DO Dl D2 D3 D4 D5 D6 D7 GO Gl G2 •5V dco CI C2 RD WR AO Al CS DO Dl D2 D3 D4 D5 D6 D7 GO Gl G2 I I 1 CH5V _Q_ Q7 Q6 Q5 Q4 DM74ALS138N AO Al A2 i l E2 E3 5V • o ' i. < < a < AO Al A4 A5 A6 IORQ bO •H ADDRESS BUS 59 The counters are software programmable and in this case operate in a "latch on the fly" mode. The count at any given moment can be latched into internal registers, for reading later on, without affecting the 8253's hardware counting operation. The registers for each of the counter channels are hardwired into the I/O space for easy access by the CPU. 6.5.3 The index signal detection circuit A major design issue when using incremental encoders is to ensure that the absolute joint orientations are computed accurately. To assist in the determination of the orientation of the joints relative to the mechanical linkage, the I, or index, signal from each encoder is used as a reference. In this application, a s t i l l narrower index pulse i s generated by ANDING the A, B, and I signals together for each channel (Fig. 12). The resulting six signals act as inputs to an 8259A-2 programmable interrupt controller. These inputs can be masked or unmasked in software. When interrupts are enabled and one of these inputs i s unmasked, a pulse on the input triggers the calling of an interrupt service routine. This routine jams the UP counter with a value corresponding to the absolute position of the joint at that time, and jams the DOWN counter with zero. This mechanism provides a means for initializing the counters for each of the channels at turn-on, as well as the capability to re-index the encoders during the measurement procedure should there be a problem with lost counts. The latter i s not a problem in this application since the encoder signal frequencies produced by moving the joints by hand are much less than the 2 Mhz sampling frequency. 60 CHANNEL 5 CHANNEL 4 CHANNEL 3 CHANNEL 2 CHANNEL 1 CHANNEL 0 A B I A B I A B J A B I A B I A B I T KEYPAD CONNECTOR ©<3>©0©0©0 DM74ALS138N Si A4 A3 Al AO ADDRESS BUS F i g . 12. Index s i g n a l d e t e c t i o n and k e y p a d i n t e r f a c e c i r c u i t . 6.6 Input/Output Circuitry Main components of the input/output circuitry include the dual channel serial communication card, the speech synthesizer board, the keypad interface circuitry, and the measurement switch circuitry. The Baradyne CMOS-SIO serial communications card, which is compatible with the STD-bus, provides two RS-232-C channels. One is connected to the speech synthesizer board, while the other is used for downloading measurement data to a host computer. Standard communication rates of up to 9600 baud are supported. The speech synthesizer board consists of the circuitry from an inexpensive ECHO GP Speech Synthesizer mounted on a blank STD-bus board. A built-in text-to-speech conversion algorithm has the added capabilities of being able to use phonemes directly and modify intonation and pitch. When the vocabulary for a specific measurement task i s sent to this card, i t "speaks" the statement or command that has been issued. The audio output from the speech synthesizer i s brought to an earphone jack on the front panel. A custom circuit, which makes use of one of the unused inputs on the 8259A-2 programmable interrupt controller chip, has been designed for interfacing the keypad to the system. As shown in Fig. 12, the keypad interface circuitry consists of a 74C922 single chip hex keyboard encoder and one line to the 8259 interrupt controller. The hex keyboard encoder chip determines which key has been pressed and stores one of sixteen hex values in an internal register. The pressing of the key also generates a pulse on the input to the 8259, which, when enabled, generates a c a l l to an interrupt service routine. This service routine, in turn, enables the output of the keyboard 62 CLOCK F i g . 13. Measurement switch i n t e r f a c e . RST6.5 CLK1 0UT1 8253-5 CLK2 0UT2 -RST7.5 encoder so that the value of the key can be read. The l a s t c i r c u i t to be described i s the one which lin k s the measurement switch to the system. Since taking an accurate measurement immediately after the switch is pressed is essential to high accuracy, the measurement switch is connected through the logic shown in Fig. 13 to both the RST7.5 and the RST6.5 inputs on the 8085 CPU. The RST7.5 detects the switch being pressed down and the RST6.5 detects its release. After debouncing, the switch signal is ANDED with the 2 Mhz. clock and fed into the input for channel 1 of the 8253 counter-timer chip on the CPU card. Channels 1 and 2 of the counter-timer are cascaded; hence, the output from channel 2 connects directly to the RST7.5 input on the CPU. This configuration allows the same circuitry to be used for both the point and stream modes of operation. In addition, i t provides a means for generating various sampling rates in stream mode. The details of the interrupt service routines which record measurement data are given in Chapter 7. 6.7 Summary A functional description of the electronics hardware in the MERU Anthropometer has been provided. Reasons have been presented for choosing incremental optical encoders over other forms of angular transducers. Important aspects of the circuit design have been described with particular emphasis being given to those circuits which have been custom designed for this application. 64 CHAPTER 7 SOFTWARE DESIGN 7.1 Introduction The purpose of this chapter i s to review the system software which resides in the MERU Anthropometer. Included is a functional description of the operating program, an explanation of the main measurement loop, and details on the interrupt handling routines. The bulk of the software has been written in Pascal using Digital Research's MTplus Compiler, version 5.5. Routines which i n i t i a l i z e hardware on power-up, perform I/O, and service interrupts have been coded in Assembly language, using Microsoft's Macro-80 Assembler, version 3.4. Both the assembler and the compiler have the capabilities to generate relocatable code and pass variables and routines between one another. The Digital Research LinkMT Linker has been used to generate the executable code. 7.2 Functional Description From the operator's point of view, the Anthropometer operates according to the state diagram shown in Fig. 14. When the device i s turned on, the programmable hardware interfaces are i n i t i a l i z e d , the system's global variables are reset, a greeting i s spoken out the headphones, and a series of menu options are offered. The operator selects his application, from the menu, by pressing an appropriate key on the keypad. This is known as the INITIALIZATION mode of the system. The vocabulary for each application i s organized into an array of 65 F i g . 14. System operation state diagram. 66 commands called PHRASES. In the current version of the device, up to four separate vocabularies, corresponding to four different applications, can be accessed by the main program. Each vocabulary, which provides the aural cues for the measurement sequence for each application, is specified by the user beforehand. The text of the vocabulary must be sent to the manufacturer to be prepared for inclusion as a PROM in the system. At the present time, vocabularies of up to 50 commands are supported; each command can be a maximum of 80 characters in length. A f t e r the INITIALIZATION mode, the program enters the REFERENCE-ENCODERS mode where the operator is required to move each joint back and forth, until the index pulse i s detected and the appropriate absolute counts are loaded for each channel. This procedure must be performed for each of the five joints, in succession, before a message is issued indicating that the system is ready to take measurements. Failure to complete this task, within a reasonble time period, results in an error message being spoken, and the system returning to the beginning of the mode. Successful indexing of the encoders results in the system entering the MEASUREMENT mode. From the user's perspective, the machine gathers measurement data in one of two modes: "Point" or "Stream". Point mode allows the operator to locate a single landmark, while Stream mode provides the means for collecting data points as the stylus i s traced over a surface. The cue for which measurement mode i s in use i s found in the command issued by the speech synthesizer. The word "touch", in a command, implies that a single point measurement i s expected, whereas the words "trace over" suggest that a stream of measurements is anticipated. Once an action i s requested, the system waits for either the 67 measurement switch to be activated or a key on the keypad to be pressed. Unnoticed by the user, the system software actually performs many sub-tasks during this wait cycle. These include checking the status of important hardware components, managing the transfer of measurement data in memory, computing three-dimensional coordinates, and downloading the coordinate data, i f necessary. Pressing and releasing the measurement switch results in the position of the encoders, at that moment, being stored and frees up the system to request another measurement. Note that, in Stream mode, this same action effects the storage of several sets of encoder data over the time period that the switch is held down. Details on the interrupt service routines which handle the measurement switch can be found in section 7.4. At the end of a sequence of measurements, the system enters the SUMMARIZE mode where a verbal summary statement i s issued. The system t e l l s how many measurements were recorded in each mode and asks i f the operator wishes to record another set. If the keypad response i s affirmative, the system goes back to the REFERENCE_ENCODERS mode, otherwise, the system issues a sign-off message. 7.3 Measurement Mode — The Main Processing Loop Though not stated in the previous section, MEASUREMENT mode consists of one main software loop. The state diagram for this loop i s shown in Fig. 15. At the beginning of the loop, the system software issues a verbal command, taken from the application vocabulary, to the operator. This in turn sets a flag to t e l l the system what type of input to expect and then cycles through the various routines in the loop, waiting for that input to 68 INITIALIZE occur. These routines contain code to process sub-states which might be encountered during the wait cycle. Consider the example of the program entering the PROCESS_POINT routine, which processes the state associated with the machine being in the Point measurement mode. The state diagram for this routine i s given in Fig. 16. The f i r s t step i s to check the flag for this state and determine which sub-state is active. The support code for this sub-state is executed, the flag is updated, and the PROCESS_POINT routine is exited. Notice that no wait loops are used in any of the service routines, especially for sub-state 2, since this would mean that the processor would be essentially idle while waiting for a measurement input. By structuring a l l the routines in the main loop in a similar fashion, the CPU can perform several background tasks while "waiting" for the measurement switch to be pressed. These tasks include updating the status of global variables, calculating coordinates for encoder data present in the input buffer, checking for an input from the keypad, analyzing the meaning of keypad inputs, downloading calculated data, and checking for hardware errors. Information on the structure and implementation of other routines can be found in the internal documentation provided in Appendix IV. 7.4 Interrupt Service Routines In the current implementation of the Anthropometer, interrupts are used to detect several asynchronous events. These include the activation and release of the measurement switch, the depression of a key on the keypad, and the presence of index pulses from the five encoders. In a l l cases, the interrupt service routines have been kept as simple as possible. When the measurement switch i s pressed down, a pulse appears on the 70 F i g . 16 . S t a t e d i a g r a m f o r t h e P r o c e s s P o i n t mode. RST7.5 input of the CPU. This invokes the RST7.5 service routine which latches a l l ten counters, computes the absolute position of each encoder, stores these five positions in a ring buffer, and resets the BUTNUP flag. The counters for the encoders are latched in an order which progresses from the base of the device through to the last joint at the end of the arm; this latching operation takes 141 T states (35 microseconds in this implementation). Release of the switch results in a high logic level appearing on the RST6.5 input of the CPU. The RST6.5 service routine simply sets the BUTNUP flag to indicate the measurement has been done. To ensure that the interrupt handlers are suitable for both Point and Stream modes of operation, code i s included at the end of the RST7.5 routine which re-enables the RST7.5 interrupt when Stream mode is invoked. The keypad and the index pulses from the encoders are a l l connected to the INT interrupt through a priority interrupt controller chip. The interrupt inputs to this chip can be enabled and disabled in software. When the appropriate input i s enabled, a keypad press results in a c a l l to an interrupt service routine which stores the input character in a one character buffer and sets a flag called KPRESS. This flag i s checked in the main measurement loop, and i f set, results in the input character being processed. When an index pulse is detected on one of the other inputs, a service routine i s called which jams the appropriate counters with values corresponding to the absolute position of the encoder affected. This same routine services index pulse interrupts in both the REFERENCE_ENCODERS and the MEASUREMENT modes. 72 7.5 Summary This chapter has reviewed the software component of the MERU Anthropometer. The system operating program has been described at a functional level with the aid of a system state diagram. The use of sequential logic as applied to the main measurement loop has been explained. In addition, details have been provided on the code which services the various interrupts in the system. 73 CHAPTER 8 EVALUATION OF THE ANTHROPOMETER 8.1 Introduction The device described in the preceding chapters has been subjected to a series of technical t r i a l s in order to determine i t s accuracy and repeatability. Clinical trials have also been undertaken to determine the repeatability associated with taking measurements on a patient. The results of these trials are presented in this chapter. In addition, the capabilities and limitations of the device observed during these trials are described. As a result, recommendations for a next generation Anthropometer are presented. 8.2 Technical Trials 8.2.1 Procedure The objectives of the technical trials were to determine the accuracy and repeatability of the Anthropometer device alone. Tests were performed in the machine shop of MERU, Shaughnessy Hospital, using an Ex-Cell-0 604 CNC milling machine to position the stylus of the Anthropometer. The experimental set-up for the technical trials is shown in Fig. 17. Since the Ex-Cell-0 6 04 CNC milling machine incorporates a position readout which is accurate to +0.01 millimeters, i t provides an excellent means of assessing the performance of the Anthropometer. Because the travels of the CNC machine cover only a portion of the measurement device's working volume, the tests were performed with the base of the Anthropometer secured in one orientation, the orientation was changed, and the tests were repeated for the new orientation. In this manner, i t was possible to 74 F i g . 17. Experimental set-up for t e c h n i c a l t r i a l s . assess the accuracy and repeatability characteristics in a representative working volume. Using the working travels of the CNC machine as a guide, a measurement grid was devised, consisting of 32 distinct points. Each point was located with the Anthropometer on four separate occasions, with a different joint configuration each time. An example of two different linkage configurations used to reach the same point i s illustrated in Fig. 18. In the i n i t i a l setup of the technical t r i a l , the X and Y measurement axes of the Anthropometer were mechanically aligned as close as possible to the X and Y axes of the CNC machine. Once the base of the device was securely fastened, the linkage was stretched out to i t s f u l l length and oriented along i t s Y axis. The CNC machine was then used to measure the amount misalignment between the Y axis of the device and the Y axis of the CNC machine. This measurement was also taken at the end of the technical tr i a l . This misalignment data was later used to correct the measurement data collected by the Anthropometer so that absolute position errors could be calculated. 8.2.2 Results 8.2.2.1 Accuracy For each grid point, the average of the four measurements has been taken to be the absolute position of the point in the coordinate system of the Anthropometer. In order to determine the error in the average absolute coordinate data, this data has been corrected in order to align the coordinate system of the Anthropometer with the coordinate system of the CNC machine. The raw data consisting of the 128 coordinate triplets can be found in Appendix II. 76 77 The results of the accuracy tests, shown in Tables 4 and 5f bear some explanation. The f i r s t three columns of Table 4 give the absolute coordinates of the stylus position, as determined by the Anthropometer, and the last three columns give the absolute position as determined by the CNC machine. The Anthropometer1 s X and Y measurement values have been corrected for the misalignment of these axes with respect to the X and Y axes of the CNC machine. The Z axes were assumed to be aligned. The l e f t half of Table 5 gives the mean measurement error and the standard deviation of this error for the three Cartesian coordinates. For absolute data, the mean error in the X and Y components of the measurements i s essentially the same: ±0.35 and +0.43 millimeters, repectively. The standard deviation in the error in these two axes is also comparable: ±0.20 and ±0.34 millimeters, respectively. For the Z coordinate, the mean error i s higher at ±0.70 millimeters and the standard deviation in the error is once again comparable at ±0.30 millimeters respectively. The greater error in the Z coordinate suggests that there may be some inaccuracies in the joint or joints whose axes of rotation are perpendicular to the Z axis. 8.2.2.2 Repeatability The difference between actual measured coordinate values and average coordinate values has been used as the basis for the assessment of measurement repeatability. Means and standard deviations for the 128 differences for each Cartesian coordinate are summarized in the right half of Table 5. The mean repeatability errors in the X and Y measurements have been determined to be ±0.61 and ±0.46 millimeters respectively with a standard 78 POSITION OF STYLUS ANTHROPOMETER** CNC MACHINE X Y Z X Y Z (mm) (mm) (mm) (mm) (mm) (mm) -120.4 0.2 113.9 -120.0 0.0 113.0 -120.4 -119.1 113.8 -120.0 -120. 0 II -120.5 -238.7 113.4 -120.0 -240. 0 M -120.6 -359.0 112.3 -120.0 -360. 0 tl -120.4 -479.3 112.0 -120.0 -480. 0 It -60.5 -479.5 112.2 -60.0 -480. 0 II -0.2 -479.8 111.9 0.0 -480.0 tl 99.9 -479.9 112.0 100.0 -480 0 II 200.4 -479.8 111.5 200.0 -480.0 It 200.0 -359.7 112.5 200.0 -360 0 It 199.8 -239.7 113.1 200.0 -240 0 tl 199.5 -119.9 113.6 200.0 -120 0 It 199.6 -0.5 113.7 200.0 0 0 II 100.4 -239.6 113.8 100.0 -240.0 II 0.0 -239.7 113.6 0.0 -240 0 II -59.7 -239.2 113.5 -60.0' -240 0 113.0 -119.7 -0.6 254.0 -120.0 0 0 253.0 -120.4 -119.5 254.0 -120.0 -120 0 It -120.7 -239.9 253.1 -120.0 -240 0 It -120.5 -359.6 252.7 -120.0 -360.0 II -120.2 -480.0 252.1 -120.0 -480 0 tl -59.8 -480.0 252.2 -60.0 -480 0 11 0.0 -480.1 252.2 0.0 -480 0 It 100.3 -480.1 252.2 100.0 -480 0 tt 100.5 -480.2 252.1 100.0 -480 0 It 200.7 -360.1 252.4 200.0 -360 0 It 200.1 -240.2 253.2 200.0 -240 0 tl 199.5 -120.5 253.7 200.0 -120 0 II 199.8 -1.2 253.8 200.0 0 0 tl 100.4 -239.2 253.7 100.0 -240 0 II 0.5 -239.2 253.6 0.0 -240 .0 tt -59.6 -239.6 253.4 -60.0 -240 .0 253.0 ** - average values which have been corrected for axis misalignment T a b l e 4. Reduced measurement d a t a f r o m t e c h n i c a l e v a l u a t i o n . 79 ANTHROPOMETER ABSOLUTE MEASUREMENT ERROR ABSOLUTE REPEATABILITY ERROR COORDINATE Mean Std. Deviation Mean Std. Deviation (mm) (mm) (mm) (mm) X 0.35 0.20 0.61 0.45 Y 0.43 0.34 0.46 0.35 Z 0.70 0.30 0.35 0.26 T a b l e 5. T e c h n i c a l e v a l u a t i o n r e s u l t s . deviation of ±0.45 millimeters i n X and ±0.35 millimeters in Y. Interestingly, both the mean repeatability error and the standard deviation in that error are less for the Z coordinate data: ±0.35 and ±0.26 millimeters respectively. Since repeatability errors are associated with measurements made of the same point, but with different joint configurations, the major contributions to these errors are li k e l y to be in the linkage i t s e l f . Slight misalignment of the encoders on the shafts and inaccuracies in the machining and assembly of the joints are probably responsible to some degree. Another potential source of error is stiction. In the f i r s t joint, this could lead to a single count discrepancy which would in turn result in as much as a 0.8 millimeter error in either the X or Y coordinate. Clearly, precision machining techniques and better bearings would help to reduce these errors. Finally, there are also potential sources of error in the measurement experiment. While care was taken in this regard, i t is possible that the the attachment of the Anthropometer to the CNC machine produced stresses on the joints in certain configurations and not in others. This problem should never be encountered in clinical use, since the stylus and the base of the device should never both be rigidly anchored. 8.3 Clinical Trials 8.3.1 Procedure To evaluate the errors associated with the measurement of a li v e patient, a protocol was specified for locating the bony landmarks in the residual limbs of transtibial amputees. This protocol, which involved 23 three-dimensional measurements, is shown in Fig. 19. A positioning device, 81 R e f e r e n c e Po i n t Measurement X Y Femur 1. P o s t e r i o - 1 a t e r a l j o i n t s p a c e 2. L a t e r a l e p i c o n d y l e 3. A d d u c t o r t u b e r c l e 4. M e d i a l e p i c o n d y l e 5. P o s t e r i o - m e d i a l j o i n t s p a c e 6. M e d i a l p a t e l l a r r i d g e P a t e l l a 7. S u p e r i o r a s p e c t 8. I n f e r i o r a s p e c t .9. M e a i a l a s p e c t 10. L a t e r a l a s p e c t T i b i a 1 1. T u b e r c l e , s u p e r i o - a n t e r i o r a s p e c t 12. D i s t a l end F i b u l a 13. D i s t a l l a t e r a l a s p e c t ot head 14. D i s t a l end T i b i a l c r e s t 15. P o i n t 1 16. P o i n t 2 17 . P o i n t 3 18. P o i n t 4 l y . P o i n t 5 I n t a c t t i b i a 2 0 . T u b e r c l e , s u p e r i o r - a n t e r i o r a s p e c t 21. D i s t a l s u r f a c e of m a l e o l u s I n t a c t f i b u l a 22. D i s t a 1 - 1 a t e r a l a s p e c t ot h e a d 23. D i s t a l s u r f a c e of m a l e o l u s F i g . 19. Measurement protocol f o r c l i n i c a l t r i a l 82 designed for related work, was used to hold the residual limb in place throughout the measurement procedure. The Anthropometer was securely fastened to a tubular frame located near the patient. Fig. 20 shows the measurement environment including patient, operator, and Anthropometer. The measurement protocol was repeated three times for each patient. The c l i n i c a l data collected can be found in Appendix III. The data for a single patient has since been analyzed to determine the errors introduced in measuring palpable landmarks directly from a patient. Since the patient was allowed to remove his limb from the holder between t r i a l s , the three sets of absolute coordinate data cannot be expected to be identical. For the purpose of analysis, one of the superficial landmarks on the limb has been chosen as a reference. Distances to each of the remaining points from this reference have been calculated for the three sets of measurement data. The f i r s t part of the analysis consists of calculating the average distance to each point and then determining the differences between the three calculated distances and the average. These differences have been analyzed to give an indication of the repeatability of the c l i n i c a l measurement procedure. 8.3.2 Results Since only 19 points of the 23 measured were from one limb, only 18 distance values have been calculated. Point number 11 has been chosen as the origin for each of the distance calculations. Table 6 l i s t s the calculated distances and the average distances for the three sets of measurement data. A summary of the results of the analysis i s found in Table 7. 83 F i g . 20. E x p e r i m e n t a l s e t - u p f o r c l i n i c a l t r i a l . T a b l e 6. D i s t a n c e measurements c a l c u l a t e d f r om c l i n i c a l t r i a l d a t a . POINT # CALCULATED DISTANCE ** (from Tibial Tubercle) AVERAGE DISTANCE 1 (mm) 2 (mm) 3 (mm) (mm) i t 65. 5 65.8 69.9 67.1 2 80. 0 77.7 78.2 78.7 3* 107. 1 102.9 106.6 105.5 4 91. 2 90.0 90.3 90.5 5 81. 2 81.6 80.1 81.0 6* 88.9 86.4 84.5 86.6 7 104. 1 102.0 102.3 102.8 8» 54. 1 56.0 50.9 53.7 9 t 87. 3 84.3 88.6 86.7 iot 89. 6 81.6 89.7 86.9 12+ 65. 7 70.4 64.7 66.8 13t 42. 4 43.4 36.5 40.8 14 91. 8 88.3 88.9 89.7 15 17. 9 19.2 18.6 18.6 16 29. 4 29.4 29.4 29.4 17 38. 8 38.0 39.0 38.6 18 48. 8 48.5 48.0 48.4 19 55. 7 58.4 56.8 57.0 t - deep palpable or broad landmarks ** - distance is calculated from the 3-dimensional coordinate data provided by the Anthropometer POINTS USED ABSOLUTE DIFFERENCE BETWEEN CALCULATED DISTANCE AND AVERAGE DISTANCES Mean Std. Deviation (mm) (mm) A l l 1.3 1.2 Palpable or Broad Landmarks Only 2.2 1.2 Superficial Landmarks Only 0.6 0.5 T a b l e 7. C l i n i c a l e v a l u a t i o n r e s u l t s . 85 The mean difference between the calculated distance to each landmark and the average distance, for a l l the data, i s ±1.3 millimeters with a standard deviation of ±1.2 millimeters. However, i f the data is sub-divided into distances which are measured to superficial landmarks and distances which are measured to deep, palpable or broad landmarks, then interesting results are obtained. For easily identifiable landmarks, the mean difference i s ±0.6 millimeters with a standard deviation of ±0.5 millimeters, whereas for more difficult to locate landmarks, these same parameters are ±2.2 millimeters and ±1.2 millimeters respectively. This provides a useful breakdown of the errors due to the different types of palpation required in the clinical measurements. Using the error data for the superficial landmarks, and assuming equal contributions of error from the three absolute coordinate measurements for any landmark, then the mean error in each absolute coordinate is estimated to be ±0.4 millimeters. This figure agrees very closely with the errors calculated in the technical evaluation of the Anthropometer. 8.4 Capabilities and Limitations The Anthropometer, in its f i r s t working prototype form, has performed very well. From Table 8, which summarizes the operating specifications of the device, i t can be seen that a l l of the design c r i t e r i a have been addressed. A restatement of Table 2, which includes the Anthropometer, is given in Table 9. From the technical perspective, i t s working volume, accuracy, processing time, and sensing time specifications a l l meet or exceed the required specifications. The capability of reaching around a limb, as provided by the linkage configuration, has been found to be very useful in clinical trials of the 86 WORKING VOLUME exceeds a hemisphere of radius 60 cms. ACCURACY + 0.4 mm i n X and Y + 0.7 mm i n Z REPEATABILITY + 0.6 mm i n X + 0.5 mm i n Y + 0.4 mm i n Z STORAGE CAPACITY (non-volatile) 1500 coordinate t r i p l e t s USER-INTERFACE headphones connected to speech synthesizer 16-button keypad COMMUNICATIONS one RS-232-C s e r i a l port (DB-25 connector) SIMULTANEOUS APPLICATIONS 4 - s p e c i f i e d by i n d i v i d u a l vocabularies CPU 8085-2 running at 4 Mhz Table. 8. Anthropometer s p e c i f i c a t i o n s . CO CO SYSTEM CIRCUMFERENTIAL SHAPE MEASUREMENT CAPABILITY ( i n present form) PORTABILITY WORKING VOLUME ACCURACY PROCESSING TIME SENSING TIME AVAILABILITY COST ($U.S. x 1000) A. Non-Contact: 1. Stereophotogrammetry no no good e x c e l l e n t poor e x c e l l e n t no 100(+) 2. Structured L i g h t no no e x c e l l e n t good good e x c e l l e n t no 50(+) 3. Holography no no good e x c e l l e n t poor e x c e l l e n t no n/a 4. Semi-Automated Moire yes no good good poor e x c e l l e n t yes 100 (+) 5. F u l l y Automated Moire no no good good good e x c e l l e n t no 100(+) 6. T r i a n g u l a t i o n yes no e x c e l l e n t good(-) good e x c e l l e n t yes 30 - 50 7. T i m e - o f - F l i g h t no no poor good(+) good good(+) no n/a 8. S tereorad iography no no good poor(+) poor poor no 100(+) 9. Computerized Tomography yes no good good poor poor yes 500(+) 10. NMR Imaging yes no good good(-) poor poor l i m i t e d 500(+) B. Contact: 11. Vector Stereograph no no e x c e l l e n t good good good no n/a 12. Bio-Curve Tracer l i m i t e d no good good good good no n/a 13. Space T a b l e t l i m i t e d no poor poor good good yes 2 14. Perceptor l i m i t e d no poor(+) good e x c e l l e n t good yes 10 15. 3SPACE (Magnetic) yes no good(+) good(+) e x c e l l e n t good yes 30 16. GP-8-3D (Sonic) yes no e x c e l l e n t good(+) good good yes 12 17. MERU Anthropometer yes yes good(+) good(+) e x c e l l e n t good no (+) 10 - 15 T a b l e 9. Summary o f au tomated measurement t e c h n i q u e s i n c l u d i n g t h e MERU A n t h r o p o m e t e r . d e v i c e . T h e p o r t a b l e n a t u r e o f t h e d e v i c e h a s a l l o w e d a m e a s u r e m e n t e n v i r o n m e n t t o b e s e t - u p a n d d i s m a n t l e d w i t h e a s e . A s a r e s u l t , t h e A n t h r o p o m e t e r c a n be s t o r e d o u t o f t h e way when n o t i n use. T h e d a t a - l o g g i n g a n d d o w n l o a d i n g f u n c t i o n s o f t h e d e v i c e h a v e f u n c t i o n e d w e l l . I n f a c t , s t o r a g e o f 1500 X,Y,Z c o o r d i n a t e s h a s b e e n v e r i f i e d e x p e r i m e n t a l l y . T h e a b i l i t y t o r u n s e v e r a l m e a s u r e m e n t a p p l i c a t i o n s , s i m p l y b y s e l e c t i n g d i f f e r e n t v o c a b u l a r i e s , h a s a l s o b e e n s u c c e s s f u l l y d e m o n s t r a t e d . A s a n t i c i p a t e d , c a l i b r a t i o n o f t h e d e v i c e has n o t been a p r o b l e m . T h e o n l y d i f f i c u l t i e s w h i c h h a v e a r i s e n , r e l a t e d t o t h e d e s i g n c r i t e r i a , i n v o l v e t h e r e l i a b i l i t y o f t h e d a t a s t o r a g e and t h e c o n v e n i e n c e o f t h e u s e r i n t e r f a c e . W h i l e t h e ECHO GP s p e e c h s y n t h e s i z e r has b e e n u s e d t o d e m o n s t r a t e t h e f e a s i b i l i t y o f u s i n g v o i c e - c u e i n g , t h e q u a l i t y o f t h e s p e e c h i s r e l a t i v e l y p o o r c o m p a r e d t o human v o i c e . E x p e r i m e n t a t i o n w i t h p h o n e m e s a n d p i t c h v a r i a b l e s may y i e l d some i m p r o v e m e n t , b u t f u t u r e v e r s i o n s o f t h e d e v i c e s h o u l d c a r e f u l l y a s s e s s t h e s p e e c h p e r f o r m a n c e r e q u i r e m e n t s . I f o n l y a c u e i n g s y s t e m i s r e q u i r e d a n d t h e o p e r a t o r i s l i k e l y t o b e f a m i l i a r w i t h t h e a p p l i c a t i o n , t h e n t h e c u r r e n t s p e e c h s y n t h e s i s s y s t e m i s p r o b a b l y a d e q u a t e . H o w e v e r , m o r e s o p h i s t i c a t e d a p p l i c a t i o n s , i n v o l v i n g s e v e r a l o p e r a t o r s u n f a m i l i a r w i t h t h e d e t a i l s o f t h e m e a s u r e m e n t t a s k , w o u l d b e n e f i t f r o m h i g h e r q u a l i t y s p e e c h g e n e r a t i o n . T h e r e l i a b i l i t y o f t h e d a t a s t o r a g e i s a m a j o r c o n c e r n s i n c e t h e o b j e c t i v e o f u s i n g t h e d e v i c e a s a r e m o t e w o r k s t a t i o n i s compromised. On o c c a s i o n , when t h e d e v i c e i s t u r n e d o n a n d o f f , t h e c o n t e n t s o f t h e b a t t e r y - b a c k e d - u p RAMs do c h a n g e . T h i s m i g h t be d u e t o n o i s e o n t h e c o n t r o l l i n e s t o t h e s e RAMs, h o w e v e r f u r t h e r w o r k n e e d s t o b e d o n e t o 89 investigate this problem. One other functional limitation of the device, i s that, for certain movements, i t needs to be supported by two hands. This i s because the current version of the linkage contains no springs or counterweights to support i t s e l f . A preliminary analysis suggests that counterbalancing joint number 2 would result in a significant improvement. Some non-functional problems include the clamp and the wiring of the linkage. While sturdy and secure, the clamp could be improved aesthetically. The same could be done for the wiring of the device. A review of the limitations of the current prototype suggests that most could be resolved in a production engineering phase. In a production quantity of at least 50 units, i t has been estimated that the cost to produce the Anthropometer would be between $3500 and $4000 (U.S.). Assuming a multiple of between 3 and 4 to bring the device to market, the anticipated r e t a i l price i s expected to be between $10,000 and $15,000 (U.S.). Provided these estimates are correct, the MERU Anthropometer should be competitive with other commercially available three-dimensional digitizers (see Table 9). 8.5 The Next Generation A production version of the MERU Anthropometer should include a l l the hardware and software enhancements described previously. The mechanical design would benefit from the incl u s i o n of counterweights or springs, especially around the second joint. The linkage could then support i t s own weight when released. Precision machining techniques, and possibly better bearings, should be used to improve the quality control on the joints. The clamp at the base of the device should 90 be designed to perform the same functions as the current clamp, in a more aesthetic package. The method of enclosing the wires which carry the encoder signals from each of the joints should also be improved. Suggested improvements in the electrical hardware include resolving the problems associated with the non-volatile storage of the coordinate data, and upgrading the speech synthesis system. The measurement switch might be located right on the linkage, so that i t could be accessed by the hand that holds the stylus. Alternatively, an optional foot-switch might be provided. The two wire-wrapped, custom boards in the system should be converted into printed c i r c u i t cards. It may be possible to combine them into one PCB, and offer, as an STD-bus product, a single card with the capability of interfacing up to 6 incremental encoders. The issue of battery operation is contentious from a marketing stand-point. Battery-operated c l i n i c a l equipment is plagued by the requirement that the user remember to charge the batteries and replace them i f they are not holding a charge. Thus, aside from the replacement of current components by their low power counterparts, i t would appear that successful implementation of battery operation should include a) internal monitoring of the battery charge, b) a visible percentage of f u l l charge indicator, and c) an internal charger. These latter design additions represent added cost and probably should not be included unless deemed essential by propective users. One software feature which would be very useful would be to have a STREAM IN DISTANCE mode of operation, where data would be collected at specific distance increments as the stylus is traced over a surface. This would ensure that the amount of data collected is independent of the speed that the stylus is moved. 91 While the size of the code (20 Kbytes) associated with the system program is not excessive, i t may be worthwhile to consider implementing the system software in the C language. This would generate more compact code and free up more memory for extra vocabularies and/or data storage. The possibility of incorporating custom applications which include some rudimentary data analysis should also be considered. These would involve simple programs which would call the various system routines which perform data capture, analyze the collected data, and store only the relevant results of the analysis. Selection of the custom application could be made from an i n i t i a l menu, in the same way that vocabularies are selected now. A final software utility which should be included, is the capability to act as a simple digitizer for a host computer. This would allow the MERU Anthropometer to compete directly with existing three-dimensional digitizers, while offering a l l the additional benefits of a stand-alone workstation. 8.6 Summary An evaluation of the MERU Anthropometer has been conducted which includes a series of technical trials followed by clinical experimentation with a patient. Quantitative assessments have been made of the accuracy and repeatability of the device in the laboratory and the c l i n i c . The capabilities of the prototype device have been related back to the original design criteria and observed limitations have been presented. A discussion of a future generation device has addressed these limitations and has proposed design changes which would make the MERU Anthropometer a very useful and flexible measurement device. 92 CHAPTER 9 CONCLUSIONS Three-dimensional measurement, in relation to the human form, has been reviewed and a need has been perceived for a workstation which is capable of gathering three-dimensional data around an object such as a limb. While various automated measurement devices exist, most are limited by cost, small working volume, or the requirement that a host computer perform the coordinate calculations. The latter implies lack of portability and no capacity to act as stand-alone measurement system. A new device, called the MERU Anthropometer, has been designed to address these limitations and f i l l a new measurement niche. The device is portable and programmable. Its accuracy and working volume meet the requirements for anthropometric measurements. Based on an instrumented spatial linkage, whose configuration has been optimized for measuring limb segments, the device requires that an operator locate a stylus on a point of interest, and activate a switch. In a remote measurement application, three-dimensional coordinates are calculated and stored in non-volatile memory. This measurement data can later be downloaded to a host computer for analysis. The user-interface consists of a speech synthesizer, headphones, and a keypad. By customizing one of the device's four operating vocabularies, the user can program the device to issue commands and record three-dimensional data to suit his application. With these features, the Anthropometer is truly a three-dimensional measurement workstation. Cost of the device is estimated to be comparable to that of existing commercial three-dimensional digitizers. 93 A s e r i e s o f t e c h n i c a l and c l i n i c a l t r i a l s i n d i c a t e t h e d e v i c e i s e a s y t o m a n i p u l a t e , e a s y t o u s e , a n d g e n e r a l l y w e l l s u i t e d t o a n t h r o p o m e t r i c a p p l i c a t i o n s . When m e a s u r e m e n t s f r o m t h i s d e v i c e a r e c o m b i n e d w i t h a n t h r o p o m e t r i c s h a p e m o d e l l i n g t e c h n i q u e s , t h e n m a j o r i m p r o v e m e n t s a r e e x p e c t e d i n c l i n i c a l shape management . W h i l e o r i g i n a l l y d e s i g n e d w i t h a p r o s t h e t i c a p p l i c a t i o n i n m i n d , t h e MERU A n t h r o p o m e t e r h a s d e m o n s t r a t e d t h e p o t e n t i a l f o r b e i n g a g e n e r a l p u r p o s e , t h r e e - d i m e n s i o n a l measurement d e v i c e . 94 REFERENCES [I] Allard, P., Sirois, J.P., Thiry, P.S., Geoffroy, G., Duhaime, M.f "Roentgenographic study of cavus foot deformity in Friedrich Ataxia patients: Preliminary report", Can. J. Neurological Sciences, vol. 9, no. 2, pp. 113-117, 1982. [2] Armstrong, T.J., Chaffin, D.B., Foulke, J.A., "A method for measuring anatomical surfaces", J. Biomechanics, vol. 12, pp. 397-399, 1979. [3] Barclay, W., "Below-knee amputation prostheses", Prosthetic and Orthotic Practice, Murdoch, Ed., London, England: Edward Arnold, pp. 69-78, 1970. [4] Chetwynd, D.G., "The digitization of surface profiles", Wear, vol. 57, pp. 137-145, 1979. [5] Cobb, J., A Projected Grid Method for Recording the Shape of the Human Face, Technical Report 71184, Royal Aircraft Establishment, Ministry of Defence, Farnborough, Hants, England, March 1972. [6] Contour Medical Systems Inc., CEMAX 1000, product literature. [7] Dean, D.P., Saunders, C.G., "A software package for the design and manufacture of prosthetic sockets for transtibial amputees", IEEE Trans. Biomed. Eng., vol. BME-32, no. 4, pp. 257-262, 1985. [8] Duncan, D.P., Dean. D.P., Pate, G.C., "Moire contourography and computer-aided replication of human anatomy", Engineering in Medicine, vol. 9, no. 1, pp. 29-36, 1980. [9] Fadche, S., Personal communication, Radiologist, MRI Fac i l i t y , University of British Columbia, Health Sciences Hospital. [10] Fernie, G.R., H a l s a l l , A.P., Ruder, K., "Shape sensing as an educational aid for student prosthetists", Prosthetics and Orthotics International, vol. 8, pp. 87-90, 1984. [II] Fernie, G.R., Griggs, G., Bartlett, S., Lunau, K., "Shape sensing for computer aided below-knee socket design", Prosthetics and Orthotics International, vol. 9, pp. 12-16, 1985. [12] Foort, J., "The Patellar-Tendon-Bearing prosthesis for below-knee amputees: A review of technique and criteria", A r t i f i c i a l Limbs, vol. 9, no. 1, pp. 4-13, 1965. [13] Foort, J., "Prosthetic f i t t i n g and components - lower extremity amputees", Rehabilitation Management of Amputees, Banerjee, Ed., Baltimore/London, Williams and Wilkins, pp.42-98, 1982. [14] Frobin, W., Hierholzer, E., "Rasterstereography: A photogrammetric method for the measurement of body surfaces using a projected grid", Photogrammetric Engineering and Remote Sensing, vol. 47, no. 12, pp. 1717-1724, 1981. 95 [15] Fuji Photo Optical Corporation, MC5000 Moire Optical Pattern Analyzer, product literature. [16] Gara, A.D., Majkowski, R.F., Hubbard, R.P., Mcleod, D.G., "Bio-medical applications of a holographic system for automatic surface mapping", Proceedings of the 17th Annual Technical Meeting of the SPIE, San Diego, California, pp. 117-126, 1974. [17] Herron, R.E., "Biostereometric Measurement of Body Form", Yearbook of Physical Anthropology, vol. 16, pp. 80-121, 1972. [18] Harada, Y., Takemitsu, Y., Imai, M., "The role of countour line photography using the light cutting method and Moire topography in school screening for scoliosis", Moire Fringe Topography and Spinal Deformity, Moreland, Pope, and Armstrong, Ed., pp. 113-121, 1981. [19] Hierholzer, E., Frobin, W., "Automatic measurement of body surfaces using rasterstereography", Biostereometrics '82, Herron, Ed., Proc. SPIE, vol. 361, pp. 125-131, 1983. [20] Higgins, M., "Ultrasound imaging in 3-D", Computer Graphics World, vol. 3, p. 89, 1983. [21] Himmel, D.P., "A laser measuring system for automatic industrial inspection", Proceedings of the 4th International Joint Conference on Pattern Recognition, pp. 952-954, November, 1978. [22] Idesawa, M., Yatagai, T., Soma, T., "Scanning Moire method and automatic measurement of 3-D shapes", Applied Optics, vol. 6, no. 8, pp. 2152-2162, 1977. [23] Idesawa, M., Yatagai, T., "3-D shape input and processing by Moire technique", Proceedings of the 5th International Conference on Pattern Recognition, pp. 1085-1090, December 1980. [24] Idrus, N., "An integrated system for three-dimensional surface scanning", Precision Engineering, vol. 3, no. 1, pp. 37-43, 1981. [25] Johnson, R., "Designing with optical shaft encoders", Robotics Age, pp. 27-31, May/June, 1983. [26] Kratky, v., "Stereophotogrammetric approach to 3-D modeling of limbs in orthopaedics", Three-Dimensional Shape Sensing and Reproduction of Limbs and Limb Remnants, University of British Columbia, Vancouver, B.C., Canada, Conference held October 18, 1973, published by National Academy of Sciences, Washington, D.C., 1975. [27] Krouskop, T.A., Goode, B.A., Dougherty, D.R., Hemmen, E.H., "Predicting the loaded shape of an amputee's residual limb", Proceedings of the Eighth Annual Conference on Rehabilitation Technology, Memphis, Tenessee, pp. 225-227, 1985. [28] Levine, S.S., Gallios, G., Balasubramanian, N., Wyant, J.C, "Three-dimensional inspection by a revolutionary optical surface measurement 96 technique", Advances in Optical Metrology, Proceedings of the SPIE, vol. 153, pp. 96-100, 1978. [29] Lew, W.D., Lewis, J.L., "An anthropometric scaling method with application to the knee", J. Biomechanics, vol. 10, pp. 171-181, 1977. [30] Lewis, J.L., Lew, W.D., Zimmerman, J.R., "A nonhomogeneous anthropometric scaling method based on finite element principles", J. Biomechanics, vol. 13, pp. 815-824, 1980. [31] Lohmann, A.W., Po-shiang L., "Computer generated Moire", Optics Communications, vol. 34, no. 2, pp. 167-170, 1980. [32] Marsh, J.L., Vannier, M.W., "The 'third' dimension in craniofacial surgery", Plastic and Reconstructive Surgery, vol. 71, no. 6, pp. 759-767, 1983. [33] Meadows, D.M., Johnson, W.O., Allen, B., "Generation of surface contours by Moire pattern", Applied Optics, vol. 9, pp. 942-947, 1970. [34] Micro Control Systems Inc., Space Tablet Advanced Space Graphics System, product literature. [35] Micro Control Systems Inc., The Perceptor, product literature. [36] Morrison, J.B., "The mechanics of the knee joint in relation to normmal walking", J. Biomechanics, vol. 3, pp. 51-61, 1970. [37] Moore, D.T., Truax, B.E., "Phase locked Moire fringe analysis for automated contouring of diffuse surfaces", Applied Optics, vol. 18, no. 1, pp. 91-96, 1979. [38] Novicov, A., Foort, J., "Computer-aided socket design for amputees", Biostereometrics '82, Proceedings of SPIE, vol. 361, Herron, Ed., pp. 275-278, 1983. [39] Paul, R.P., Robotic Manipulators: Mathematics, Programming, and Control, The MIT Press, Massachusetts, 1981. [40] Perrin, J.C, Thomas, A., "Electronic processing of Moire fringes: application to Moire topography and comparison with photogrammetry", Applied Optics, vol. 18, no. 4, pp. 563-574, 1979. [41] Pierrynowsky, M.R., Morrison, J.B., "Estimating the muscle forces generated in the human lower extremity when walking: A physiological solution", Mathematical Biosciences, vol. 75, pp. 43-68, 1985. [42] Polhemus Navigation Sciences Division, McDonnell Douglas Electronics Company, 3SPACE Digitizer and Tracker, product literature. [43] Pynsent, P.B., Fairbank, J.C.T., Clack, F.J., Phillips, H., "Computer recording of anatomical points in three-dimensional space", J. Biomed. Eng., vol. 5, pp.137-140, 1983. [44] Raab, F.H., Blood, E.B., Steiner, T.O., Jones, H.R., "Magnetic 97 position and orientation tracking system", IEEE Transactions on Aerospace and Electronic Systems, vol. AES-15, no. 5, pp. 709-718, 1979. [45] Reicher, M.A., Rauschning, W., Gold, G.H., Bassett, L.W., Lufkin, R.B., Glen, W., "High resolution magnetic resonance imaging of the knee joint: Normal anatomy", Amer. J. Roentology, vol. 145, no. 5, pp. 875-902, 1985. [46] Renner, W.D., "A photogrammetric technique for use in radiation therapy", Photogrammetric Engineering and Remote Sensing, vol. 43, no. 5, pp. 581-591, 1977. [47] Rouse, D., A Proposed Design for an Orthopedic Footwear CAD/CAM Delivery System, Report to National Institute of Health, prepared by the Research Triangle Institute, Contract No. 300-83-0236, 1984. [48] Saunders, C.G., "Replication from 360 degree Moire sensing", Moire Topography and Spinal Topography, Moreland, Pope, and Armstrong, Ed., pp. 122-131, 1981. [49] Saunders, C.G., Automated Shape Definition Systems — A Review, Interim Report for National Health and Welfare Project #6610-1255-51, 1982. [50] Saunders, C.G., Fernie, G.R., "Automated prosthetic f i t t i n g " , Proceedings of the 2nd International Conference on Rehabilitation Engineering, Special Sessions, Ottawa, Canada, pp. 239-242, 1984. [51] Saunders, C.G., Vickers, G.W., "A generalized approach to the replication of cylindrical bodies with compound curvature", J. Mech. Trans. Auto. Design, vol. 106, pp. 70-76, 1984. [52] Saunders, C.G., Foort, J., Bannon, M., Dean, D., Panych, L., "Computer aided design of prosthetic sockets for transtibial amputees", Prosthetics and Orthotics International, vol. 9, pp. 17-22, 1985. [53] Science Accessories Corporation, Model GP-8-3D Sonic Digitizer, product literature. [54] Sirois, J.P., Allard, P. Duhaime, M., Geoffroy, G., Kofman, J., "Evaluation of foot deformity using a three-dimensional geometric model", Can. J. Neurological Science, vol. 11, no. 4, pp. 578-581, 1984. [55] Snezhko, Y.A., Tychinskii, V.P., "Laser profilograph", Pribory I Tekhnika Eksperimenta (USSR), pp.1244-1245, July/August, 1976. [56] Takasaki, H., "Moire topography", Applied Optics, vol. 12, no. 4, pp. 845-850, 1973. [57] Takasaki, H„ "Simultaneous all-round measurement of a living body by Moire topography", Photogrammetric Engineering and Remote Sensing, vol. 41, pp. 1527-1532, 1975. 98 [58] Takasaki, H.f "The development and the present status of Moire topography", Cptica Acta, vol. 26, no. 8, pp. 1009-1019, 1979. [59] Turner-Smith, A., "Television scanning technique for topographic body measurements", Biostereometrics '82, Proceedings of SPIE, vol. 361, Herron, Ed., pp. 279-283, 1983. [60] Ueda, T., "Real time contour line generation for measuring 3D shapes", Review of the Electrical Communication Laboratories, Nippon Telephone and Telegraph Public Corporation, vol. 27, no. 9, pp. 876-885, 1979. [61] Ueda, T., "Electronic grating Moire topography", Medinfo 80, Lindberg and Kaihara, Ed., North-Holland Publishing Company, pp. 1173-1177, 1980. [62] Vannier, M.W., Marsh, J.L., Stevens, W.G., "Surface reconstruction and computer aided design of craniofacial surgical procedures based on CT scans", Proceedings of the National Computer Graphics Association (U.S.), vol. 2, pp. 116-130, 1984. [63] Von Maltzahn, W.W., Kondraske, G.V., "An instrument to measure range of motion", Proceedings of the Eighth Annual Conference on Rehabilitation Technology, Memphis, Tenessee, pp. 165-167, 1985. [64] Williams, A.R., "Light sectioning as a three-dimensional measurement system in medicine", J. Photographic Science, vol. 25, pp. 85-92, 1977. [65] Yamashita, Y., Suzuki, N., Oshima, M., Yamaguchi, Y., "Three-dimensional measurement system using optical scanners, cylindrical lenses, and line sensors", Biostereometrics '82, Proceedings of SPIE, vol. 361, Herron, Ed., pp. 67-73, 1983. [66] Yatagai, T., Idesawa, M„ Saito, S., "Automatic fringe analysis using di g i t a l image processing techniques", Optical Engineering, vol. 21, no. 3, pp. 432-435, 1982. 99 APPENDIX I PROGRESS MADE WITH THE CASD SYSTEM 100 1.1 Technical Progress To date, there have been two rounds of development of the CASD software. Round 1 was implemented on an 8-bit IMS 8000 microcomputer. Because of system deficiencies identified in the c l i n i c a l t r i a l s of the Round 1 software, the Round 2 version involved a change in hardware and major modifications to the software. The hardware configuration is now an IBM PC/XT with 256 K of RAM, an Intel 8087 numeric coprocessor, one parallel and two serial I/O ports. The graphics display and interactive shape display are controlled by a Vectrix VX/PC (640x480 resolution) graphics machine and shown on a Vectrix VXM monitor. The MouseSystems optical mouse i s used to interact with the display. The Round 2 version of the CASD software has been coded in Pascal and 8088 Assembly language. 1.2 Clinical Progress The following description of the clinical progress made to date with the CASD system i s based on the internal c l i n i c a l t r i a l s which followed each round of technical development. 1.2.1 Internal clinical trials - Round 1 In the first round of clinical trials, two issues were investigated: a) could an inexperienced prosthetist use the CASD system, in a course of multiple fittings, with progressive modifications, to arrive at suitable sockets, and b) could the CASD system be used to design a properly fitting socket on the first attempt. On the first issue, four subjects, three traumatic and one congenital amputee, were selected for trials. After one t r i a l , the congenital amputee 101 was no longer attempted since his designed socket shape was clearly inappropriate. Several fitting iterations were carried out on the remaining three and each socket was assessed on the basis of a fivepoint rating scheme. After an average of 5 iterations, two of the three amputees were fitted to a level of 4 out of 5 (ie. could walk with minor discomfort). For the t r i a l which assessed the results of f i r s t iteration sockets designed on the CASD system, twelve traumatic amputees were attempted at the Bioengineering Centre, University College London. Three out the twelve were fi t t e d to a level of 4 out of 5. In neither t r i a l were we able to achieve an entirely comfortable socket; this led to a second round of technical development. 1.2.2 Internal clinical trials - Round 2 A three-month c l i n i c a l t r i a l of the Round 2 software was started in April 1985 at MERU. The objective was to determine whether or not an experienced prosthetist could use the CASD system to design comfortable sockets (ie. a rating of 5 out of 5). A walking course was designed in order to provide a more demanding test of socket f i t . Approximately 300 metres in length, i t involved various types of terrain: steps, grass, gravel, and pavement combined with uphill and downhill grades. After each lap of the course, the amputee's stump was examined for any signs of excess pressure. If there were no signs of wear on the stump, and the amputee wanted to proceed, he would be taken on another lap of the course. Five successful laps of the course, with no signs of undue pressure on the stump, and no complaints from the amputee would result in a rating of 5 being given for the socket. 102 Seven subjects with traumatic amputations were fi t t e d at least 3 times. Four of the seven were brought to the level of 5 out of 5 after an average of 8 iterations (fewest iterations = 3, most = 14). Two others were very close after 6 iterations (ie. completed 4 successful laps of the course), but time did not permit the successful resolution of their f i t . The seventh subject was only able to stand on his socket after 6 f i t t i n g attempts. An analysis of the successful socket shapes showed that certain consistent modifications had to be made to the primitive socket in order to achieve the well-fitting sockets. These shape modifications have since been included into the primitive socket database. The expectation is that this should significantly reduce the number of iterations necessary to achieve a properly fitting socket. The issue of whether or not this expectation has been realized i s now being addressed by the several external c l i n i c a l evaluations which are now underway. In summary, MERU's findings from the Round 2 clinical t r i a l are: a) the CASD system can be used to design well-fitting sockets for trans-tibial amputees b) several iterations are required to achieve a successful result. 103 APPENDIX II TECHNICAL TRIAL DATA 104 TECHNICAL TRIAL DATA CNC Machine X Y Z -1200 0 2530 POSITION OF THE ANTHROPOMETER Anthropometer x values x y values -1187 -1200 -1200 -1200 -2400 -1200 -3600 -1200 -4800 - 600 -4800 -4800 1000 -4800 2000 -4800 STYLUS (Uncorrected) y z values -1189 -1184 -1192 -1183 -1197 -1194 -1211 -1194 -1213 -1203 -1210 -1201 -1219 -1210 -1209 -1202 -1226 -1217 -1203 -1201 - 622 - 613 - 607 - 599 - 21 - 5 - 6 - 7 979 999 996 998 1989 1996 1994 2001 -1199 -1207 -1210 -1212 - 608 - 10 933 1995 0 -17 3 -4 -1186 -1199 -1191 -1198 -2386 -2404 -2398 -2405 -3582 -3603 -3601 -3593 -4787 -4804 -4804 -4801 -4791 -4809 -4806 -4803 -4798 -4812 -4804 -4806 -4803 -4816 -4812 -4810 -4814 -4821 -4815 -4812 -5 -1194 -2398 -3595 -4799 -4802 -4805 -4810 -4816 2552 2537 2539 2533 2550 2540 2534 2536 2544 2527 2527 2527 2537 2519 2525 2528 2524 2516 2523 2521 2529 2518 2516 2524 2528 2516 2522 2522 2527 2516 2519 2525 2523 2516 2519 2526 105 TECHNICAL TRIAL DATA (Cont'd) POSITION OF THE ANTHROPOMETER STYLUS CNC Machine A n t h r o p o m e t e r ( U n c o r r e c t e d ) X Y Z x v a l u e s x y v a l u e s y z v a l u e s z 2000 -3600 2530 1999 2002 -3615 -3614 2531 2526 2013 -3614 2523 1993 -3614 2521 2002 -3612 2529 2000 -2400 " 2001 2001 -2417 -2415 2541 2532 2011 -2411 2529 1991 -2415 2529 1999 -2418 2530 2000 -1200 " 1992 2000 -1223 -1214 2546 2537 2007 -1205 2537 2000 -1214 2528 2002 -1215 2536 2000 0 " 2004 2008 - 35 - 25 2549 2538 2007 - 12 2540 2011 - 22 2533 2009 - 30 2531 1000 -2400 " 996 1004 -2398 -2401 2540 2537 1015 -2403 2535 1003 -2397 2535 1003 -2406 2539 0 -2400 " - 4 5 -2387 -2396 2545 2536 11 -2405 2532 7 -2397 2533 7 -2395 2534 - 600 -2400 " - 607 - 596 -2391 -2398 2543 2534 - 594 -2404 2530 - 593 -2394 2533 - 591 -2403 2529 106 TECHNICAL TRIAL DATA (Cont'd) POSITION OF THE ANTHROPOMETER STYLUS CNC Machine Anthropometer (Uncorrected) X Y Z x values x y values y z values z -1200 0 1130 -1185 -1194 3 3 1142 1139 -1191 7 1138 -1208 13 1142 -1192 - 9 1136 -1200 -1200 " -1198 -1199 -1190 -1190 1141 1138 -1194 -1203 1136 -1191 -1185 1134 -1204 -1182 1140 -1200 -2400 " -1221 -1205 -2380 -2386 1137 1134 -1203 -2399 1132 -1191 -2381 1130 -1204 -2384 1137 -1200 -3600 " -1227 -1211 -3581 -3589 1127 1123 -1211 -3600 1120 -1999 -3584 1119 -1207 -3589 1124 -1200 -4800 " -1234 -1216 -4784 -4792 1124 1120 -1218 -4800 1119 -1202 -4790 1118 -1211 -4793 1117 - 600 -4800 " - 613 - 615 -4793 -4797 1126 1122 - 615 -4806 1121 - 608 -4795 1120 - 607 -4794 1119 0 -4800 " - 30 - 12 -4800 -4802 1124 1119 - 9 -4810 1118 - 2 -4802 1113 - 8 -4797 1120 1000 -4800 " 992 989 -4813 -4808 1120 1120 987 -4813 1119 992 -4804 1117 985 -4801 1124 2000 -4800 " 1994 1994 -4815 -4811 1113 1115 1992 -4817 1111 1997 -4806 1119 1990 -4806 1117 107 TECHNICAL TRIAL DATA (Cont'd) POSITION OF THE ANTHROPOMETER STYLUS CNC Machine Anthropometer (Uncorrected) X Y Z x values X y values y z values z 2000 -3600 1130 2008 1995 -3612 -3610 1123 1125 2001 -3617 1121 1988 -3607 1123 1984 -3604 1132 2000 -2400 II 2011 1998 -2413 -2410 1130 1131 2003 -2413 1130 1992 -2408 1129 1987 -2406 1133 2000 -1200 II 2013 2000 -1210 -1212 1137 1136 2006 -1210 1135 1994 -1214 1137 1987 -1215 1137 2000 0 II 2017 2006 - 15 - 18 1135 1137 2003 - 13 1137 2005 - 19 1135 1998 - 25 1139 1000 -2400 II 999 1004 -2404 -2405 1140 1138 1009 -2408 1135 997 -2401 1137 1000 -2406 1140 0 -2400 II - 5 0 -2400 -2401 1141 1138 5 -2405 1132 - 1 -2398 1134 3 -2400 1136 • 600 -2400 II - 605 -597 -2392 -2394 1141 1135 - 596 -2400 1130 - 597 -2393 1136 - 591 -2390 1131 108 TECHNICAL TRIAL DATA (Cont'd) Misalignment of the Anthropometer coordinate reference frame with respect to the CNC machine coordinate reference frame: ROTATIONAL misalignment: in the XfY plane = 4.6 x 10-3 radians TRANSLATIONAL misalignment: in the X coordinate =0.9 millimeters in the Y coordinate =0.3 " (** Note: the Z axes of the Anthropometer and the CNC machine were assumed to be aligned **) 109 APPENDIX I I I CLINICAL TRIAL DATA 110 SUBJECT NO: 1 TRIAL NO: 1 FEMUR 1. Postericrlateral joint space 2. Lateral epicondyle 3. Adductor tubercle 4. Medial epicondyle 5. Postericrmedial joint space 6. Medial patellar ridge PATELLA 7. Superior aspect 8. Inferior aspect 9. Medial aspect 10. Lateral aspect TIBIA 11. Tubercle, superior anterior aspect 12. Distal end FIBULA 13. Distal lateral aspect of head 14. Distal end TIBIAL CREST 15. Point 1 16. Point 2 17. Point 3 18. Point 4 19. Point 5 INTACT TIBIA 20. Tubercle, supericranterior aspect 21. Distal surface of maleolus INTACT FIBULA 22. Distal lateral aspect of head 23. Distal surface of maleolus X Y Z (in millimeters x 10) 1103 -3511 -2248 1272 -3493 -2235 1417 -2645 -2335 1159 -2566 -2269 1019 -2615 -2397 1251 -2731 -1970 1406 -2956 -1657 907 -3027 -1816 118/ -2/29 -1850 1315 -3241 -1727 527 -3213 -2153 -17 -3212 -2521 753 -3526 -23 30 30 -3552 -2846 374 -3219 -2246 279 -3220 -2311 204 -3207 -2368 117 -3215 -2417 61 -3221 -2458 689 -1243 -2307 -2659 -2540 -3563 700 -914 -2778 -2599 -1850 -3793 111 SUBJECT NO: 1 TRIAL NO: 2 FEMUR 1. Postericrlateral joint space 2. Lateral epicondyle 3. Adductor tubercle 4. Medial epicondyle 5. Posterio-medial joint space 6. Medial patellar ridge PATELLA 7. Superior aspect 8. Inferior aspect 9. Medial aspect 10. Lateral aspect TIBIA 11. Tubercle, superio-anterior aspect 12. Distal end FIBULA 13. Distal lateral aspect of head 14. Distal end TIBIAL CREST 15. Point 1 16. Point 2 17. Point 3 18. Point 4 19. Point 5 INTACT TIBIA 20. Tubercle, superio-lateral aspect 21. Distal surface of maleolus INTACT FIBULA 22. Distal lateral aspect of head 23. Distal surface of maleolus X Y Z (in millimeters x 10) 1172 -3433 -2224 1326 -3422 -2139 1423 -2596 -2267 1208 -2529 -2212 1074 -2606 -2390 1310 -2689 -1928 1485 -2925 -1595 992 -2974 -1689 1247 -270 6 -1760 1320 -3245 -1664 599 -3168 -2038 2 -3182 -2410 846 -3484 -2205 107 -3469 -2706 431 -3175 -2130 349 -3165 -2193 277 -3162 -2240 184 -3174 -2289 101 -3160 -2343 555 -1059 -2361 •2726 -2209 -3585 678 -686 -2709 •2744 -1517 -3842 112 SUBJECT NO: 1 TRIAL NO: 3 FEMUR 1. Posterio-lateral joint space 2. Lateral epicondyle 3. Adductor tubercle 4. Medial epicondyle 5. Posterio-medial joint space 6. Medial patellar ridge PATELLA 7. Superior aspect 8. Inferior aspect 9. Medial aspect 10. Lateral aspect TIBIA 11. Tubercle, superio-anterior aspect 12. Distal end FIBULA 13. Distal lateral aspect of head 14. Distal end TIBIAL CREST 15. Point 1 16. Point 2 17. Point 3 18. Point 4 19. Point 5 INTACT TIBIA 20. Tubercle, superio-lateral aspect 21. Distal surface of maleolus INTACT FIBULA 22. Distal lateral aspect of head 23. Distal end X Y Z (in millimeters x 10) 1170 -3507 -2183 1291 -3484 -2111 1459 -2649 -2212 1212 -2578 -2141 1050 -2630 -2293 1277 -2750 -1866 1471 -2992 -1548 961 -3030 -1710 1280 -2763 -1684 1375 -3277 -1601 572 -3198 -1992 14 -3189 -2319 706 -3474 -2189 77 -3491 -2670 417 -3229 -2090 322 -3219 -2145 241 -3215 -2198 163 -3229 -2241 89 -3214 -2290 436 -1310 -2388 •2901 -2442 -3511 538 -824 -2908 •2952 1716 -3839 113 APPENDIX IV PROGRAM LISTING 114 PROGRAM master_program_for_3D_digitizer; (* Author: CG. Saunders . (* Date: Sept. 21, 1985 *) Title: 3DMAS.SRC *) (* LATEST UPDATE (* (* Sept. 30, 1985 *) DEC 18, 1985 — delay procedure *) Feb. 8, 1986 — test for absolute variable bo_phras *) {$L-} {$1 DAVCONST.INC} {$1 NEWTYPE.INC} {$1 NEWVARS.INC} {$L+} EXTERNAL PROCEDURE setup_sentences; EXTERNAL PROCEDURE nake_key_words; EXTERNAL PROCEDURE setup_dialogue; (* in Module — 3DSP *) EXTERNAL PROCEDURE convrt(i:integer; VAR s: wshort); (* in Module - 3DDIG *) EXTERNAL PROCEDURE dig_process (VAR st: vlong_sentence); (* " " *) EXTERNAL PROCEDURE system_init; (* *) EXTERNAL PROCEDURE setvct; (* in Assembly Module — 3DINT3 *) EXTERNAL PROCEDURE in8259; (* " " " — 3DINT3 *) EXTERNAL PROCEDURE zero_en(a:integer); (* in Assembly Module — 3DINT3 *) EXTERNAL PROCEDURE pwron; EXTERNAL PROCEDURE siordy; EXTERNAL PROCEDURE keyrdy; EXTERNAL PROCEDURE outbyt(a:char; port:integer); EXTERNAL PROCEDURE pause; (******************************************) { PROCEDURE outbyt(a:char; port:integer); BEGIN write(a); END; PROCEDURE pause; VAR fl:boolean; BEGIN writelnC— pause — ' ) ; get_answer(fl); END; } (***************************************) 115 PROCEDURE hdwinit; BEGIN pwron; setvct; in8259; keyrdy; siordy; END; PROCEDURE speek(VAR s:vlong_sentence; prt: integer; VAR op_mode:integer); VAR i,speech_prt,downld_prt : integer; BEGIN speech_prt:= speak; downld_prt:= downl; i:=l; WHILE s[i] <> ';' DO BEGIN outbyt(s[i],prt); i := i+1; END; IF prt = downld_prt THEN outbyt(chr(lf),prt); outbyt(chr(cr),prt); op_jnode:= ord(s[i+l] )-48; (* outbyt(s[i+1],downld_prt); WRITELNCOPJVDDE = ' ,op_mode:5) ; *) END; (* speek — SENDS A SENTENCE TO THE SPEECH PORT AND DETERMINES THE OPERATION MODE OF THE DIGITIZER BY FINDING A NUMBER AT THE END OF THE SENTENCE *) (* *) (* op_mode = 0 (no input required) *) (* =1 (POINT mode) *) (* =2 (STREAM mode) *) (* =3 (KEYPAD INPUT mode) *) PROCEDURE greeting; VAR dummy : integer; fig : boolean; s: vlong_sentence; BEGIN speek(grt_j?hrasefspeak,dummy); s:= proceed; { pause; } get_answer(s,flg); END; 116 PROCEDURE reference_encoders; VAR dummy: integer; i : integer; sl : wshort; st : vlong_sentence; BEGIN { setvct; } {sets vectored interrupts} { in8259; } {initialize 8259 PIC} speek(indx_intro,speak,dummy); speek(indx_start,speak,dummy); speek(indx_start,downl,dummy); i := 1; WHILE i <= chanls DO BEGIN IP i <> 1 THEN BEGIN convrt(i,sl); st:= CONCAT(move_encdr,sl,1 1,thru_range,sp_mode); speek(st,speak,dummy); speek(st,downl,dummy); END; zero_en(i); i:= i+1; END; {while i} speek(indx_done,speak,dummy); { pause; } END; PROCEDURE say_ready; VAR dummy : integer; BEGIN speek (ready_togo,speak,dummy); END; 117 PROCEDURE get_answer (VAR s: vlong_sentence; VAR fig: boolean); VAR dummy:integer; BEGIN (****) { speek(s,downl,dummy); flg:=TRUE; pause; } (****) char_in := FALSE; nxt_cmd := TRUE; keyrdy; WHILE no_errs AND (NOT char_in) DO dig_process(s); IF newchar = '1' THEN flg:= TRUE ELSE fig := FALSE; END; PROCEDURE ask_meastype (VAR meastype:short_sentence; VAR fig:boolean); VAR st : string; sntnce : short_sentence; dummy : integer; BEGIN { IF meastype = 'bone' THEN sntnce := bone_phrase; IF meastype = 'tissue' THEN sntnce := tissue; IF meastype = 'scar' THEN sntnce := scar; } (* Feb. 8f 1986 *) st:= CCiSJCAT(recd_ask,meastype,spjraDde); (***) speek(st,speak,dummy); st:= yes_or_no; (***) get_answer(st,fig); END; 118 PROCEDURE get_data; VAR st:vlong_sentence; a : boolean; BEGIN last_cmd:= 0; finished:= FALSE; WHILE (NOT finished) OR (NOT nxt_cmd) DO BEGIN st:= bo_phrase [last_cmd+l]; dig_process(st); END; {while} END; PROCEDURE do_measurements; VAR s:short_sentence; BEGIN s:= bo_phrase[0]; ask_itieastype (s, bone fig); IF boneflg THEN BEGIN get_data; END; END; PROCEDURE say_summary (boneflg ftissflg,scarflg : boolean); BEGIN END; PROCEDURE ask_next_patient(VAR next_patient : boolean); BEGIN next_patient := FALSE; END; 119 PROCEDURE delay_awhile; VAR i,j,k:integer; BEGIN i:=0; j :=0; WHILE i< 10000 DO BEGIN WHILE j< 10000 DO BEGIN k:= j * i ; j:=j+l; END; i:=i+l; END; END; (* DELAY_AWHILE - 2 second delay for speech synthesizer to get ready *) (* — CGS — DEC 18, 1985 *) PROCEDURE @INI; BEGIN END; (*$Z $80FF*) (* MAIN STARTS HERE *) BEGIN hdwinit; delay_awhile; str:=' make_key_words; setup_sentences; setup_dialogue; next_ptnt := TRUE; WHILE next_ptnt DO BEGIN system_init; greeting; reference_encoders; say_ready; do_measurements; say_summary(boneflg,tissflg,scarflg); { ask_next_j>atient(next_j?tnt); } END; {while} str := 'FINISHED FOR TODAY;0'; speek(str,speak,dumy); pause; END. 120 (* FILE: TESTDIG3.SRC DEC. 8, 1985 *) MODULE three_d_digitizer_intermediate_J.eveL_code; (* This module contains the PASCAL procedures which are called by *) (* the main program for the 3-D digitizer. *) (* THIS INCLUDES THE INTSUP ROUTINE FOR STAND-ALONE OPERATION *) (* NOTE: PARENT PROGRAM IS NOVDIG.SRC *) (* FEB. 7, 1986 — STREAM MODE ADDED *) (* Author: Carl G. Saunders *) (* LATEST UPDATE: FEB. 7, 1986 *) {$L-} {$1 DAVCONST.INC} lastphrase = •*****'; (* delimiter indicating end of a vocabulary *) {$1 NEWTYPE.INC} {$L+} VAR Off0,offl,off2,off3,off4,off5,chanls : EXTERNAL integer; last_cmdfmodeflfstates,stateP,stateK : EXTERNAL integer; onfnxt_cmd : EXTERNAL boolean; finished : EXTERNAL boolean; ha,ta,na,ka,hb,nb,kb : EXTERNAL integer; tmp : EXTERNAL th_data; bufa : EXTERNAL ringA; bufB : ABSOLUTE [$9810] ARRAY[minB..maxB, 0..num_coords] of integer; value_ready,no_errs,erra,errb,abflg,flagup,flagdn : EXTERNAL boolean; kpress,char_in,butndn,butnup: EXTERNAL boolean; speak,downl : EXTERNAL integer; kcharfnewchar: EXTERNAL char; dumy: EXTERNAL integer; boneflg,tissflg,scarfig : EXTERNAL boolean; maxbone,maxtiss,maxscar : EXTERNAL integer; errbone,errtiss,errscar : EXTERNAL integer; sp_mode,pt_mode,st_mode,kpjnode : EXTERNAL modetype; 121 EXTERNAL PROCEDURE pwron; (* " " " — 3DINT3*) EXTERNAL PROCEDURE keyrdy; (* Assembly Mod — 3DINT3 *) EXTERNAL PROCEDURE siordy; (* Assembly Mod — 3DINT3 *) EXTERNAL PROCEDURE outbyt(a:char; port:integer); (* 3DINT3*) EXTERNAL PROCEDURE pause; (* 3DINT3*) EXTERNAL PROCEDURE intsup; (* in assembly program — 3DINT3.MAC - DEC 17/85 *) EXTERNAL PROCEDURE calc_end_point(VAR angles:th_data; VAR x,y,z:integer); (* in MODULE END *) EXTERNAL PROCEDURE store_injD(xfy,z:integer); (* " " " *) EXTERNAL PROCEDURE speek(VAR st:vlong_sentence; prt:integer; VAR opm: integer); (* in 3DMASTER *) PROCEDURE convrt(k:integer; VAR st: wshort); VAR int : intgr_comps; i,top,j,ii : integer; i l e f t : integer; negativ : boolean; BEGIN st:=' •; top:= 4; IF k < 0 THEN negativ := TRUE ELSE negativ := FALSE; i:= ABS(k); int[4]:= i DIV 10000; ileft:= i MOD 10000; int[3]:= i l e f t DIV 1000; ileft:= ile f t MOD 1000; int[2]:= i l e f t DIV 100; ileft:= i l e f t MOD 100; int[l]:= i l e f t DIV 10; ileft:= i l e f t MOD 10; int[0]:= i l e f t ; IF int[4] <> 0 THEN top := 4 ELSE IF int[3] <> 0 THEN top := 3 ELSE IF int [2] <> 0 THEN top := 2 ELSE IF int[l] <> 0 THEN top := 1 ELSE top:= 0; j:=l; IF negativ THEN BEGIN st[j]:=•-'; j:= j+1; END; ii:= top; WHILE i i >= 0 DO BEGIN st[j]:= chr(int[ii]+48); j:= j+i; ii:= ii-1 END; (* while *) st[j]:=' '; END; (* CONVRT — convrts an integer to a sentence *) 122 PROCEDURE rawstr; VAR i : integer; net_up,rem : integer; st: sentence; dummy: integer; up_dir: boolean; BEGIN IF ka> (maxA-na) THEN erra:= TRUE (* ring buffer is f u l l *) ELSE BEGIN FOR i:=min_chnl TO channels DO BEGIN net_up:= cnt[i,2]-cnt[i,l]; (* because 8253 counters count down we*) (* must subtract upcount from downcount *) (* to get NET counts in UP direction *) IF net_up >= 0 THEN up_dir:= TRUE ELSE up_dir := FALSE; net_up:= ABS(net_up); (* get the absolute value in order to *) rem:= net_up MOD onerev; (* calculate a correct modulo value *) IF up_dir THEN bufa[ha]:= rem ELSE bufa[ha]:= onerev-rem; IF (i=5) THEN (* encoder 5 measures UP in *) bufa[ha]:=onerev-bufa[ha]; (* opposite direction from right *) (* hand rule *) (* encoder 3 flipped over on Oct. 22/85 -CGS *) { convrt (bufa [ha], st); st:=CONCAT(st,sp_mode); speek(st,speak,dummy); pause; } ha:= ha+1; IF ha>maxA THEN ha:=minA END; (* For i *) na:=na+ka; erra:= FALSE END (* Else ring buffer is ready to accept more values*) END; (* RAWSTR — THIS PROCEDURE STORES THE RAW COUNT DATA FROM THE ENCODERS *) (* IT IS CALLED BY THE INTERRUPT SERVICE ROUTINE FOR RST7.5 IN THE *) (* ASSEMBLY PROGRAM — 3DINTF.MAC *) 123 PROCEDURE system_init; VAR i:integer; BEGIN pwron; (* power on initialization of interrupt vectors *) chanls:= channels; offO:= offstO; offl:= offstl; off2:= offst2; off3:= offst3; off4:= offst4; off5:= offst5; on := TRUE; speak:= sportA; downl:= sportB; no_errs:= TRUE; char_in:= FALSE; kpress := FALSE; erra := FALSE; errb := FALSE; flagup:= FALSE; flagdn:= FALSE; butnup:= FALSE; butndn:= FALSE; abflg := FALSE; value_ready:= FALSE; last_cmd := 0; modefl := 0; nxt_cmd := TRUE; finished := FALSE; states:= 0; stateP:= 0; stateK:= 0; ka:= channels-min_chnl+l; init_buffa; kb:= num_coords; hb:= minb; nb:= 0; FOR i:= minB TO maxB DO BEGIN bufB[i,0] := 0; bufB[i,l] := 0; bufB[i,2] := 0; bufB[i,3] := 0; END; boneflg := FALSE; tissflg := FALSE; scarflg := FALSE; errbone := 0; errtiss := 0; errscar := 0; maxbone := max_bcmd; maxtiss := max_tcmd; maxscar := max_scmd; END; (* SYSTEM_INIT — INITIALIZES GLOBAL VARIABLES AS WELL AS THE KEYPAD AND SERIAL PORTS *) 124 PROCEDURE init_buffa; BEGIN ha:= mina; ta:= mina; na:= 0 END; (* INITLBUFFA — INITIALIZES ALL PARAMETERS RELATED TO THE RING BUFFER *) (* WHICH STORES THE RAW COUNTER VALUES *) PROCEDURE status_update (VAR phrase:vlong_sentence; VAR f lagm, s l , s2, s3 : integer); BEGIN IF nxt_cmd THEN BEGIN IF (phrase = lastphrase) THEN finished:= TRUE ELSE BEGIN nxt_cmd:= FALSE; speek(phrase,speak,flagm); speek(phrase,downl,flagm); last_cmd:= last_cmd+l; CASE flagm OF 0: nxt_cmd:= TRUE; (* TALKING ONLY mode *) 1: sl:= 1; (* POINT mode - initialization *) 2: s2:= 1; (* STREAM mode - initialization *) 3: s3:= 1; (* KEYPAD INPUT mode - initialization *) END; (* Case *) END; (* ELSE not finished *) END; (* If nxt_cmd *) END; (* STATUS_UPDATE — DETERMINES WHAT NEXT COMMAND IS, SENDS IT, AND *) (* UPDATES THE STATES OF THE PROCESSES INVOLVED *) 125 PROCEDURE prcess_S (VAR stS: integer); VAR s,x,y,z:integer; si : sentence; dumy : integer; BEGIN CASE StS OF 0: BEGIN (* DO NOTHING STATE *) END; 1: BEGIN (* INITIALIZATION STATE *) { sl^'STREAM 7.5 INIT — ;0'; speek(si,downl,dumy); } INLINE("MVTA/ $1B/ "SIM/ "EI); (* enable 7.5 interrupt only — NOV 12 *) intsup; (* with an appropriate value loaded in *) s:= 2 END; 2: BEGIN (* PROCESS A VALUE STATE *) IF flagup THEN s:= 4 (* disable PIT here ? *) ELSE BEGIN IF (value_ready) THEN BEGIN calc_end_point(tmp,x,y,z); store_in_b(x,y,z); value_ready:= FALSE END; s:=2 END (* Else *) END; 3: BEGIN (* ABORT STATE *) abflg:= TRUE; s:= 0 END; 4: BEGIN (* NORMAL EXIT STATE *) si:='STREAM EXIT;01; speek(si,downl,dumy); IF (value_ready) THEN BEGIN calc_end_point (tmp, x,y, z); store_in_b(x,yfz); value_ready:= FALSE; s:= 4 END 126 ELSE BEGIN s:= 0; nxt_cmd:= TRUE END END; END; (* Case *) stS:= s; (** could do something to a timer here?? **) END; (* PROCESS_S — MAIN ROUTINE FOR HANDLING DATA THAT COMES IN DURING *) (* STREAM MODE *) 127 PROCEDURE prcess_P (VAR stP: integer); VAR s,x,y,z:integer; st:sentence; dummy:integer; BEGIN CASE StP OF 0: BEGIN END; 1: BEGIN (* DO NOTHING STATE *) (* INITIALIZATION STATE *) st:='POINT INIT - STATE 1;0'; speek(st,downl,dummy); INLINE("MVIA/ $1B/ "SIM/ "EI); (* enable the CPU's 7.5 interrupt *) intsup; {new addition — CGS — Dec 17/85} {reprograms the mode for the PIT counter which invokes the 7.5 interrupt} s:=2 END; 2: BEGIN (* PROCESS A VALUE STATE *) IF (value_ready) THEN BEGIN st:='END IS CALCULATED;0'; calc_end_j?oint(tmp,x,y, z); speek(st,downl,dummy); store_in_b(x,y,z); st:='AND STORED IN B;0'; speek(st,downl,dummy); value_ready:= FALSE; s:= 4 END ELSE s:= 2 END; 3: BEGIN (* ABORT STATE *) abflg:= TRUE; s:= 0 END; 4: BEGIN (* NORMAL EXIT STATE *) IF flagup THEN BEGIN 128 s:= 0; nxt_cmd:= TRUE END ELSE s:= 4 {switch has not been released yet} END; END; (* Case *) stP:= s; (** could do something to a timer here?? **) END; (* PROCESS_P — MAIN ROUTINE FOR HANDLING DATA THAT COMES IN DURING *) (* POINT MODE *) 129 PROCEDURE prcessJK (VAR stK: integer); VAR s:integer; BEGIN CASE StK OF 0: BEGIN (* DO NOTHING STATE *) END; 1: BEGIN (* INITIALIZATION STATE *) keyrdy; s:= 2 END; 2: BEGIN (* PROCESS A VALUE STATE *) IF char_in THEN s:=4 (* only process a char for now *) ELSE s:=2 END; 3: BEGIN (* ABORT STATE *) END; 4: BEGIN (* NORMAL EXIT STATE *) s:= 0; nxt_cmd:= TRUE END; END; (* Case *) stK:= s; (** could do something to a timer here?? **) END; (* PROCESSJC — MAIN ROUTINE FOR HANDLING DATA THAT COMES IN DURING *) (* KEYPAD INPUT MODE *) PROCEDURE keypad; BEGIN INLINE("Dl); char_in := FALSE; IF kpress THEN BEGIN newchar:= kchar; char_in:= TRUE; END; kpress:= FALSE; INLINE("EI); {reenable interrupts} END; (* KEYPAD — CHECKS IF KEY HAS BEEN PRESSED AND IF SO MAKES A COPY OF THE CHARACTER THERE *) 130 PROCEDURE chk_goback; VAR st: sentence; dummy : integer; BEGIN IF char_in THEN BEGIN IF newchar = 'C THEN BEGIN st:= 'LAST MEASUREMENT CANCELLED;01; speek(st,speak,dummy); nxt_cmd:= TRUE; last_cmd:= last_cmd-2; nb:= nb-1; hb:= hb-1; IF last_cmd < 0 THEN BEGIN last_cmd:=0; nb:= 0; nb:= 0; END; (* If last_cmd *) END; IF newchar = 'F1 THEN butnup:= TRUE; {SIMULATION ONLY} END; END; PROCEDURE download; BEGIN END; (* *) 131 PROCEDURE dig_status; VAR i:integer; s f s l : wshort; st: sentence; j,k,dmy:integer; BEGIN INLINE("DI); (* disable interrupts *) flagup:= butnup; (* signals 6.5 interrupt - button has been released *) butnup:= FALSE; flagdn:= butndn; (* signals 7.5 interrupt - button has been pressed *) butndn:= FALSE; value_ready := FALSE; IF na > 0 THEN BEGIN j:= na; k:= ta; convrt(j,s); convrt(k,sl); st:= CONCAT(1 NA = ',s,1 TA = 1,sl,sp_mode); speek(stfdownl,dmy); FOR i:= min_chnl TO channels DO BEGIN (* j:= bufa[ta]; convrt(j,s); st:= CONCAT(s,spjnode); speek(stfdownl,dmy); *) tmp[i]:= bufa[ta]; ta:= ta+1; IF ta > maxA THEN ta:= minA END; (* for *) na:= na-ka; value_ready:= TRUE; { pause; } END; (* IF *) INLINE("EI); (* re_enable interrupts *) END; (* *) PROCEDURE timers; BEGIN END; (* *) 132 PROCEDURE check_for_errors; VAR si:sentence; dmy: integer; BEGIN IF erra THEN BEGIN sl:='RING BUFFER IS FULL!!!!;0'; speek(si,speak,dmy); END; IF errb THEN BEGIN sl:='DATA STORAGE AREA IS FULL!I!;0'; speek(si,speak,dmy); END; no_errs:= TRUE; END; (* CHECK_FOR_ERRORS — looks for errors and makes a statement conderning them *) PROCEDURE dig_process(VAR cmd:vlong_sentence); BEGIN status_update (cmd, modef1,stateP,states,stateK); prcess_S (states); prcess_P (stateP); prcess_JC (stateK); keypad; chk_goback; download; dig_status; tijners; check_f or_errors; keyrdy; END; (* DIG_PROCESS — SEQUENCE OF PROCESSES THAT THE DIGITIZER GOES THROUGH WHILE IN OPERATION *) MODEND. (* THIS PROGRAM IS STORED UNDER THE NAME — TESTDIG3.SRC *) 133 (* FILE: END.SRC DATE: SEPT 1, 1985 *) MODULE end_^int_calculation_F0R_3D_DIGITIZER; (* This module calculates the position of the end-point *) (* of a 3d-digitizer proposed for use in measuring bony *) (* landmarks for input into Computer-aided Socket Design *) (* written by C.G. Saunders — Jan. 10, 1984 *) (* updated — July 13, 1984 — px,py,pz now GLOBAL *) (* — Sept 16, 1985 — correct link lengths now installed *) (* — Oct 25, 1985 — calibration correction for 1.5 mm droop over 500 mm. when theta2 is below horizontal *) (* — Feb 8, 1986 — put command number in front of each x,y,z — put data at an absolute address *) CONST channels = 5; min_chnl = 1; minB = 1; maxB = 100; num_coords = 3; onerev = 4096; rad_convf 11 = 0; 12 = 2543 13 = 3064 15 = 1270 scale_f = 1; = 0.00153398; (* = 2*pi/onerev *) (* length in mm of link #1 *) (* " " mm " " #2 *) (* " " ran " " #3 *) (* " " mm " " #5 *) (* scale factor for convrting from real to integer *) TYPE th_data = ARRAY[min_chnl..channels] OF integer; wshort = string [14]; sentence = string[50]; vlong_sentence = string[70]; superstring = string[100]; modetype = string[3]; VAR bufb : ABSOLUTE [$E810] ARRAY [minB. .maxB,0..nuitL_coords] OF integer; hb,nb,speak,downl : EXTERNAL integer; errb : EXTERNAL boolean; last_cmd : EXTERNAL integer; (** update — Feb. 8, 1986 **) (****) sp_mode : EXTERNAL modetype; (****) EXTERNAL PROCEDURE convrt(k:integer; VAR st:wshort); EXTERNAL PROCEDURE speek(VAR st:vlong_sentence; prt:integer; VAR opm:integer); EXTERNAL PROCEDURE pause; 134 PROCEDURE calc_end_point (VAR angle:th_data; VAR px,py,pz : integer); VAR thl,th2,th3,th4,th5 : real; xx,yy,zz,th23 : real; intl,int2,int3,int4 fint44,int5,int6,int7 fint8 : real; S23,c23,sl,cl,s2,c2,s4,c4,s5,c5 : real; halfrev : integer; BEGIN thl := angle[l]*rad_convf; th2 := angle[2]*rad_convf; th3 := angle[3]*rad_convf; th4 := angle[4]*rad_convf; th5 := angle[5]*rad_convf; th23 := th2+th3; s23 := SIN(th23); c23 := COS(th23); si := SIN(thl); c l := COS(thl); s2 := SIN(th2); c2 := COS(th2); s4 := SIN(th4); c4 := COS(th4); s5 := SIN(th5); c5 := COS(th5); intl := 15*c5; int2 := intl*c23; int3 := 15*s5; int4 := int3*c4; int44:= int4*s23; int5 := 13*c23; int6 := 12*c2; int7 := int3*s4; int8 := int2-int44+int5+int6; xx := int8*cl+int7*sl; yy := int8*sl-int7*cl; zz := (intl+13)*s23+int4*c23+12*s2+ll; px:= ROUND(xx*scale_f); py:= ROUND(yy*scale_f); pz:= ROUND(zz*scale_f); END; (* CALC_END_POINT — TAKES IN THE ANGLE DATA FROM THE JOINTS AND CALCULATES THE XYZ COORDINATES OF THE END POINT *) 135 PROCEDURE store_in_b(x,yfz : integer); VAR st: superstring; s0,sl,s2,s3: wshort; dummy: integer; BEGIN IF (maxB-nb) <= 0 THEN errb:= TRUE (* B buffer is f u l l *) ELSE BEGIN errb:= FALSE; bufb[hb,0]:= last_cmd; bufb[hb,l]:= x; bufb[hb,2]:= y; bufb[hb,3]:= z; convrt(last_cmd,sO); convrt(x,si); convrt(y,s2); convrt(z,s3); st:=OONCAT('cmd = ,,sO,'X= ',si, 1Y = ',s2,'Z = •,s3,sp_mode); speek(st,downl,dummy); { pause; } hb:=hb+l; nb:=nb+l; END; (* Else *) END; (* STORE_IN_B — TAKES AN XYZ TRIPLET AND THE COMMAND NUMBER AND STORES THEM INTO THE FINAL MEASUREMENT BUFFER *) MODEND. 136 (* F I L E : DAVESP.SRC SEPT. 30, 1985 *) MODULE speech_io_for_digitizer; (* FEB. 7, 1986 — CHANGES MADE TO BONE DIALOGUE TO TEST STREAM MODE *) (* FEB. 8, 1986 — treat bojphras as an absolute variable *) {$1 DAVCONST.INC} {$1 NEWTYPE.INC} VAR grt_4?hrase,fin_j?hrase,recall,chk_phrase : EXTERNAL long_sentence; anyjnore,proceed,bone_done : EXTERNAL long_sentence; ready_togo,yes_or_no,sorry_only9,pid_done : EXTERNAL sentence; recd_ask,done_recd,bone_phrase,move_encdr: EXTERNAL short_sentence; identify : EXTERNAL short_sentence; patnt,that_was,ident_restart,anip_side,press_one : EXTERNAL vshort_sentence; or_zero,right,left,side_stump,entered,sex_of : EXTERNAL vshort_sentence; pleez_touch,male,female : EXTERNAL vshorresentence; number,more,aand,tissue,scar,good,now_touch : EXTERNAL vshort_sentence; thru_range,metr_units,engLunits : EXTERNAL vshort_sentence; indx_intro,indx_start,indx_check,indx_done,sin_enter: EXTERNAL sentence; upto9,tib_length : EXTERNAL sentence; sp_mode,pt_mode,st_mode,kp_mode : EXTERNAL modetype; tibial,adducter,tubercle,distal_end,tibia,fibula : wshort; head,femur,patella,epicondyle,edge,of_the,joint_space : wshort; medial,lateral,superior,inferior,ridge,intact_limb,now_onto: wshort; crest,point : wshort; 137 PROCEDURE setup_sentences; BEGIN grt_phrase: fin_phrase: recall chk_phrase: anyjnore proceed : bone done "WELCOME TO THE BELOW NEE MEASUREMENT PROGRAM;0'; 'THE BELOW NEE MEASUREMENT PROGRAM IS FINISHED;0"; 'TO RECALL IT YOU MUST SWITCH ME OFF AND ON AGAIN;0'; •PRESS 1 IF THERE IS AN ERROR ANY OTHER KEY TO CONTINUE^1; 'DO YOU WANT TO MEASURE ANY MORE PATIENTS RIGHT NOW;0'; •PRESS ANY NUMBER WHEN YOU ARE READY TO PROCEED;3'; 'THAT COMPLETES THE STANDARD BONY MEASUREMENTS;0'; ready_togo:= 'I AM NOW READY TO TAKE MEASUREMENTS;0'; yes_pr_no := 'PRESS 1 FOR YES ANY OTHER KEY FOR NO;3'; sorry_only9:='SORRY I ONLY HAVE ROOM FOR 9 DIGITS;0'; pid_done :='THAT COMPLETES THE PATIENT IDENTIFICATION,^'; recd_ask := 'DO YOU WANT TO RECORD SOME '; done_recd := 'HAVE BEEN RECORDED FOR '; pleez_touch:='PLEEZ TUCH THE '; bone_phrase:='BONY MEASUREMENTS '; move_encdr:= 'NOW MOVE ENCODER '; identify := 'PLEASE IDENTIFY THE '; patnt := 'PATIENT '; that_was := 'THAT WAS '; ident_restart := 'START AGAIN '; amp_side := 'AMPUTATED SIDE '; press_one:= 'PRESS 1 FOR '; or_zero := 'OR 0 FOR '; right := 'RIGHT •; left := 'LEFT '; side_stump := 'SIDE STUMP '; entered := 'ENTERED '; sex_of := 'SEX OF THE '; male := 'MALE '; female := 'FEMALE '; number more aand tissue scar good now_touch thru_range metr_units eng!L_units = 'MORE '; = 'AND '; = 'TISSUE DATA '; = 'SCAR DATA '; = 'GOOD '; = 'NOW TUCH THE 1 ; = "THRU ITS RANGE = ' CENTIMETRES ' ; = 'INCHES '; END; (* setup_sentences *) 138 PROCEDURE make_key_words; BEGIN sp_mode := i . n i . ptjnode := • .1 i . / J- / st_mode ;= • .01. 1 1 kp_mode •= t i b i a l := 'TIBIAL '; adducter := 'ADDUCTER '; tubercle := 'TUBERCLE 1; distal_end ; = •DISTAL END 1; tib_length ; = •THE LENGTH OF THE TIBIA IS CALCULATED TO BE tibia := 'TIBIA '; fibula 'FIBULA '; head = •HEAD '; femur = •FEMUR '; patella = 'PATELLA '; epicondyle ; = 'EPICONDYLE '; edge := 'EDGE '; of_the := 'OF THE 1; joint_space := •JOINT SPACE '; medial = •MEDIAL lateral = 'LATERAL '; superior •SUPERIOR '; inferior : = 'INFERIOR '; ridge = 'RIDGE '; intact_limb • = 'INTACT LIMB 1 ; now_onto 'NOW TO THE ' ; crest ; = 'CREST '; point ; = 'POINT NUMBER '; END; {make_key_words} PROCEDURE setup_dialogue; BEGIN indx_intro := 'THE ANGLE ENCODERS MUST NOW BE INDEXED;0'; indx_start := 'START BY MOVING ENCODER ONE THROUGH ITS RANGE;01; indx_check := 'LETS MEASURE THE LENGTH OF THE TIBIA AS A CHECK;0' ; indx_done := 'THAT COMPLETES THE INDEXING PROCEEDURE;0'; sin_enter := 'ENTER HIS SOCIAL INSURANCE NUMBER OR ANY OTHER;01; upto9 := 'UP TO NINE DIGITS MAY BE USED;31; END; (* setup_dialogue *) MODEND. 139 Sept. 11, 1985 (* File: DAVCONST.INC (* (* This is the l i s t of common CONSTANTS used in the digitizer program. (* (* - changed cnts_per_rev to onerev — CGS — Nov 10, 1985 *) *) *) *) CONST channels =5; (* number of encoders in the digitizer *) min_chnl =1; (* minimum channel number implemented *) offstO =0; (* mechanical offset for encoder #0 *) offstl = 970; (* " " " #1 *) offst2 = 3738; (* " " n II |2 *) (* changed from 3735 on Oct. 16, 1985 — CGS *) offst3 = 3755; (* " " " " #3 *) (* changed from 355 on Oct. 22, 1985 - CGS - due (* to accident *) offst4 = 872; (* offst5 = 346; (* #4 *) #5 *) cnts_per_chnl = 2; onerev = 4096; maxA = 600; minA =1; num_coords = 3; maxB = 1500; minB = 1; (* number of count values for each encoder *) (* resolution of the encoders used *) (* maxA-minA+1 must be a multiple of 30 *) (* number of coordinates per point *) (* 1500 points per patient can be stored *) cr = 13; l f = 10; sportA = 0; sportB = 1; (* ASCII code for carriage return *) (* ASCII code for line feed *) (* index for A channel serial port *) (* index for B channel serial port *) min_bcmd =0; max_bcmd =26; (* maximum number of bone measurement commands *) 140 (* File: NEWTYPE.INC *) (* *) (* This is the l i s t of common TYPES used in the digitizer program. *) (* Test for absolute variables for dialogues — FEB. 8, 1986 *) (* Puts command number in front of each point — Feb. 8, 1986 *) TYPE raw_data = ARRAY[min_chnl..channelsr1..cnts_per_chnl] OF integer; th_data = ARRAY[min_chnl..channels] OF integer; ringA = ARRAY[minA..maxA] OF integer; intgr_comps = ARRAY[0..4] OF integer; vshort_sentence= string[20]; short_sentence = string[30]; sentence = string[50]; long_sentence = string[60]; vlong_sentence = string[70]; modetype = STRING[3]; wshort = STRING [14]; 141 (* File: NEWARS.INC *) (* *) (* This is the l i s t of common VARIABLES used in the digitizer program. *) (* Test for absolute variable use in bone_dialogue — FEB. 8, 1986 *) VAR off0,off1,off2,off3,off4,off5,chanls : integer; last_cmdfmodeflfstates,stateP,stateK : integer; on,nxt_cmd : boolean; ha,ta,na,ka,hb,nb,kb : integer; finished: boolean; (* update — Feb. 8, 1986 *) cnt : raw_data; tmp : th_data; buf a : ringA; bufb : ABSOLUTE [$9810] ARRAY [minB..maxB,0..num_coords] of integer; value_ready,no_errs,erra,errb,abflg,flagup,flagdn : boolean; kpress,char_in,butndn,butnup: boolean; speak,downl : integer; kchar,newchar: char; next_ptnt,boneflg,tissflg,scarfig : boolean; maxbone,maxtiss,maxscar : integer; errbone,errtiss,errscar : integer; str: sentence; dumy: integer; bo_phrase : ABSOLUTE [$F000] ARRAY[inin_bcmd. .max_bcmd] of vlong_sentence; grt_phrase,fin_phrase,recall,chk_phrase : long_sentence; any_more,proceed,bone_done : long_sentence; ready_togo,yes_or_no,sorry_only9,pid_done : sentence; recd_ask,done_recd,pleez_touch,bone_phrase : short_sentence; move_encdr,identify : short_sentence; patnt,t±iat37as,ident_restart,amp_side,press_one : vshort_sentence; or_zero,right,left,side_stump,entered,sex_of : vshort_sentence; male,female : vshort_sentence; number,more,aand,tissue,scar,good,now_touch : vshort_sentence; thru_range,metr_units,engl_units : vshort_sentence; indx_intro,indx_start,indx_check,indx_done,sin_enter: sentence; upto9,tib_length : sentence; sp_mode,pt_mode,st_jnode,kp_mode : modetype; 142 *********************************************** * * * * * HARDWARE INTERFACE ROUTINES FOR THE * * 3-D DIGITIZER * * (STAND-ALONE OPERATION) * * * * * * * * filename: 3DINT3.MAC * * version: 1.46 (FEB 8, 1986) * * parent: 3DDEBUG.MAC * * * .*********************************************** ; This section of code contains routines which are ; called by the 3-D digitizer operating program ; in STAND-ALONE operation!!! ; In particular, routines exist which: ; 1. set up the x.5 series of interrupt vectors ; 2. service the RST7.5 and RST6.5 interrupts; these ; are responsible for bringing in encoder positions during ; both the POINT and STREAM modes of operation ; 3. set up the interrupt vectors for referencing each encoder ; during the REFERENCE ZERO phase of operation ; 4. initialize the 8259 programmable interrupt controller, ; 5. handle interrupts from each of the encoders when the index ; pulse is received. This involves jamming counters on the ; 8253 counter chips with appropriate starting values. ; Sept. 11 — modified the SRV7.5 routine so that the array is ; is passed by address rather than by values ; Aug. 7 — include new routines which perform the functions ; listed below: ; 6. set up and accept data from the KEYPAD ; 7. intialize the two serial ports (one for speech, the other ; for downloading to a host computer) ; 8. send data out either of the serial ports ; 9. allows a PAUSE capability which calls the RST 1 service ; routine from the SDK-85 monitor ; also, got rid of INT6.5 as the RST6.5 will NOT be used for STREAM ; instead the RST7.5 is reenabled inside the 7.5 service routine ; in the SERVO — SERV5 included a PUSH H at the start and a POP H ; at the end of the routine ; Nov. 10, 1985 — took out a l l references to RST6.5 as i t will not ; be used 143 Dec. 17, 1985 — first attempt to implement RST7.5 on the CPU board using the PIT timer that is there NOTE: THIS CODE WILL BE SUITABLE FOR STAND-ALONE OPERATION!!! Feb. 8, 1986 — reinstated RST6.5 code to be used for detecting that the measurement switch is released NOTE: that the RST6.5 interrupt is enabled inside the RST7.5 interrupt so that the 6.5 does not interrupt a l l the time MEMCTL EQU 7BH j port for (MEMEX, IOEXP) control on CPU board CPIT EQU 7FH j Port for PIT mode register on CPU board PITO EQU CPIT-3 j portO for data on the PIT PIT1 EQU CPIT-2 j portl " " " " " PIT2 EQU CPIT-1 ; port2 " " " " " C1M22 EQU 74H •code for counter #1, mode 2, 2 byte load C2M02 EQU OBOH , code for counter #2, mode 0, 2 byte load DATAO EQU 30H ;control word for setting mode 0 and cntr #0 DATA1 EQU 70H ;control word for setting mode 0 and cntr #1 DATA2 EQU OBOH ;control word for setting mode 0 and cntr #2 PICO EQU 84H port for 8259 initialization word #1 PIC1 EQU 85H port for 8259 operational control words #1 •and initialization words 2 and 4 VCTSTLO EQU 00H \ •lo byte of address for 8259 vect interrupts VCTSTHI EQU 0C9H •hi byte of address for 8259 vect interrupts ICW1 EQU 17H •init word #1 for 8259 excluding address info sets edge-triggered, interval of 4, single 8259 chip; and init word 4 needed IVL EQU 4 ; address interval between vectors is 4 ICW4 EQU 02H •when sent to 8259, enables automatic EOI JUMP EQU 0C3H •jump instruction DISINT EQU 0F3H ?disable interrupt instruction VCT7.5 EQU 0C980H •address in STD impl. for 7.5 — Dec 17/85 VCT6.5 EQU 0C988H ; " " " " "6.5 Feb 8/86 TRU EQU 01H rcode for BOOLEAN TRUE REFO EQU (VCTSTHI SHL 8)+VCTSTLO •address for handler for 10 from 8259 REF1 EQU REFO+IVL •address .. n II II REF2 EQU REF0+2*IVL ) address .. I 2 •i II REF3 EQU REF0+3*TVL , •address .. I 3 II II REF4 EQU REF0+4*IVL , address .. .. .. I 4 M II REF5 EQU REF0+5*IVL ; address " 15 II II REF6 EQU REF0+6*IVL , •address II II REF7 EQU REF0+7*IVL address .. I 7 II II CHP1 EQU 0D3H •port for 8253 counter chip#l mode select CRP2 EQU 0C3H port " " chip#2 " II CHP3 EQU 0B3H •port " " chip#3 " •i CHP4 EQU 0A3H , •port " " chip#4 " II LATCHO EQU 00H •code for latching counter #0 on the fly LATCKL EQU 40H > •< II II #1 " II II LATCH2 EQU 80H > <> II II #2 " II II 144 UPCNTO EQU CHP1-3 DNCNTO EQU CHP1-2 UPCNT1 EQU CHP1-1 DNCNT1 EQU CHP2-3 UPCNT2 EQU CHP2-2 DNCNT2 EQU CHP2-1 UPCNT3 EQU CHP3-3 DNCNT3 EQU CHP3-2 UPCNT4 EQU CHP3-1 DNCNT4 EQU CHP4-3 UPCNT5 EQU CHP4-2 DNCNT5 EQU CHP4-1 KEYPAD EQU 88H IKPAD EQU 6 SIO EQU OFOH SINT EQU SIO+6 SBAUD EQU SICH-5 SLINE EQU SICH-4 BCMD EQU SIO+3 BDATA EQU SIO+2 ACMD EQU SIO+1 ADATA EQU SIO DISPLAY EQU 036EH port for up counter on encoder #0 port " down counter " " #0 port for up counter on encoder #1 port for down counter on encoder #1 port for up counter on encoder #2 port for down counter on encoder #2 port for up counter on encoder #3 port for down counter on encoder #3 port for up counter on encoder #4 port for down counter on encoder #4 port for up counter on encoder #5 port for down counter on encoder #5 ;input port for keypad ;keypad is on the 16 interrupt line of 8259 ;base address for the dual channel serial I/O ;interrupt register for both channels A and B ;baud rate register for serial channels A and B ;line control register " " " " " " ;command " " for channel B only ;data register for channel B only ;command " " for channel A only ;data register for channel A only ;entry point for display routine with ;character in the A register 145 PUBLIC PWRON PUBLIC SEWCTRS PUBLIC IN8259 PUBLIC PUBLIC PUBLIC PUBLIC PUBLIC PUBLIC KEYRDY SIORDY PAUSE INTSUP ZEROEN OUTBYT ;new for stand-alone operation — Dec 17/85 ;this is declared external in Pascal program ;3_d as EXTERNAL PROCEDURE zero_en(a:integer) ;this is declare external in PASCAL program ;as PROCEDURE outbyt(a:char;prt:integer); EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN EXTRN CNT CHANLS OFFO OFF1 0FF2 OFF3 OFF4 0FF5 BUTNUP BUTNDN MDDEFL SPEAK DOWNL KCHAR KPRESS EXTRN RAWSTR array of encoder up and down count values number of encoder channels mechanical offset for encoder #0 #1 #2 " #3 #4 #5 logical flag which tells i f button is released •I II II II II II II pressed integer flag which gives mode of operation 0= nothing, 1= point, 2= stream, 3= keypad ;integer giving index to SPEECH port ;integer giving index to DOWNLOAD port ;character that has just come in from keypad ;boolean to indicate a key has been pressed ;this is a PASCAL routine which stores ;the raw encoder values in a ring buffer ;called BUFFA ;It has 2*chanls parameters passed to i t ;on the stack (????) EXTRN EXTRN NA KA 146 1. Foort, J., Cooper, D., Saunders, CG., "Mobility", Proceedings ot the 3rd Annual Conference on Rehabilitation Engineering, Toronto, Canada, June 16-20, 1980, pp. 109-112. 2. Saunders, CG., "Replication from 360 Degree Moire Sensing", Moire Fringe Topography and Spinal Deformity, Proceedings of the 1st International Symposium on Moire Contourography and Spinal Deformity, Pergammon Press, 1981, pp. 76-80. 3. Saunders, CG., "Shoe Last Replication by Moire Contourography", Proceedings of the 4th Annual Conference on Rehabilitation Engineering, Washington D.C, U.S.A., August 30 - Sept. 3, 1981. 4. Saunders, CG., "DC Motor Control for Rehabilitation Use", Proceedings of the 4th Annual Conference on Rehabilitation Engineering, Washington D.C, U.S.A., August 30 - Sept. 3, 1981. 5. Saunders, CG., Foort J., "The Impact of Moire Contourography on Shape Management in Rehabilitation and Orthopaedics", Future Health Perspectives Sante, May 1982. 6. Saunders, C.G., "Reconstruction ot Anatomical Shapes from Moire Contouro-graphs", Proceedings of the SPIE, Biostereometrics '82, San Diego, U.S.A., August 21-27, 1982, pp. 99-106. 7. Saunders, CG., Vickers, G.W., "A Generalized Approach to the Replication of Cylindrical Bodies with Compound Curvature", Transactions ot the ASME, Journal of Mechanisms, Transmis-sion, & Automation in Design, V. 106, No. 1, 1984, pp. 70-76. 8. SteinKe, T., Saunders, CG., "A Proportional Speed Controller for Use with Permanent Magnet DC Motors", Proceedings of the 2nd International Conference on Rehabilitation Engineering, Ottawa, Canada, June 17-22, 1984, pp. 224-225. 9. Saunders, CG., Fernie, G.R., "Automated Prosthetic Fitting", Special Sessions of the 2nd International Conference on Rehabilitation Engineering, Ottawa, Canada, June 17-22, 1984, pp. 239-242. 10. Dean, D. P., Saunders, CG., "A Software Package for the Design and Manufacture of Prosthetic Sockets for Trans-Tibial Amputees", IEEE Transactions on Biomedical Engineering, V. 32, No. 4, April 1985, pp. 257-262. 11. Saunders, CG., Foort, J., Bannon M., Dean, D., Panych, L., "Computer Aided Design of Prosthetic Sockets for Below-knee Amputees", Prosthetics and Orthotics International, V. 9, 1985, pp. 17-22. 12. Saunders, C.G., Panych, L.,Dean, D.P., "Sculpting of Three-Dimensional Free Form Prosthetic Sockets Using Computer Graphics Techniques", Submitted to Computer Graphics Forum, September 1985. 

Cite

Citation Scheme:

        

Citations by CSL (citeproc-js)

Usage Statistics

Share

Embed

Customize your widget with the following options, then copy and paste the code below into the HTML of your page to embed this item in your website.
                        
                            <div id="ubcOpenCollectionsWidgetDisplay">
                            <script id="ubcOpenCollectionsWidget"
                            src="{[{embed.src}]}"
                            data-item="{[{embed.item}]}"
                            data-collection="{[{embed.collection}]}"
                            data-metadata="{[{embed.showMetadata}]}"
                            data-width="{[{embed.width}]}"
                            async >
                            </script>
                            </div>
                        
                    
IIIF logo Our image viewer uses the IIIF 2.0 standard. To load this item in other compatible viewers, use this url:
http://iiif.library.ubc.ca/presentation/dsp.831.1-0096920/manifest

Comment

Related Items