Design of a 360° panoramic camera based on a single chip microcomputer

Publisher:advancement4Latest update time:2012-07-02 Source: 21ic Keywords:MCU Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

0 Introduction

The PTZ controller designed with a single-chip microcomputer as the core can control the camera to move over a large range and at a wide angle in monitoring situations, so that the LCD screen camera can achieve nearly 360° panoramic recording, and it has unique advantages in terms of economy, flexibility, scalability and maintainability.

1 System overall structure

The system consists of the following parts: ① Single-chip microcomputer: the core of the design, which recognizes the information input by the keyboard with the cooperation of the software, and sends instructions to the stepper motor in the pan-tilt according to the input information, so that it can realize functions such as forward/reverse, speed control, program control, etc., and the speed of the stepper motor is displayed through a digital tube; ② Stepper motor and drive: responsible for the rotation of the pan-tilt system in the vertical and horizontal directions, and is the executive component of the system; ③ Keyboard: an input device for external information, and an important component for the control personnel to command the work of the pan-tilt system; ④ Display device: displays the real-time speed of the stepper motor so that the LCD screen controller can determine the control strategy for the pan-tilt according to the speed.

2 System Hardware Design

The hardware circuit is divided into three parts according to the system function: stepper motor and its drive 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 Stepper motor control and drive module selection

After receiving the pulse signal, the driver drives the stepper motor to rotate a fixed angle in the set direction. 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 the motor rotation can be controlled by controlling the pulse frequency to achieve the purpose of speed regulation. The selected stepper motors are two hybrid stepper motors 57BYG250C, which have two-phase/four-phase operation capabilities. The step angle is 1.8° when working in four beats and 0.9° when working in eight beats. The stepper motor drive module model is HB202A, which has functions such as 4/8 beat conversion control signal, offline (FREE) control signal, and input signal photoelectric isolation. An offline control key is added to the design. When a fault occurs or debugging occurs, the two motors are placed in an offline state, and the stepper motor can be manually adjusted. The offline control key is directly connected to the microcontroller INT0, and INT0 is set as the highest priority so that offline control can be quickly achieved in the event of a fault. Since it is directly connected to the microcontroller without passing through 8279, a keyboard de-bouncing circuit must be set up to avoid malfunction of the microcontroller.

2.2 Keyboard and display circuit design

The LCD screen keyboard and display circuit are implemented by INTEL8279. The keyboard adopts N-key loop mode, and the display is 8-bit left input. 8279 is connected to a 2*8 keyboard and an 8-bit display, and adopts a coded scanning mode. The IRQ of 8279 is connected to the INT1 of the microcontroller, and an interrupt will be requested as long as a key is pressed. When the microcontroller is connected to a 12M crystal oscillator, ALE is 2M, and it is connected to CLK, so its frequency division command word is 34H. There are 16 keys expanded by 8279, 8 of which are responsible for the forward and reverse rotation of the stepper motor in both directions, and 8 are function keys, which are responsible for the acceleration and deceleration of the stepper motor, program control, and the limit switch of the stepper motor.

3 System Software Design

The system software mainly consists of initialization program, keyboard program, speed control program, speed detection and display program. Except for the initialization program, the rest of the programs adopt interrupt working mode to improve the CPU utilization.

3.1 System initialization program design

First, initialize each interrupt source of the MCU, and use five interrupt sources: INT0, INT1, T0, T1, T2. INT0, T0, T1 are high priority, and INT1, T2 are low priority. When INT0 requests an interrupt, the program immediately causes the stepper motor to enter the offline control program. The stepper motor is no longer controlled by the MCU, and it is level-triggered. The MCU always executes the offline program until the external trigger signal is manually canceled by the operator, and the system resumes normal operation. Then set the working mode of T0, T1, and T2, write the count disposal, turn on the enable bits of these interrupt sources, and turn on the CPU interrupt.

3.2 Design of keyboard program

When a keyboard key is pressed, an interrupt request is generated. After the MCU responds to the interrupt, the interrupt program starts to execute. The generated key value is read from the 8279, and the corresponding program is executed according to the key value. After the CPU receives the information, it does not act immediately. In order to ensure the stability of the stepper motor speed control, the command corresponding to the key value is first saved. After T0/T1 reaches the set count value, when a pulse needs to be output at a certain speed, the information is sent to the stepper motor. [page]

3.3 Stepper Motor Speed ​​Control Software Design

Changing the frequency of the CP signal of the driver module can change the speed of the stepper motor. Changing the frequency of the CP signal can be achieved through the timer/counter. First, the timer/counter is loaded with the initial setting, and then it starts running. After the specified time is reached, the interrupt program is executed. At this time, the program that generates the CP signal can be placed in this interrupt program, and the purpose of changing the speed of the stepper motor is achieved. T0 and T1 inside S52 correspond to the speed control of the two stepper motors respectively, and its working process is shown in Figure 2.

3.4 Speed ​​detection and display software design

The timing counting method is used to count the step pulses sent by the microcontroller to the stepper motor within a certain period of time. Assume that the microcontroller detects the number of pulses N sent to the stepper motor every 50ms, and the relationship between N and the speed is as follows:

The rotation speed per minute can be obtained by multiplying the detected pulse number N by 3. The 50ms timing is realized by the third timer/counter T2 inside S52.

4 Conclusion

The pan/tilt controller composed of a single chip not only has the characteristics of high control accuracy, flexible control method, simple programming, low power consumption, and high reliability, but some new single-chip microcomputers also have online programming functions. The program can be updated without removing the LCD microcontroller from the working environment, which facilitates software maintenance. According to needs, the LCD drive motors in both directions can be automatically coordinated and controlled by pre-compiled programs.

Keywords:MCU Reference address:Design of a 360° panoramic camera based on a single chip microcomputer

Previous article:Design of automatic alarm system for home anti-theft
Next article:Infrared remote control mouse

Recommended ReadingLatest update time:2024-11-16 20:55

[51 MCU Quick Start Guide] 2.5: Parallel I/O Expansion and 8255A
Windows 10 20H2 Proteus 8 Frofessional v8.9 SP2 Keil uVision V5.29.0.0 PK51 Prof. Developers Kit Version:9.60.0.0 Hard Knowledge        Excerpted from "Single-Chip Microcomputer Basics" (3rd Edition) - Edited by Li Guangdi, Zhu Yuexiu, and Leng Zuqi Basic knowledge of MCU I/O expansion        Using the I/O (Input/
[Microcontroller]
[51 MCU Quick Start Guide] 2.5: Parallel I/O Expansion and 8255A
How to download the firmware library of stm32 series microcontroller
The first step  is to enter the ST official website ( ST official website ), you can choose Chinese (it is recommended to read more English, which is very useful for reading data manuals. The following steps are mainly in English), as shown in Figure 1  Step 2:  Select tool & software —- MCUS Embedded Software  Step
[Microcontroller]
C code for making eye-activating instrument with single-chip microcomputer
This is a complete code of the eye-activating instrument made with 51 series single-chip microcomputer. Friends who need it can take a look. The code has been tested successfully. /* Project name: Single-chip eye-activating instrument Related knowledge points: single-chip microcomputer drives heating d
[Microcontroller]
PIC16F877A microcontroller perpetual calendar program
1. Principle introduction: 1.  The single-chip microcomputer  still uses the most classic PIC16F877A in P IC , which has many ports and full functions, especially it has 8K ROM, which is the main reason for my choice, because storing the LCD font library requires a lot of space. 2. The LCD display still uses the KS01
[Microcontroller]
Design of three-phase half-controlled rectifier circuit using PIC microcontroller chip
The three-phase half-controlled rectifier bridge circuit structure is a common rectifier circuit , which is easy to control and has low cost. This article introduces a three-phase half-controlled rectifier circuit based on PIC690 microcontroller and dedicated integrated trigger chip T
[Power Management]
Design of three-phase half-controlled rectifier circuit using PIC microcontroller chip
Design of LED dot matrix display system based on STC89C55RD+ single chip microcomputer
1 Introduction In places such as stations, shopping malls, and schools where changing real-time information or advertising is required, traditional media such as blackboards, paper, or neon billboards can no longer meet current needs in terms of display effects or modifiability. However, LED dot matrix displays
[Power Management]
Design of LED dot matrix display system based on STC89C55RD+ single chip microcomputer
Robotic arm intelligent grabbing system based on 89C51 microcontroller
Abstract: In the process of agricultural development, fruit picking is an extremely labor-intensive task. In order to reduce labor costs in the agricultural production process, applying artificial intelligence to the agricultural field will be an effective means. An intelligent grasping system is designed based on the
[Microcontroller]
Robotic arm intelligent grabbing system based on 89C51 microcontroller
PIC microcontroller makes LED light flashing program on ICD1
;******************************************************** ;* FLASH.ASM * ;***************************************************** ;**************************************************** ;* This program is a LED light cycle flashing program, use the INT key to switch* ;* Flashing mode* ;*************************
[Microcontroller]
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号