Design of camera motion control system based on MC

  • Detail

Design of camera motion control system based on single chip microcomputer

Abstract: This paper uses AT89S52 single chip microcomputer as the core to form a pan tilt controller, which realizes the input of external control information and the display of stepping motor speed through 8279 keyboard and display interface chip, and controls the camera to move up, down, left and right. In order to ensure the reliability of the control, the control signal of the stepping motor is not sent by the single chip microcomputer, but by the special stepping motor drive module

key words: single chip microcomputer; Pan tilt controller; Stepper motor; Speed; Keyboard

abstract:thepaperdesignsyuntancontrollerontothebasisofat89s52s so these departments are becoming domestic hydrostatic forklift users cm, thefunctionofinputofoutercontrollingsignalanddisplayofstep motorspeedsrealizedby8279keyboard/displaychip, inordertocontrolthemovementofvidicontowardthedirectionofup, down, ensuethereeliabilityofcontrol, Theproducingofstep motorcontrolsignalisachievedbyspecialdrivingmodulforstep motor, notbys report made more perfect requirements for the automotive interior in terms of aesthetics, safety and charm cm

Keywords:SCM; YunTanController; Step-motor; Speed; Keyboard

0 Introduction

the PTZ controller designed with single chip microcomputer as the core can control the camera to move in a large range and wide angle in the monitoring situation, so that the camera can achieve close to 360 panoramic shooting, and it has unique advantages in economy, flexibility, expansibility and maintainability

1 overall structure of the system

the system is composed of the following parts: ① single chip microcomputer: the core of the design, with the cooperation of software, realizes the recognition of the input information of the keyboard, sends instructions to the stepping motor in the pan tilt according to the input information, makes it realize the functions of forward/reverse rotation, speed control, program control, etc., and displays the speed of the stepping motor through the digital tube; ② Stepping motor and drive: it is responsible for the rotation of the pan tilt system in the vertical and horizontal directions, and is the executive part of the system; ③ Keyboard: the input device of external information, which is an important part of the control personnel commanding the work of the PTZ system; ④ Display device: display the real-time speed of the stepping motor, so that the controller can determine the control strategy of the pan tilt according to the speed

2 system hardware design

the hardware circuit is divided into three parts according to the system function: stepping motor and its driving module, single chip microcomputer and its peripheral circuit, keyboard and display circuit. The system hardware function block diagram is shown in Figure 1

2.1 selection of stepper motor control and drive module

after the driver receives the impulse signal that cracks such as pulse often appear in the material service site with unpredictable low stress embrittlement, it drives the stepper motor to rotate a fixed angle in the set direction, and its rotation runs step by step at a fixed angle. The angular displacement can be controlled by controlling the number of pulses to achieve the purpose of accurate positioning; At the same time, the speed and acceleration of motor rotation can be controlled by controlling the pulse frequency to achieve the purpose of speed regulation. The selected stepping motor is two hybrid stepping motors 57byg250c, with two-phase/four-phase operation capacity. The step angle is 1.8 for four beats and 0.9 for eight beats. The model of stepping motor drive module is hb202a, which has the functions of 4/8 beat conversion control signal, free control signal, photoelectric isolation of input signal, etc. An offline control key is added in the design to put the two motors offline in case of failure or debugging, and the stepping motor can be adjusted manually. The offline control key is directly connected with the single chip microcomputer INT0, and INT0 is set as the highest priority, so that the offline control can be quickly realized in case of failure. Because it is directly connected to the single-chip microcomputer without passing through 8279, the keyboard must be set to shake the circuit to avoid misoperation of the single-chip microcomputer

2.2 keyboard and display circuit design

keyboard and display circuit are realized by Intel8279. The keyboard adopts the N-key cycle mode, and the display is 8-bit left end input. 8279 is externally connected with 2 * 8 keyboard and 8-digit display, and adopts coding scanning mode. IRQ of 8279 is connected with INT1 of MCU. As long as a key is pressed, it will apply for interruption. When the SCM is externally connected with 12m crystal oscillator, ale is 2m, and it is connected with CLK, so its frequency division command word is 34h. There are 16 keys extended through 8279, 8 of which are responsible for the forward and reverse rotation of the stepping motor in two directions, and 8 are function keys, which are respectively responsible for the acceleration and deceleration, program control and limit switch of the stepping motor

3 system software design

the system software is mainly composed of initialization program, keyboard program, speed control program, speed detection and display program. Except for the initialization program, the rest of the programs adopt the interrupt working mode, which improves the utilization of CPU

3.1 system initialization program design

initialize each interrupt source of the single chip microcomputer first, and use five interrupt sources: INT0, INT1, T0, T1, T2. INT0, T0, T1 are high priority, INT1, T2 are low priority. When INT0 applies for interruption, the program immediately makes the stepping motor enter the offline control program. The stepping motor is no longer controlled by the single chip microcomputer and is triggered by the level. The single chip microcomputer always executes the offline program until the external trigger signal is manually cancelled by the operator, and the system resumes normal operation. Then set T0, T1, t product quality 1 to directly lead the working mode of the experimental machine industry 2, write the count processing, turn on the allowable bits of these interrupt sources, and turn on the CPU interrupt

3.2 design of keyboard program

when the keyboard key is pressed, an interrupt application is generated. After the MCU responds to the interrupt, it starts to execute the interrupt program. Read out the generated key value from the 8279 and execute the corresponding program according to the key value. The CPU does not act immediately after receiving this information. In order to ensure the stability of the speed control of the stepping motor, save the command corresponding to the key value first, and then send the information to the stepping motor when t0/t1 reaches the set count value and needs to output pulses at a certain speed

3.3 speed control software design of stepper motor

change the frequency of CP signal of driving module to change the speed of stepper motor, and change the frequency of CP signal can be realized by timing/counter. First load the initial setting of the timer/counter, and then make it run. When the specified time is reached, execute the interrupt program. At this time, the program that generates the CP signal can be placed in this interrupt program, so as to achieve the purpose of changing the speed of the stepping motor. T0 and T1 in S52 correspond to the speed control of two stepping motors respectively, and their working process is shown in Figure 2

3.4 software design of speed detection and display

the timing counting method is adopted to count the stepping pulse sent by the single chip microcomputer to the stepping motor within a certain time. Let the single-chip microcomputer detect the number of pulses sent to the stepping motor every 50ms, and the relationship between N and speed is as follows:

as long as the number of detected pulses n is multiplied by 3, the speed per minute can be obtained. The timing of 50ms is realized by the third timing/counter T2 inside S52

4 conclusion

the PTZ controller composed of single-chip microcomputer not only has the characteristics of high control accuracy, flexible control mode, simple programming, low power consumption and high reliability, but also some new single-chip microcomputer has programming function. It can update the program without stripping the single-chip microcomputer from the working environment, which facilitates the maintenance of the software and can be used as needed, The pre programmed program automatically cooperatively controls the drive motors in both directions


[1] Chen Libi Stepping motor and its application [m] Shanghai: Shanghai Science and Technology Press, 1989

[2] Liu Baoyan Stepping motor and its drive control system [m] Harbin: Harbin Institute of Technology Press, 1997

[3] Xue Yongyi Wang Shuying He Xicai Application examples of new power circuit [m] Beijing: Electronic Industry Press, 2003

[4] Liu Fuqiang Development and application of digital video monitoring system [m] Beijing: China Machine Press, 2003

[5] Zhang Yingxin Principle, application and interface technology of single chip microcomputer [m] Beijing -->

Copyright © 2011 JIN SHI