Electronic design automation technology is an emerging technology in the late 19th century and early 21st century. It has demonstrated powerful functions and advantages in digital circuit design and daily control systems . With the rapid development of EDA technology, electronic system design technology and tools have undergone profound changes. The emergence of large-scale programmable logic devices FPGA has brought many conveniences to designers. HDL (Hardware Description Language) developed with programmable logic devices ( PLD ). It is mainly used to describe the structure, behavior, function and interface of digital systems . It is one of the key technologies of electronic design automation (EDA). It usually adopts a top-down design method, that is, designing from the overall requirements of the system.
At present, some design articles on elevator control systems using FPGA are seen in journals and magazines. In these articles, controller algorithms for any number of floors are not seen, and controller algorithms for any number of floors are the key to ensuring the practicality and applicability of the controller. Therefore, this article attempts to use EDA technology to design an N-layer elevator control system. The specific idea is: first give the elevator controller algorithm, and then implement and verify it on the hardware platform.
1. Elevator control system requirements
The elevator control system usually includes the functions shown in Figure 1: elevator rise, fall, stop; elevator door opening and closing; request signal display, floor display; overload and fault alarm. Among them, overload and fault alarm require the use of sensors . This control is relatively simple, so this article will not discuss it in detail.
This article focuses on controller algorithms involving other functions.
For the elevator in the first teaching building of Shenzhen Information Vocational and Technical College, the elevator controller implements the following functions:
(1) Each floor of the elevator has a corresponding STOP button ; each floor except the top floor has an UP button, and each floor except the bottom floor has a DOWN button; when the UP button is pressed, it means that someone on that floor wants to go to the upper floor; when the DOWN button is pressed, it means that someone on that floor wants to go to the lower floor; when the STOP button is pressed, it means that someone on that floor wants to leave the elevator. For the STOP, UP, and DOWN buttons, when they are pressed, the corresponding indicator lights up, and the indicator lights will not go out until the request is met;
(2) During the operation of the elevator, the corresponding indicator lights should be on when the elevator is rising, descending or stopping, and the floor number should be displayed at any time;
(3) During the elevator's ascent, the upward demand is met first. For the demand for lower floors or downwards, the demand will be recorded during the elevator's ascent, and then met during the elevator's descent after all the upward demands have been met;
(4) When the elevator is descending, the downward demand is met first. For the demand for higher floors or upwards, the demand will be recorded during the elevator's descent, and then satisfied when the elevator rises again after all the downward demands have been met.
The basic requirement of the elevator controller designed in this paper is to meet the above requirements for actual elevator operation.
2 Elevator Control System Implementation
2.1 Overall solution design
The overall design consists of four modules, and the functions of each module are described as follows:
a. Frequency divider Module: This module realizes the function of arbitrary clock frequency input and arbitrary frequency output, and the output frequency accuracy is 1Hz; the module input is the system working clock clk, the system reset signal rst, and the output is the divided clock. The module definition is as follows:
module freq_div(reset,clk,keyclk,liftclk);
In the module, keyclk is the key processing clock, and liftclk is the elevator operation control clock.
b. Button request module: This module records and processes the pressing of the up, down and stop buttons on each floor. The module ports are as follows:
module key_req(
reset,keyclk,
stop, //Elevator interior buttons, each digit represents a floor. When the corresponding position is 1, it indicates that the button indicating the floor is pressed;
up, //Up buttons on each floor (none on the top floor), each bit represents a floor, when the corresponding position is 1, it means that the up button on that floor is pressed.
down, //Down button on each floor (none on the bottom floor), each bit represents a floor, when the corresponding bit is 1, it means the down button on that floor is pressed;
stop_r, //Elevator floor button information
up_r, //Up button information for each floor outside the elevator
down_r //Down button information for each floor outside the elevator
);
c. Elevator controller module and indicator module: This module controls the elevator operation and sets indicator lights according to the pressing of buttons on each floor. The module definition is as follows:
module Lift_c ON trol(
keyclk, //Process key clock
liftclk, //Elevator operation control clock
reset, //Elevator reset button, the elevator stops on the first floor after reset;
stop_r, //Elevator floor button information
up_r, //Up button information for each floor outside the elevator
down_r, //Down button information for each floor outside the elevator
position, //Current floor position, each digit represents a floor. When the corresponding position is 1, it means the elevator is running to that floor;
stoplight, //Internal layers Button indicator lights , each digit represents a layer, when the corresponding position is 1, it indicates that the indicator light of the layer is on;
uplight, //Except the top layer, each layer’s external button indicator light, each digit represents a layer. When the corresponding position is 1, it means the up light of the layer is on;
downlight, //Except the first floor, each floor's external button indicator light, each digit represents a floor, when the corresponding position is 1, it means the down indicator light of the floor is on;
doorlight); // used as door opening indicator light, 1 means door is open, 0 means door is closed
d. Display module : This module is used to decode and display the current elevator floor. The module definition is as follows:
module Display(liftclk,position,disp);
2.2 Module design and implementation
For the four modules of frequency divider module, key request module, elevator controller module, indication module and display module, the elevator controller module and indication module involve the processing of various elevator operation conditions, and their algorithms are the most complex and prone to errors. This paper uses a finite state machine to design this module, and the specific algorithm is described as follows.
The elevator operation is defined as 7 states, and the specific states are defined as follows:
S0: onfloor1, indicating on floor 1;
S1: dooropen_up, during the ascent, the elevator door opens for 5 seconds;
S2: doorclose_up, during the ascent, the elevator door closes;
S3: up_lift, indicating that the elevator goes up one floor;
S4: dooropen_down, during the descent, the elevator door opens for 5 seconds;
S5: doorclose_down, the elevator door closes during descent;
S6: down_lift, indicating that the elevator goes down one floor.
Each state is transformed under certain conditions. The specific state transformation is shown in Figure 2.
Figure 2 Elevator controller state transition diagram
Table 1 Elevator controller state transition conditions
In the above table, pos indicates the current floor, up[pos], down[pos], and stop[pos] indicate the status of the up, down, and stop buttons of the current floor, respectively.
Obviously, the above algorithm does not limit the number of floors, that is to say, the algorithm is suitable for elevator controllers on any floor.
2.3 Simulation Verification
Based on the above algorithm, this paper uses Verilog HDL language to implement a three-story elevator controller on FPGA. For implementation, the controller of a three-story elevator or a multi-story elevator is just different in the number of Verilog codes, and its algorithm is completely the algorithm proposed in this paper. This paper only implements a three-story elevator controller because the resources of the hardware development environment (including the number of buttons and indicator lights) only meet the verification of a three-story elevator controller.
The simulation waveform of the three-story elevator controller is shown in Figure 3.
Figure 3 Simulation waveform of three-story elevator controller
Simulation waveform description: The buttons inside and outside the elevator are pressed when their values change from 0 to 1. In the figure, the buttons inside and outside the elevators on each floor are pressed randomly.
It can be seen from the simulation waveform that the operation of the elevator meets the design requirements.
2.4 Hardware Verification
The design in this article has been pin -locked and downloaded to the hardware development environment, and has been tested to be completely correct.
The specific hardware development environment is the GW48-PK2 experimental development system.
CLK selects clk0 and the frequency can be selected as 256Hz.
Keys 1, 2, and 3 correspond to the buttons of each floor in the elevator; keys 4 and 5 correspond to the up buttons outside the elevator on the first and second floors; keys 6 and 7 correspond to the down buttons outside the elevator on the second and third floors; key 8 corresponds to the system reset button; lights 1, 2, and 3 indicate that the buttons of each floor in the elevator are pressed; lights 4 and 5 indicate that the up buttons outside the elevator on the first and second floors are pressed; lights 6 and 7 indicate that the down buttons outside the elevator on the second and third floors are pressed; light 8 indicates opening the door.
The floor the elevator is on is indicated by digital tube 1.
3 Conclusion
The elevator controller design in this paper combines the actual operation of the elevator in Shenzhen Information Vocational and Technical College, which is easy for students to understand and accept. It is a very good practical project for the teaching reform of combining work and study. In addition, the elevator controller algorithm proposed in this paper is suitable for any floor and has been verified in the FPGA development environment. It has strong adaptability and practicality.
Previous article:Design of multifunctional signal generator based on FPGA LPM
Next article:Implementation of FPGA in an Intelligent Pressure Sensor System
Recommended ReadingLatest update time:2024-11-16 23:52
- Popular Resources
- Popular amplifiers
- Analysis and Implementation of MAC Protocol for Wireless Sensor Networks (by Yang Zhijun, Xie Xianjie, and Ding Hongwei)
- MATLAB and FPGA implementation of wireless communication
- Intelligent computing systems (Chen Yunji, Li Ling, Li Wei, Guo Qi, Du Zidong)
- Summary of non-synthesizable statements in FPGA
- Huawei's Strategic Department Director Gai Gang: The cumulative installed base of open source Euler operating system exceeds 10 million sets
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- Sn-doped CuO nanostructure-based ethanol gas sensor for real-time drunk driving detection in vehicles
- Design considerations for automotive battery wiring harness
- Do you know all the various motors commonly used in automotive electronics?
- What are the functions of the Internet of Vehicles? What are the uses and benefits of the Internet of Vehicles?
- Power Inverter - A critical safety system for electric vehicles
- Analysis of the information security mechanism of AUTOSAR, the automotive embedded software framework
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
- GD32F305 CAN debugging failed
- [Xianji HPM6750 Review] Simple unboxing and data download
- Why do electrolytic capacitors explode? How to avoid it?
- Share a virtual oscilloscope HANTEK6022BE plug-in I wrote myself. If you have a HANTEK6022BE that is gathering dust, you can use it.
- What should be paid attention to in the amplifier design of RF circuit PCB
- [ufun learning] Practical Part 1: "PWM control of DC motor acceleration, deceleration, forward and reverse rotation"
- Practical Power Supply Circuit and Charging Circuit Atlas
- [RVB2601 Creative Application Development] Transplant U8g2 Graphics Library + LCD Weather Display
- Share some problems encountered when using CCS
- Usage of CC6678 Digital Signal Processor (DSP)