Design of a time/displacement commutation controller based on AT89C51
2026-04-06 05:58:35··#1
Introduction In actual production processes, control components with automatic reversing functions are often used, such as reciprocating motion (displacement) in machining, forward and reverse output of DC power supplies, and forward and reverse operation of motors. These phenomena involve automatically switching to reverse (or forward) motion after a certain time or position, repeating the cycle. Automating this process involves designing a control circuit and equipping it with a displacement sensor or time relay. While existing time relays on the market can be combined in multiple ways to meet the requirements of various applications, they still suffer from problems such as large repetitive timing errors, low stability and reliability, and inconvenience in use. Therefore, the author developed the SWHX-1 time/displacement reversing controller, based on a microcontroller. This system is characterized by low cost and completely overcomes the above shortcomings. Circuit Composition and Working Principle: The internal circuit of SWHX-1 is shown in Figure 1. The system consists of three parts: input/output electrical signal conversion, CPU software programming control, and timing delay setting. The entire circuit has 14 leads, of which pins 2, 3, and 4 are the common DC ground terminal VGND. This device can operate with both AC and DC power supplies. When powered by AC, a 12V AC voltage is input through pins 13 and 14, rectified and regulated by a bridge rectifier to supply a constant voltage reference power supply to the internal circuit. The rectified 12V DC voltage is then output through pins 1, 2, 3, and 4 for use by other external circuits. When powered by DC, pins 1, 2, 3, and 4 become input terminals. The input 12V DC voltage is regulated before being supplied to the internal circuit. This method eliminates the need for an AC power supply, but it is important to ensure that pins 14 and 13 are left floating. Figure 1 shows the schematic diagram of the time/displacement commutator circuit. The SWHX-1 internal circuit design includes one commutation delay and two timing outputs. The commutation delay time refers to the time after the forward (or reverse) output group is turned off before the reverse (or forward) group is turned on, which can be set arbitrarily between 0.5 and 2 seconds. The two timing times refer to the working time of the forward and reverse output groups, respectively, which can be set arbitrarily between 1 minute and 7 hours and 31 minutes. If the timing interval of 1m to 7h31m cannot meet the usage requirements, four additional ports P1 to P4 are provided for connecting four external time relays or four limit switches to compensate. P1 and P3 are the forward group, and P2 and P4 are the reverse group.