North-Holland Microprocessing and Microprogramming 23 (1988) 339 - 344
339
CONTROL OF MOTORS BY MICROPROCESSORS FOR SPACE POSITIONING AND LOCALIZATION
SHI Jie, MONCHAUD Serge, PRAT Raymond INSA-LATEA 35043 RENNES CEDEX (FRANCE) Tdl~phone : 99.28.64.99 T~lex : 99.63.67.05 usager t~lex public 730800 REN F and KAS Ivan Computer and Automation Institute Hungaria~ Academy of Sciences 1502 BUDAPEST PF 63 XI Kende UTCA 13-17 Tdldphone 665-644 T~lex 22 5066 AKBPH
ABSTRACT The 3D space positioning and localization need a complex coordinates command. This command can be realized by using some microprocessors to control the movements of several motors. Our two laboratories (the Laboratory LATEA INSA France and the Laboratory Laser Plotter Group MTA Hyngary) collaborate about this topic. The field of application with this technique for each laboratory is very different but the exchange of our experiences between two laboratories is very efficent. In this article, we can give you some presentations about 3 different systems controlled by microprocessors. KEYWORDS Advanced microprocesor applications, Hardware and software development and description, office automation, image processing and robotics.
i. INTRODUCTION The Laboratory for applications of advances Electronics Techniques (LATEA) from the National Institute for Applied Sciences (INSA) of France, actually deals with multisensory systems allowing real time acquisition of spatial coordinates x, y, z of points. The fields of application which are aimed are both robotics, particularly the localization of
objects i n a commun s u r r o u n d i n g , and t h e audiovisual field by means of s y n t h e t i c pictures. The computer and automation Institute from the Hungarian Academy of Sciences, designs systems for real time drawing of alphanumerical and graphical forms. The fields of application aimed concern electronic industries (printed circuit boards), printed industries (OCR, facsimile, offset films...) and engineering drawings. The very fast and relatively recent penetration of optoelectronics in the field of data processing, partly explains why there is practically no existing general purpose books about this subject. Many devices are now put into development in the laboratories, others are already commercialized. Let us mention as examples : in the USA : 3D general scanning, in Switzerland : JENZER S.A., in France the 3D video laser digirizer from EURO SOFT and the one from DIGITAL DESIGN, and very soon a new compact 3D system from SAGEM. Likewise, the graphic production coming from dimensional datas by means of a laser is well knowned and very important. Let us only mention the very popular laser printers. All these devices are particularly characterized by their diversit y of use and their performances (speed, accuracy, resolution...). On the other hand, a certain number of used techniques are common to these devices (triangulation, stereoscopy, distance transdu-
340
I Shi et al / Control o f Motors by Microprocessors
cing of computed dimensional datas...). These systems can also be characterized by the volume of the target-space to be analysed (case of •distance mesuring) or to be reached (case of iluminating a photosensitive film). This latter constraint determines particularly if the systems will be static or if they must have movement capabilities. In this case, these movements need to be controlled and synchronized. Taking into account these specific constraints, the microprocessing architecture and the equipements used, will he particular to each system, and so will be the complexity of the software modules attached to them. In our two research units the devices we develop need : - the control of mechanical organs by means of microprocessors (d.c. or stepping motors) - the design of specialized hardware structures - the development of software modules for the computation, in real time, of a great number of datas. We propose to develop the first point of all these topics in this paper.
2.
I Host computer
J Microprocessor 1NTEL 805 ]
lm
echanism "']
Analog servomechanism
I Detector l of the echq
I
I Deflectors I
i
i
" rotating Camera
arm
Figure 1 : Complete scheme of system ;
HARDWARE
The common difficulty for all these systems is the control procedure for the displacements of the emitter part (e.g. the laser beam, infrared diode etc...) or the displacements of the receiver part (e.g. location cameras or light sensitive film) and the control of the other mechanical parts of the whole system. The system 1 is a localization system with laser beam. We use only one microprocessor INTEL 8051 to realize the following functions : - control of two rotation movements (D.C. motors). - control of the deflection of the laser beam. - treatment of the video signal delivred by the camera. The complete system is shown in figure 1 The system 2 is a 3D localization system : We use the infrared technique to realize the 3D localization. In this system, we have three microprocessors INTEL 8031. We can divide these three microprocessors in two parts : the first part is composed of two microprocessors, each one can control two rotation movements (D.C. motors) and is also used for the treatment of the signal coming from the infrared camera. The second part is the third microprocessor. The task of this one is to control two translation movements (stepping motors). The complete system is shown in figure 2. The system 3 is a 3D space positionning system. We use 2 microprocessors Z-80. One microprocessor is used for the data computation and
HOST COMPUTER
o
,-~ t-'
c ~
O o
o t~
co ~
O M
Lo ~ o
o
I o m
I
I
controls the system work. The other one p i l o t e s one r o t a t i o n movement (stepping motor) and one t r a n s l a t i o n movement (stepping motor). The data acquisition
is obtained by DMA. The simplified
0 n
o
Figure 2 : System 2 structure
m
~ o
Oo
J. Shi et al / Control of Motors by Microprocessors
scheme i n f i g u r e 3 i l l u s t r a t e s the organization of the system. For t h e t h r e e p r e v i o u s l y d e s c r i b e d d e v i c e s , we can p r o p o s e two s o l u t i o n s f o r t h e d e f l e c t i o n o f t h e l a s e r b e a n . One i s of t h e g a l v a n o m e t e r t y p e ( s y s t e m 1) and t h e o t h e r put i n t o a c t i o n an a c o u s t o - o p t i c a l modulator (system 3). On t h e o t h e r hand, t h e p a r t s r e c e i v i n g t h e l a s e r beam can be moved by DC motors f o r s y s t e m 1 and s y s t e m 2 o r s t e p p i n g motors f o r s y s t e m 3. For the microprocessor's structure which controls t h e movements o f t h e m o t o r s , we can p r o p o s e a modular h i e r a r c h i c a l s t r u c t u r e w i t h one m i c r o p r o c e s s o r p e r t a s k ( e . g . c o n t r o l of a motor i n s y s t e m 1) or on t h e c o n t r a r y a pseudo-parallel structure with a dedicated hardware ( s y s t e m 3 ) . In t h e l a s t c a s e a d i r e c t c o o p e r a t i o n between t h e two m i c r o p r o c e s s o r s i s p r o v i d e d by means of a communication i n t e r f a c e . In a l l c a s e s , it is interesting to note the i m p o r t a n c e of t h e m i c r o p r o c e s s o r t y p e c h o s e n : monochip microcontrolers (e.g. INTEL 8751) for system 1 and system 2, or multichip m i c r o p r o c e s s o r s ( e . g . Z80) f o r s y s t e m 3. I n t h e same way, d e p e n d i n g on t h e movements o f the other mechanical organs, DC or s t e p p i n g m o t o r s can be c h o s e n . C l o s e d loop c o n t r o l , i f necessary, i s p r o v i d e d by t h e use of o p t i c a l encoders.
Inter- ~ face
Microprocesso~
Micro~processo~
Z 80
ll Dedicated
DMA
--
Hardware
Z 80
~
Motor drive interface
I Pattern modulatox control
~uffer
memory
to beam modulator
Bus I
Bus 2
Figure 3 : Simplified scheme of system 3
341
3. SOFTWARE
The s o f t w a r e f o r s y s t e m 1 i s composed o f s e v e r a l modules a c c o r d i n g t o s p e c i f i c t a s k s such as : c o n t r o l o f t h e r o t a t i n g arm, c o n t r o of t h e l a s e r beam d e f l e c t i o n , d a t a a c q u i s i t i o n from t h e c a m e r a . . . Mainly t h e s e t a s k s can be d e s c r i b e d as f o l l o w i n g : R o t a t i n g arm module : s e n d s g o a l p o s i t i o n and speed o r d e r s through p a r a l l e l input-output s y s t e m , s e l e c t s t h e t y p e of c l o s e d loop s y s t e m (speed or p o s i t i o n ) , c o n t r o l s t h e i n t a n t a n e o u s position. Laser beam d e f l e c t i o n module : s e n d s a position order to the galvanometric rotating m i r r o r and c o n t r o l s i t s i n t a n t a n e o u s p o s i t i o n . Camera module : c o n t r o l s t h e s c a n of t h e camera and l o o k s f o r t h e l a s e r s p o t i n t h e image. Communication module : selects the a p p r o p r i a t e modules a c c o r d i n g t o t h e o r d e r s s e n t by an h o s t computer and c o n t r o l s t h e d a t a flow between t h e d e v i c e ' s m i c r o p r o c e s s o r s and t h e h o s t computer. - Data c o m p u t a t i o n t o c a l c u l a t e t h e d i s t a n c e measurement. F i g u r e 4 shows a g e n e r a l flow c h a r t of t h i s system. For s y s t e m 2 t h e s o f t w a r e can a l s o be d i v i d e d in four parts : - Control of t h e r o t a t i o n and t r a n s l a t i o n movements. - Data a c q u i s i t i o n from t h e c a m e r a s . - Communication module between a h o s t computer and l o c a l m i c r o p r o c e s s o r s . - Data computation to determine the 3D localization. A general organization of the software is shown in figure 5. For both these two previous systems the modules belonging to the microprocessors are written in assembler language and the host computer modules are written in FORTRAN language. The software for system 3 works in the context of a multiprocessor structure without common memory and with buses separated from each other. The transfer of datas between the two Z80 microprocessors occurs through a comaunication interface in the interrupt and polling modes. CPU1 s e n d s d a t a s t o CPU2, r e v e r s l y CPU2 s e n d s c o n t r o l s i g n a l s t o CPU1 t o i n f o r m CPU1 abou~ the state of t h e s y s t e m . So, q u a s i p a r a l l e l operation can be ensured. High speed p r o c e e s s i n g of t h e s p a c e p o s i t i o n i n g d a t a s i s a c h i e v e d by means of a d e d i c a t e d hardware (microprogrammed s t a t e m a c h i n e ) . This s y s t e m can work i n two modes : Synchronous and non s y n c h r o n o u s mode. I n t h e first mode we can d i s t i n g u i s h four different phasis : - s t o p p l o t t i n g p h a s i s : s y n c h r o n i s a t i o n of t h e system. non p l o t t i n g p h a s i s : d a t a t r a n s f e r v i a DMA f o r t h e n e x t s c a n , s e a r c h i n g f o r t h e end of -
-
-
-
-
J. Shi et al / Control of Motors by Microprocessors
342
I
Begin
I
I
I
INITIALIZATION
I
.
i
Communication Module C
g
COMMUNICATION
LOCALIZATION MODULE
r~ o o.
MODULE
I
ACQUISITION MODULE
c~ ~-~
o
o
o
C l-t
oq
o
I
MOVEMENTS MODULE
1
I No
Figure 4 : General flow chart of system l software Figure 5 : General flow chart of system 2 software scan signal and stepping to the next position. - start plotting phasis : at this time data transfer is complete and the system initiates plotting. - plotting phasis : laser modulator is activated for plotting while the next data flow for the next scan is loaded from the input data source. For the non synchronous mode the system loads the data flow for the next space position. In this case the position to reach is greater than one step scan. Figure 6 shows how works the machine for the plotting phasis.
4. R E S U L T S
Our results can be presented in a comparative table showing the performances of the three systems concerning the space explored, the resolution, and the speed.
SPACE
RESOLUTION
SPEED
EXPLORED
360 degrees SYSTEM 1 panoramic 2D vision up to more than five meters 3D localiSYSTEM 2 zation in a volume of
2cm at 2m 40 measures per second
30 measures icm at 2m per second
about lOOm s 600mmX5OOmm SYSTEM 3 surface 'positioning
25 ~m
430 million pixels in 8 minutes
J. Shi et al / Control o f Motors by Microprocessors
START
For b o t h s y s t e m s 1 a n d 3 we c a n n o t e t h a t t h e results depend also on t h e t y p e o f d e f l e c t o r s for the emitting source (galvanometer mirror or accousto-optical modulator). F o r s y s t e m 2 i t m u s t be n o t e d , t o o , t h a t t h e results a r e d e p e n d i n g on t h e c h o i c e o f t y p e o f the c a m e r a s (CCD a r r a y o r a n a l o g c a m e r a o f t h e PIN t y p e f o r e x a m p l e ) , and o f t h e n u m b e r o f t h e freedom degrees for their movements, and of the 2D c a m e r a r e s o l u t i o n .
)
_I [ OA[IINO OF MEiv'ORIES
I
(/" STOPPLOTTING~qJ 51GNAL
343
/
I S~LEC~G OFTHE] SCAN COMMANDS I
5. CONCLUSIONS
OMA OPERATION'S\
J STEPPING OF J THE PROJECTING OBJECKTIV
NECESSEIRY? /
I I [
DAIA ]RAN5FER J BY DMA, FROM I BUFFERTO WOR~INGMI
CHECKING OF THE I
"I
PLOTTING PARAMETERS
J SEARCHING OF END OF SCAN
i
I
I_ ~/"S~A~T RLOT~INO'~ n SIGNAL / I Y
I
PULL LOADINGOc'X'~ HE MEMN , ECESSERY/
1o LOADING OF ONE" I DATABLOCKIN TO 7H£ BUFFERMEMORY
SEPARATINGCOMPLETING OF DATA FOR LASER BEAMS MODULATION
The design and realization of such systems, suppose to solve, simultaneously, the coordinated control of several motors and the processing of a great amount of datas. So, the real time constraints for the system operation are, of course, fondamental. Two approaches have been proposed to solve these problems concerning the hardware design : one can be considered as a modular hierarchical multimicroprocessor system tied with an host computer, the other one is a multiprocessor system, without comaon memory and with separated bases, coupled to a dedicated hardware machine. The first solution have been developped and tested with system 1 and 2 in the french research center, while the second have been in the hungarian institute. Taking advantage of the scientific cooperation established between our two research units, we hope that the comparison of the solutions selected by each one will furnish an interesting contribution to this aspect of the question. We hope also that such a comparative study, which seems to us necessary, will contribue to inform a little more designers of future systems, for their technical choices. Is not the simultaneous study of different techniques for solving the same problems an efficient method to find an optimal solution ?
Figure 6 : Simplified data flow chart for system 3 plotting phasis 6. BIBLIOGRAPHY
Our work about the three systems we talk about in this paper, have shown us that the final performances for each of them are largely d e p e n d i n g on : - the mechanical precision of the different devices the accuracy of the movements of the mechanical or optical organs the type of motors chosen (DC or stepping motors) - t h e t y p e o f command o f t h e s e m o t o r s ( s p e e d o r position control) - the accuracy and t h e resolution of the position encoders (potentiometer of optical encoders) the hardware and software organization. -
1. MAILLET H. Le laser, principes et techniques d'applications. Ed. Tech. et Doc. Lavoisier J.S.B.N. ~-85 206-240-2 (1984) 2. MONCHAUD S. "Contribution ~ la t~l~m~trie pour robots de troisi~me g~n~ration" Th~se d'Etat 1986. 3. PELSVE K. Precision of post-objective, two-axis galvanometer scanning. Proc. SPIE January 20-21, 1983. volume 330, pp 1-9. 4. POSMANICZKY A. A new multi-channel acoustooptic light modulator in TeOZ crystals. Proc. of the electro-optics laser inter 76. UK Conference Brighton, England. 5. KAS L., PALOTASI A., VOROS K. New hardware algorithm and architecture for high speed laser plotting. Proc Mini and microcomputers
344
J. Shi et al / Control of Motors by Microprocessors
and t h e i r a p p l i c a t i o n s B a r c e l o n a St F e l i c e (Spain) 1985, VI, pp 25-28. 6. SHI J . , MONCNAUDS . , PRAT R. and a l . A new s e n s o r f o r mobile r o b o t l o c a l i z a t i o n and artificial picture synthesis, ROVISEC-6 Paris, France, 1986, pp 139-150. 7. CSIPKA L., HEVIZI L., KAS J., PALOTASI A., VOROS K. "High-speed and high resolution laser Plotting". Fourth symposium on microcomputer and microprocessor applications, Budapest, oct 1985, pp 130-140.
SNORT BIBLIOGRAPHY OF THE AUTHORS SHI J i e : Born i n 1962 has o b t a i n e d t h e electronic engineer diploma at Tianjin U n i v e r s i t y i n P e o p l e ' s R e p u b l i c of China i n 1982 and the diploma of the "Etudes A p p r o f o n d i e s " a t t h e INSA of Rennes (France) i n 1985. Now he i s a f u l l t i m e r e s e a r c h e r a t LATEA of t h e INSA of Rennes and i s p r e p a r i n g a D o c t o r a t T h e s i s s i n c e September 1985. Dr. MONCHAUD Serge : Born in 1945, Doctorat of 3th cycle in Electronics (1973), Doctorat d'Etat Sciences (1986). He has been working on robotics, particularly acoustical and optical sensors for mobile robots. Actually he makes two courses on Robotics Sensors and principales of measurement systems for engineers students. PRRT Raymond : Born in 1949, is graduated from the Technology Institute of the Rennes University (France). He is working, as a research engineer, in the field of data processing, electronic and microprocessor design. Dr. I~S Ivan : Born in Budapest (1942), receivend the engineer diploma of electrical engineering from the Technical University of Budapest in 1966 and the engineer Doctor in 1981. From 1966 he is a scientific collaborator from the COMPUTER and AUTOMATION INSTITUTE of HUNGARIAN SCIENCES ACADEMY. He is a specialist of parallel computing-microprocessors applications and dedicated hardware design.