Control system circuit diagram
The execution part is a stepping motor, the feedback control part is a photoelectric sensor, and the control part is a single-chip microcomputer. The schematic diagram of the circuit is shown in Figure 1, which is the connection method of the entire control system.
The power supply and the partially repeated photoelectric detection unit, the triode and the relay of the altitude angle (the same as the azimuth angle in the figure) are not shown. D in the figure. For the photodiode placed in the external environment, by adjusting R₂₇, when there is no light in the outside world, the P17 pin of the single-chip microcomputer can detect the low potential to judge the day and night. D₁ is the photodiode placed in the center of the cylinder. Properly adjust the values of R₀ and R₁, so that when the photodiode D₁ in the cylinder is exposed to light, the op amp A₁ can output a high level (1), and D₁ outputs a low level (0) when it is not exposed to light. The other channels are also processed in the same way. K₁ and K₂ are travel switches used to detect the initial position of the azimuth angle and the altitude angle. One of the two groups of contacts of the relay is used to control the rotation of the motor, and the other group is connected to the solenoid valve at the same time to release the lock.
Figure 2 is the main program block diagram. After power on, call the time correction subroutine, set the HYM8563 timer to 10min, and call the automatic adjustment subroutine. In the first adjustment after starting up, if it is cloudy, the program will not be able to locate because the correct position data has not been stored. At this time, artificial light source is used to simulate the sunlight for positioning. After the initial data is obtained, the program can automatically adjust . Then allow the interrupt request and select the edge trigger mode, set EA=1 to allow the total interrupt, and then enter the standby state to reduce power consumption.
89C52 is in the standby state, only reset or interrupt can wake up, the level generated by the button and the level generated by the HYM8563 timer are continuously connected to the 89C52 pin through two AND gates. Therefore, whether it is a button or an interrupt signal generated by the HYM8563 timer every l0min, it will wake up 89C52 and enter the interrupt processing subroutine (Figure 3). Setting the time interval to 10 minutes can not only maintain a high power generation efficiency, but also prevent too frequent adjustments.
In the interrupt processing subroutine, when the light is normal, the automatic adjustment subroutine will be called once. After the sunny correction is successful, the hour (1~24) and minutes (1, 2, 3, 4, 5, 6 are used to represent 0, 10, 20, 30, 40, 50min) form 1 byte to represent the time. The azimuth angle and the altitude angle share 2 bytes, of which the horizontal azimuth angle occupies 9 digits, and the altitude angle occupies 7 digits. The maximum can be 512 and 128 respectively. Therefore, it is enough to make the adjustment angle reach a precision of 10, and store these 3 bytes in the designated 89C52 on-chip RAM area. If the adjustment is unsuccessful in a cloudy day, it will not be stored, and the position that was adjusted successfully in the same time period will be recalled instead. In this way, the stored sun position on a sunny day can be recalled when it is cloudy, and it can also be automatically corrected on a sunny day to eliminate accumulated errors caused by changes in the sun’s position in different seasons.