1. Introduction
Looking at the current domestic telescope market, telescopes of all sizes are equipped with computers to achieve PC control. This has invisibly increased the production cost of the product, and made some small and medium-sized telescopes that originally did not need to be equipped with a computer also have to be equipped with a computer. Without a computer, they can only perform some simple manual operations, which is extremely painful. I have mainly done some crude research in this aspect, and used the assembly language of a single-chip microcomputer to compile a program for the telescope to automatically find stars, realizing the function of the handle box automatically finding stars.
System Hardware Overview
The core part of this control system is a CPU with dual serial ports (W77E58 chip), which can communicate with the host computer and the handle box at the same time, or communicate with them separately. An XC95108-84 is responsible for counting and frequency division, and an MC146818 clock chip is used to generate sidereal time. Some peripheral interface circuits are attached. For details, see (Figure 1). Because this article focuses on the algorithm part, the hardware part will not be described in detail.
Lower computer system block diagram (Figure 1)
Three software parts
Specifically, the software can be divided into four parts: PC (industrial computer) part, handle box part, lower computer part and power amplifier module part. The PC and handle box communicate with the main computer CPU (W77E58) of the lower computer respectively, connected by serial cables to achieve communication, and the power amplifier module (drive part) is connected to the lower computer directly by a data cable. Below we mainly introduce the design process and algorithm ideas of the lower computer software:
1. Design ideas
We should make clear the purpose of this design, that is, to realize the function of automatic star finding of the telescope. Specifically, we must first accurately calibrate the position of the telescope, that is, select a known star in the sky, manually operate the handle box, find it in the center of the telescope's field of view, and place it in the center of the crosshairs of the main mirror. At this time, the coordinate position of this star is input through the handle box, and the calibration replaces the original position of the telescope. Then, with this star as the basic point, according to the hour angle and declination, find any unknown star in the sky. Since the system has a power-off protection module in the program, for the telescope, it only needs to be calibrated once after debugging, and the system will be shut down each time thereafter. The current real-time position of the telescope will be automatically saved, which brings great convenience to users. When automatically searching for stars, we input the astronomical coordinates (α, δ) of the sky star into the telescope. The telescope selects a suitable path according to the current position of the sky area it is pointing to and the position of the target star to be found. The right ascension and declination motors are driven to rotate to point to the target star, so that the target star falls into the field of view of the telescope. After searching for stars, it automatically switches to tracking. The pointing of the telescope and the coordinates of the celestial body are linked through the sidereal time. Therefore, we need to know the sidereal time. Before each observation, we need to calibrate the sidereal time. The sidereal time is manually calibrated by the program and displayed on the panel. According to the formula t+α=s①
Where t is the hourly angular position of the star
α is the right ascension of the star
s is the local sidereal time
Obviously, we can match the hour angle of the telescope with the hour angle of the star. In the tracking state, in order to overcome the influence of the earth's rotation, the hour angle moves at a uniform speed of 15 arc seconds per hour and second in the direction opposite to the earth's rotation. Therefore, in terms of right ascension, it is mainly to collect local local star time in real time, refresh the display continuously, calculate the hour angle of the target star, and finally make the dynamic hour angle value of the telescope equal to the hour angle of the target star, so that the right ascension star search is completed; in terms of declination, because the declination of the star is constant, we only need to make the dynamic declination display value of the telescope constantly close to the declination value of the target star. However, for equatorial telescopes, it is necessary to consider the location of the telescope in the sky area and the location of the target star, select a suitable star search path, and ensure that the posture of the telescope tube is correct. As for the limit part, it can be set according to customer requirements. [page]
2. Lower computer software flow chart
3. Subroutine part
(1) Keyboard input and display part
In this system, we selected the 8279 chip, queried the key value in the program, and sent it to the fixed unit. If no key is pressed, #0FFH is sent to the fixed unit, and then the unit is queried. If it is #0FFH, it returns, otherwise it transfers to the corresponding function subroutine according to the key value content of the unit; and the display part mainly splits the data to be displayed into 7 bits (this system uses 7-bit digital tube display), and sends them to the display buffer respectively. The 7 corresponding fonts are taken out from the table by looking up the table and sent to the 8279 data port to realize dynamic display. The keyboard scanning and display mode of 8279 are realized by initialization programming. The 8279 initialization part program is as follows:
MOV DPTR, #7FF0H; 8279 chip status address
MOV A, #0D1H; Clear command
MOV @DPTR, A; command word sent in
LL: MOV A, @DPTR; Read 8279 status word
JB ACC.7, LL ; Clear wait
MOV A, #08H; Input external decoding on the left side of the display, double key interlock mode
MOV @DPTR, A; command word sent in
MOV A, #2AH; Clock programming command
MOV @DPTR,A; command word sent in
RET; Return
(2) MC146818 clock part
The MC146818 chip is a programmable clock chip produced by Motorola. It is used in this system to read and write sidereal time. Some of the main operations are chip initialization, read time operation, and write time operation. When using this chip to perform read/write time operations, you must pay attention to first query its status to see if it is refreshing data. If it is, you must wait until the refresh data action is completed before reading/writing the chip, otherwise it is easy to make mistakes. The initialization part of the MC146818 program is as follows:
MOV DPTR,#0BFCAH; A register port address
MOV A,#26H; Command word
MOVX @DPTR,A
INC DPL; B register port address
MOV A,#1AH; command word
MOVX @DPTR,A
RET; Return
Read time subroutine:
MOV DPTR, #0BFCAH
AA: MOVX A, @DPTR; Read status word
ANL A, #80H
JNZ AA; Is the chip being refreshed? No, read data
MOV DPTR, #0BFC0H; countdown unit
MOVX A, @DPTR
MOV @R1, A
INC R1
MOV DPL, #0C2H; read unit
MOVX A, @DPTR
MOV @R1,A
INC R1
MOV DPL, #0C4H; read time unit
MOVX A, @DPTR
MOV @R1, A
RET; Return
The subroutine for writing time is similar to the above and will not be described in detail.
(3) Serial communication subroutine
W77E58 realizes dual serial port communication. After initialization, it enters the main process and checks the serial ports one by one to see if there is a communication data request. If there is, it enters the communication subroutine and returns. Otherwise, the program will directly execute and send the data of the lower computer to the handle box and the industrial computer respectively, waiting to receive the control command. The specific initialization procedure is as follows:
[page]
MOV TCON,#50H; Timer/Counter Status Setting
MOV TMOD,#21H; Timer/Counter Mode Setting
MOV PCON,#00H; Power controller settings
MOV SCON,#53H; Serial port 0 working mode setting
MOV TL1,#0FDH; Count constant setting
MOV TH1,#0FDH
MOV SCON1,#53H; Serial port 1 working mode setting
MOV TH0,#3CH; Count constant setting
MOV TL0, #0B0H
RET; Return
(4) Calibration subroutine flow chart
(5) Automatic star search program
First, according to the input right ascension value of the target star, the local sidereal time S is taken out, and converted into the hour angle value to of the target star through calculation. Then the real-time position value tt of the telescope is read. Different star-finding paths are selected according to the differences in the sky areas where their right ascension hour angles are located. The specific situations can be divided into the following types:
1) If the hour angles of the telescope and the target star are in the same celestial region (with the central column of the telescope as the axis, divided into two major celestial regions, east and west, which is artificially set), drive the declination axis first, then drive the right ascension axis, until the target star is found and start tracking.
2) If the hour angles of the telescope and the target star are in different celestial regions, that is, searching for stars across celestial regions, first drive the declination axis to point to the North Pole, then drive the right ascension axis, and then drive the declination axis again until the target star is found and tracking begins.
In addition, since our position feedback information comes from an incremental circular grating encoder and the degree of declination is always in the range of (-90, 90), special processing is required.
What remains is the typical pursuit problem. Taking right ascension as an example, the specific flow chart is as follows:
4. Conclusion
After more than a month of actual use and observation, the telescope system runs well, smoothly and noiselessly, finds stars accurately and with high precision, and can be applied to all kinds of large, medium and small telescopes.
Previous article:A gas stove voice control device based on SPCE061A single chip microcomputer
Next article:Development of a medical sterilizer control system based on single chip microcomputer
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- MPPT solar lithium battery charger based on single chip microcomputer
- Data sharing: A brief review of the 2018 National Undergraduate Electronic Design Competition TI Cup and sharing of preparation experience
- STM32 assignment question
- LIS331DLH three-axis acceleration sensor package and code
- EEWORLD University - EOS and ESD on ADC
- What is 5G IoT? Current applications of 5G IoT
- How to get started with developing a low-power Bluetooth using cc2650?
- [RVB2601 Creative Application Development] LVGL Horizontal Scrolling Display
- 12 details of PCB layout
- June 30th Liyuan live broadcast replay: ON Semiconductor Power Solutions (including video, presentation documents, QA)