A control circuit based on a four-story elevator model
By designing a microcontroller control circuit based on the four-layer elevator model, using STM32F103RBT6 chip and signal conversion circuit, the problem that traditional systems cannot effectively control the elevator is solved, signal detection and control of the elevator model is realized, and communication wiring is simplified, saving Number of serial ports.
Patent Information
- Application Number
- CN202210210246.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-04
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2042-03-04
AI Technical Summary
In elevator teaching, there are many difficulties in using actual elevators to write control programs, including the inability of traditional PLC systems to write complex algorithms in C language, the personal computer control system is large in size and high in cost, and the microcontroller circuit board is difficult to design to meet the four-layer elevator model Control requirements.
Design a microcontroller control circuit based on the four-layer elevator model, including microcontroller circuit and signal conversion circuit. Using STM32F103RBT6 chip as the main control chip, the reception and control signal output of the elevator detection signal are realized through the signal conversion circuit, simplifying wiring and real-time Monitor the operating status of the elevator.
The signal detection and control of the four-layer elevator model is realized, the multi-machine communication wiring is simplified, the number of observation serial ports is saved, and the operating speed of the elevator control program can be externally detected through the frequency output pin.
Smart Images

Figure CN114637237B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of elevator control, and more particularly to a control circuit based on a four-layer elevator model. Background Art
[0002] In elevator teaching, there are many problems that are difficult to solve when writing control programs using actual elevators, so a four-story elevator model is designed. The four-story elevator model needs to use a control system that is easy to use, low cost, convenient to develop using C language programming, and small in size. It is difficult to meet these requirements at the same time. Traditional PLC control systems usually cannot use C language to write complex algorithms, and personal computer control systems are large in size and high in cost, while single-chip microcomputer circuit boards can meet these requirements. How to design a single-chip microcomputer circuit board to control the four-story elevator model is a difficult point. With such a control system, it is easy to write control algorithms based on the mechanical and circuit conditions.
[0003] Therefore, how to design a single-chip microcomputer control circuit based on this four-story elevator model, simplify the wiring, and be able to monitor the operating status of the elevator model in real time and control the operation of the elevator model is a problem that technical personnel in this field urgently need to solve. Summary of the invention
[0004] In view of this, the present invention provides a control circuit based on a four-story elevator model, which realizes signal detection and control of the four-story elevator model; it can output an indication of the program running speed to the outside, and can simplify the multi-machine communication wiring, saving the number of serial ports of the observer.
[0005] In order to achieve the above object, the present invention adopts the following technical solution:
[0006] A control circuit based on a four-story elevator model, comprising a single-chip microcomputer circuit and a signal conversion circuit;
[0007] The signal conversion circuit is used to receive the elevator detection signal and send it to the single-chip microcomputer circuit after level conversion, and receive the single-chip microcomputer control signal and send it to the four-story elevator model after conversion;
[0008] The single chip microcomputer circuit is used for receiving the level signal converted by the signal conversion circuit and sending a control signal to the signal conversion circuit.
[0009] Furthermore, the main control chip of the single-chip microcomputer circuit is an STM32F103RBT6 chip, wherein an 8MHz crystal oscillator X1 is arranged between pin 3 and pin 4 of the STM32F103RBT6 chip, for providing a stable main frequency of 8MHz for the STM32F103RBT6 chip.
[0010] Furthermore, the STM32F103RBT6 chip also includes a frequency output pin J2, and the frequency output pin J2 is used to externally detect the running speed of the elevator control program.
[0011] Furthermore, the STM32F103RBT6 chip also includes a logic level serial communication pin J5 for establishing external communication. The J5 pin can realize multi-machine communication, and is used as a slave port. The J5 of multiple STM32F103RBT6 chips are connected together to communicate with the external master logic level serial port, and the observation and control of multiple four-story elevator models are realized through the external master logic level serial port.
[0012] Furthermore, the signal conversion circuit includes an elevator end pin interface and a logic level conversion circuit, and the logic level conversion circuit includes multiple 74HC245 chips; the elevator end pin interface performs logic level conversion through the multiple 74HC245 chips; the 74HC245 chip is used to improve the load capacity, improve the anti-interference ability and increase the length of the elevator interface cable.
[0013] Furthermore, the signal conversion circuit also includes a power supply part, and a diode is provided on the power supply part to avoid supplying power simultaneously with the single-chip microcomputer circuit and to prevent the positive and negative poles of the power supply from being connected in reverse.
[0014] Furthermore, the signal conversion circuit also includes a hole interface for the single-chip computer board, which is used to plug in the single-chip computer circuit.
[0015] Furthermore, the reset circuit of the single-chip microcomputer circuit includes a reset switch for restarting when a program fails to run.
[0016] Furthermore, the elevator end pin interface includes a signal input end and a signal output end, the input signal end is used to receive a four-story elevator model signal; the output signal is used to output the control signal to the four-story elevator model; the signal output end has a pull-down resistor, which is used to output a low level to the four-story elevator model when the single-chip microcomputer circuit is not plugged in or the single-chip microcomputer circuit program is not started and running, so as to prevent the elevator model from malfunctioning.
[0017] It can be seen from the above technical scheme that, compared with the prior art, the present invention discloses a control circuit based on a four-story elevator model, which realizes signal detection and control of the four-story elevator model; the STM32F103RBT6 circuit board has a frequency output pin, which can be used to externally detect the running speed of the elevator control program; the control program can flip the external output level every time it runs a cycle, and the speed of the program running can be measured by detecting the frequency of this pin; the STM32F103RBT6 circuit board adopts an 8MHz crystal oscillator, thereby obtaining a stable and reliable operating main frequency; the logic level serial communication interfaces of multiple STM32F103 control boards can be connected together as slave ports and connected together with a main logic level serial communication interface for external observation, so that the external main logic level serial communication interface can monitor the working status of all control boards of the four-story elevator model, simplifying the communication wiring and saving the number of observation serial ports; the design of the printed circuit board component of 74HC245 is compatible with chips of both wide body and narrow body sizes. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0019] Figure 1 The accompanying drawing is a schematic diagram of the structure of a control circuit based on a four-story elevator model provided by the present invention;
[0020] Figure 2 The accompanying drawing is a schematic diagram of the core circuit structure of the single-chip microcomputer circuit board of the present invention;
[0021] Figure 3 The accompanying drawing is a schematic diagram of connecting multiple slave serial communication interfaces in the present invention with an external master serial communication interface;
[0022] Figure 4 The accompanying drawing is a schematic diagram of the elevator end pin socket and the tri-state drive chip portion of the signal conversion board of the present invention;
[0023] Figure 5 The accompanying drawing is a schematic diagram of the hole socket definition of the signal conversion circuit in which the single-chip circuit and the signal conversion circuit are connected in the present invention, and the pin socket definition of the single-chip circuit is similar to this;
[0024] Figure 6 The accompanying drawing is a schematic diagram of the input and output interface definition of the four-story elevator model used in the present invention. DETAILED DESCRIPTION
[0025] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0026] The embodiment of the present invention discloses a control circuit based on a four-story elevator model, including a single-chip microcomputer circuit and a signal conversion circuit;
[0027] The signal conversion circuit is used to receive the elevator detection signal and send it to the single-chip microcomputer circuit after performing logic level conversion, and receive the single-chip microcomputer control signal and send it to the four-story elevator model after performing conversion;
[0028] The single chip microcomputer circuit is used for receiving the level signal converted by the signal conversion circuit and sending the control signal to the signal conversion circuit.
[0029] In order to further implement the above technical solution, the main control chip of the single-chip microcomputer circuit is the STM32F103RBT6 chip, wherein an 8MHz crystal oscillator X1 is arranged between pin 3 and pin 4 of the STM32F103RBT6 chip to provide a stable main frequency of 8MHz for the STM32F103RBT6 chip.
[0030] In order to further implement the above technical solution, the STM32F103RBT6 chip also includes a frequency output pin J2 for externally detecting the running speed of the elevator control program.
[0031] In order to further implement the above technical solution, the STM32F103RBT6 chip also includes a logic level serial communication pin J5 for establishing external communication, which can realize both one-to-one communication and one-to-many communication.
[0032] Combine the following Figure 2 and Figure 3 Further description of the main control chip in the present invention:
[0033] In the STM32F103RBT6 circuit board, U1 is powered by a 3.3V power supply for the STM32F103RBT6 chip. In the STM32F103RBT6 chip, pin 3 is also grounded through a 30pF capacitor C29, and pin 4 is grounded through a 30pF capacitor C28;
[0034] U2 is a reset chip, which is used to provide a reliable low-level power-on reset signal to the microcontroller. The reset chip is powered by a 3.3V power supply. The output end of the reset chip is connected to pin 7 of the STM32F103RBT6 chip through a 10R resistor R1.
[0035] U3 is a LM1117-3.3V power regulator chip, its input voltage is 5V, and its output voltage is 3.3V. Both the input and output ends need capacitors connected to the ground.
[0036] LED D4 is used to monitor whether the power supply is supplied. The 3.3V power supply is connected to LED D4 through 1 kilo-ohm resistor R3. When the power supply is supplied, LED D4 is on; when the power supply is not supplied, LED D4 is off. D3 can be set to light up and off once per second during programming, which can be used to observe whether the microcontroller program is started and running. The 3.3V power supply is connected to pin 21 of STM32F103RBT6 through 1 kilo-ohm resistor R2 and LED D3.
[0037] The J1 pin is used to download the program in SWD mode. The J2 pin provides an external program running speed indication. It can be set during programming so that the output level of the second pin of this pin flips once for each program cycle. If an external frequency meter is connected, the program running speed can be detected. The J2 pin is connected to the PC13 pin of the STM32F103RBT6 chip. The J6 connector is used to connect an external 5V DC power supply.
[0038] The J5 pin can realize multi-machine communication. It is used as a slave port. The J5 of multiple STM32F103RBT6 circuit boards are connected together to communicate with an external master logic level serial port to realize the observation and control of multiple four-story elevator models. The specific connection method is as follows Figure 3 , wherein A.J5 and B.J5 are serial communication pins on two different STM32F103RBT6 circuit boards, the two circuit boards are respectively recorded as A board and B board, M.J5 is the main serial communication interface; the receiving pin of the main serial communication interface is connected with a 100 kilo-ohm pull-up resistor; when the sending pin does not send data, it is at a high level; if the serial port sending pin of a control board such as A board outputs a low level to the outside, through the diode, the main logic level serial port receiving end becomes a low level, and the diode connected to the sending pin of other control boards such as B board is not turned on, thereby protecting its output pin. Through time-sharing communication, the main logic level serial port can communicate with any control board. If the A and B serial port sending pins output a high level, the main logic level serial port receiving pin also becomes a high level through the pull-up resistor. Through the present invention, the number of main logic level communication interfaces can be effectively saved.
[0039] In order to further implement the above technical scheme, the signal conversion circuit includes an elevator end pin interface and a logic level conversion circuit. The elevator end pin interface is connected to the input and output interface of the four-story elevator model signal through a multi-core cable; the logic level conversion circuit uses multiple 74HC245 three-state driver chips, which have a fast response speed, can improve the output load capacity, enhance the anti-noise interference ability, and increase the length of the elevator interface cable.
[0040] In this embodiment, the signal conversion circuit further includes a control port interface for plugging the single chip computer board onto the signal conversion circuit board;
[0041] Among them, the control end pin interface is integrated on the STM32F103RBT6 circuit board, and the microcontroller circuit and the signal conversion circuit share a common ground; the microcontroller circuit can be connected to the power supply through the control end pin interface to power the entire circuit; it can also be connected to the power supply through the internal J6 power interface to power the signal conversion board; in order to avoid the J6 interface of the microcontroller circuit board and the J4 interface of the signal conversion circuit board being powered at the same time, a diode is provided on the power supply part of the signal conversion circuit board, and this diode can also prevent the positive and negative poles of the power supply of the J4 interface from being connected in reverse.
[0042] The signal conversion circuit expands a USART1 with PA9 and PA10 pins as the second serial communication port, and an indicator light is made on the PA10 pin to display the communication status. A reset switch is welded on the signal conversion circuit. When the program encounters a problem, pressing the reset switch will restart the program.
[0043] In order to further implement the above technical solution, the elevator end pin interface includes an input signal and an output signal, the input signal is used to receive the elevator signal; the output signal is used to control the four-story elevator model;
[0044] The plurality of 74HC245 three-state driver chips include a first type 74HC245 three-state driver chip for receiving elevator signals and a second type 74HC245 three-state driver chip for sending control signals.
[0045] The specific connection method of the first type 74HC245 three-state driver chip includes: the signal input pin of the elevator end pin interface is connected to the input pin of the 74HC245 chip, and the output pin of the 74HC245 chip is used to connect the input pin of the STM32F103RBT6 circuit board.
[0046] The specific connection method of the second type 74HC245 three-state driver chip includes: the output pin of the STM32F103RBT6 circuit board is connected to the input pin of the second type 74HC245 chip, and the output pin of the second type 74HC245 chip is connected to the output pin of the elevator end pin interface.
[0047] Combine the following Figure 4 , Figure 5 and Figure 6 The present invention is further described:
[0048] Figure 4 J3 in the figure is the elevator pin interface, and its pin distribution is similar to Figure 6 The elevator pin interface in the figure corresponds to that in the figure; U1, U2, U3 and U4 are all 74HC245 three-state driver chips, and the three-state driver chip and the elevator pin interface are powered by a 5V power supply. They are used to convert the logic level signal under the 3.3V power supply into the logic level signal under the 5V power supply, which improves the load capacity, enhances the output, improves the anti-interference ability, and increases the length of the elevator interface cable. After actual measurement, the 0.5-meter 40-core cable connecting the elevator and the signal conversion board can work normally. Among them, the resistors R6, R7, R8, R9, R18, R19, R20, R4, R12, R13, R16, R14, and R15 in the peripheral circuits of chip U3 and chip U4 are pull-down resistors, which are used to provide a low level. If the STM32F103RBT6 circuit board is not plugged in, or the single-chip microcomputer is not started, the four-story elevator model outputs a low level to ensure safety, the motor does not start, and the elevator model is prevented from malfunctioning. D3 is used to observe the receiving status of communication serial port 1, and D5 is used to observe the sending status; J4 is used to connect to the 5V DC power supply. If the power supply is not connected here, you can also use J6 in the STM32F103RBT6 circuit board to connect to the power supply.
[0049] Figure 5 J1 and J2 are the hole socket definition interface of the signal conversion circuit that connects the microcontroller circuit and the signal conversion circuit. There is a pin interface with the same structure as J1 and J2 in the STM32F103RBT6 circuit board. By plugging it with J1 and J2, the pin electrical signal of the STM32F103RBT6 circuit board can be transmitted to the signal conversion circuit.
[0050] Figure 6This is the external interface definition of the four-story elevator model. The 1st and 2nd pins of the interface receive external input power and are used as the power supply of the internal optocoupler. They can be connected to a DC 5V power supply. The 3rd, 5th, 7th, and 9th pins of the interface are the "go to 1st, 2nd, 3rd, and 4th floors" touch switch status output pins in the car, respectively. The 11th pin of the interface is the upper touch switch status output of the first floor, the 13th and 15th pins are the upper and lower touch switch status outputs of the second floor, the 17th and 4th pins are the upper and lower touch switch status outputs of the third floor, respectively, and the 6th pin is the lower touch switch status output of the fourth floor. When the touch switch is pressed, it outputs a high level to the outside, and when the touch switch is popped up, it outputs a low level to the outside. Normally, the touch switch is in the pop-up state. The 8th, 10th, 12th, and 14th pins of the interface are the sensor outputs of the elevator car reaching the first, second, third, and fourth floors, respectively. When the car reaches the corresponding floor, the sensor outputs a high level, and when the car leaves this floor, the corresponding sensor outputs a low level. The 16th and 18th pins of the interface are the state outputs of the door opening and closing touch switches in the car. The 19th, 20th, 39th and 40th pins of the interface are the power ground inputs. The 23rd and 25th pins of the interface are the input controls of the up and down motors of the car. When the input signals are low-low, low-high, high-high and high-low respectively, the up and down motors of the car control the car to be stationary, down, up and stationary respectively. The 27th and 29th pins of the interface are the input controls of the door motor. When the input signals are low-low, low-high, high-high and high-low respectively, the door motor controls the elevator door to be stationary, closed, open and stationary respectively. The 31st, 33rd, 35th, 37th, 24th and 26th pins of the interface are the background lights of the switches of "1st floor up", "2nd floor up", "2nd floor down", "3rd floor up", "3rd floor down" and "4th floor down". When the external input is high level, the background light is on, and when the input is low level, the background light is off. The 28th and 30th pins of the interface are the state outputs of the door opening position sensor and the door closing position sensor, respectively. When the door is in the open state, the door opening position sensor outputs a high level, and the door closing position sensor outputs a low level; when the door is in the closed state, the door opening position sensor outputs a low level, and the door closing position sensor outputs a high level. The 32nd, 34th, and 36th pins of the interface receive external high and low level combination signals to light up the eight-segment display of the floor display. For details, see Table 1.
[0051] Table 1. Relationship between the display content of the eight-segment display and the control signal
[0052]
[0053]
[0054] After the STM32F103 control board is plugged into the conversion board, it can be connected to the 40-pin interface of the four-story elevator model through a 40-pin connector cable to enable the STM32F103RBT6 microcontroller to detect the signal of the four-story elevator model and control the operation of the elevator. The corresponding relationship between the GPIO port of the microcontroller and the pins of the functional components of the elevator is shown in Table 2.
[0055] Table 2. Functions of each pin of STM32F103RBT6 chip
[0056]
[0057]
[0058]
[0059] The present invention realizes signal detection and control of a four-story elevator based on an STM32F103RBT6 chip.
[0060] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0061] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A control circuit based on a four-story elevator model, characterized in that: Including single chip microcomputer circuit and signal conversion circuit; The signal conversion circuit is used to receive the elevator detection signal and send it to the single-chip microcomputer circuit after level conversion, and receive the single-chip microcomputer control signal and send it to the four-story elevator model after conversion; The signal conversion circuit includes an elevator terminal pin interface and a logic level conversion circuit, and the logic level conversion circuit includes a plurality of 74HC245 chips; the elevator terminal pin interface performs logic level conversion through the plurality of 74HC245 chips; The plurality of 74HC245 three-state driver chips include a first type 74HC245 three-state driver chip for receiving elevator signals and a second type 74HC245 three-state driver chip for sending control signals; The single chip circuit is used to receive the level signal converted by the signal conversion circuit and send a control signal to the signal conversion circuit; The main control chip of the single-chip microcomputer circuit is a STM32F103RBT6 chip; The STM32F103RBT6 chip includes a logic level serial communication pin J5; J5 of multiple STM32F103RBT6 circuit boards are connected together as slave ports and communicate with an external master logic level serial port, and observation and control of multiple four-story elevator models are achieved through the external master logic level serial port, wherein the sending pin of the slave port has a D5 diode, and the receiving pin of the master logic level serial port has a resistor R8.
2. A control circuit based on a four-story elevator model according to claim 1, characterized in that: An 8 MHz crystal oscillator X1 is arranged between pin 3 and pin 4 of the STM32F103RBT6 chip, and the crystal oscillator X1 is used to provide a stable main frequency of 8 MHz for the STM32F103RBT6 chip.
3. A control circuit based on a four-story elevator model according to claim 2, characterized in that: The STM32F103RBT6 chip also includes a frequency output pin J2, and the frequency output pin J2 is used to externally detect the running speed of the elevator control program.
4. A control circuit based on a four-story elevator model according to claim 1, characterized in that: The signal conversion circuit also includes a reset circuit, which is connected to the single-chip microcomputer circuit and is used for resetting and restarting when a program fails to run.
5. A control circuit based on a four-story elevator model according to claim 4, characterized in that: The signal conversion circuit also includes a control terminal hole interface, which is used to adapt to the pin interface of the single-chip circuit for easy plug-in.
6. A control circuit based on a four-story elevator model according to claim 5, characterized in that: The signal conversion circuit also includes a power supply circuit, and the power supply circuit includes a diode. The diode is used to avoid supplying power simultaneously with the single-chip microcomputer circuit and to prevent the positive and negative poles of the power supply from being connected in reverse.
7. The control circuit based on the four-story elevator model according to claim 1 is characterized in that: The elevator end pin interface includes a signal input end and a signal output end, the signal input end is used to receive the four-story elevator model signal; the signal output end is used to output the control signal to the four-story elevator model; the signal output end has a pull-down resistor, which is used to output a low level to the four-story elevator model when the single-chip microcomputer circuit is not plugged in or the single-chip microcomputer circuit program is not started and running, so as to prevent the elevator model from malfunctioning.