当前位置:网站首页>Proteus simulation design of four storey and eight storey elevator control system, 51 single chip microcomputer, with simulation and keil c code

Proteus simulation design of four storey and eight storey elevator control system, 51 single chip microcomputer, with simulation and keil c code

2022-04-23 14:24:00 Jiang Yuzhi

The resource acquisition , Please see the description at the end of the text ~

The design requirements

  1. The elevator is equipped with internal and external keys , Press any key , Elevator control system response ;
  2. The elevator floor and lifting status are controlled by nixie tube 、LED The lamp displays in real time ;
  3. It has the functions of emergency stop and audible and visual alarm , Protect the safety of passengers ;
  4. Use stepping motor to simulate elevator lifting , Turn clockwise into liters , Inverse time is descending ;
  5. When the elevator is empty , By default, it stays on the first floor ;

System Overview

This system uses 51 Single chip microcomputer as the control core , Read the internal and external operation keys of the elevator in real time , Respond to the ride request in time . Nixie tube and LED Indicator light , It respectively represents the current elevator floor and lifting status ; The stepping motor simulates the running process of the elevator ( The motor rotates clockwise to L , Anticlockwise is down ).

meanwhile , The system has the functions of elevator emergency stop and alarm . During elevator operation , Press the alarm key , The warning light flashes , The buzzer beeps , The elevator stops running . After long pressing the start key , Clear the alarm , The elevator resumed operation ;

Press the emergency stop button , Elevator emergency stop , The nixie tube displays the current emergency stop floor , The up light and down light are off , Indicates that the elevator is not available .

It should be noted that , The start key is used to simulate elevator door closing , Press the floor you want to go to inside the elevator , Press the start button again , The elevator will start running .

The whole system is constructed as follows :
 Insert picture description here
Simulation circuit diagram
 Insert picture description here
 Insert picture description here
Simulation analysis
Double click the MCU , load C In the program folder elevator.hex, Run the simulation , give the result as follows . The elevator stops at 1 floor , The up light is on , Waiting for passengers to take ;
 Initial state of elevator , dock 1 Building location
hypothesis 4 The resident of the building is going to 2 floor ,4 Floor residents press... Outside the elevator “ Next ” After pressing the key , The elevator comes from 1 The building began to rise , The up light is on , The stepping motor rotates clockwise , The nixie tube displays the floors in turn ; The following figure shows the elevator rising , arrive 3 Building location ;
 When the elevator rises , arrive 3 Building location
arrive 4 Behind the building , The stepping motor stops rotating , The nixie tube displays numbers 4, At the same time, the yellow down light is on , Indicates that the elevator will begin to descend ;
 Insert picture description here
4 Floor residents enter the elevator , Press the key inside the elevator 2F after , Press the start button again ( Simulate elevator door closing ), The elevator runs , The stepping motor rotates counterclockwise ; arrive 2 Behind the building , As shown below ;
 Insert picture description here
Alarm and emergency stop
At any time when the elevator is running , Press the alarm button inside the elevator , Red LED The warning lamp is on , The buzzer beeps , The elevator stops at the current floor , The stepper motor also stops rotating ; Press and hold the start key , Alarm cleared , The elevator resumed operation ; The following figure shows the elevator in 2 Floor position alarm .
 Insert picture description here
When something unexpected happens , After pressing the emergency stop button , The elevator stops immediately , The nixie tube displays the current emergency stop floor , The up light or down light goes out , Indicates that the elevator is not available at this time , At the same time, the stepping motor stops ; At this time, the emergency stop can be released only by re running the system ; The following figure shows the elevator in 3 Emergency stop location ;
 Insert picture description here
part C Code

#include <REG52.H>
#include <INTRINS.H>

unsigned char ucMotorDrvPuls; // Initial value when the motor is running 
unsigned char FORREV=1; //1 Indicates the uplink ,0 It means down 
unsigned char STOPCUR=0;//1 The elevator stops at the current floor ,0 No stay 
unsigned char CURFLR=1; // Current floor 
unsigned char count=0;  // Accumulated to COUNT That is, it has run one layer 

#define UCTIMES 8 // Set the motor speed 
#define OUTPUT P2 // Motor drive signal port 
#define COUNT 8 // Every cycle of the motor 8 Times means that the elevator passes through one floor 

sbit UP1=P3^4;
sbit DOWN2=P3^3;
sbit UP2=P3^2;
sbit DOWN3=P3^1;
sbit UP3=P3^0;
sbit DOWN4=P1^7;
sbit FLOOR1=P1^0;
sbit FLOOR2=P1^1;
sbit FLOOR3=P1^2;
sbit FLOOR4=P1^3;
sbit START=P1^4;
sbit STOP=P1^5;
sbit ALARM=P1^6;

// Alarm bit 
sbit alarmBit=P0^4;
sbit upLight=P0^5;
sbit downLight=P0^6;

void time(unsigned int ucMs);// Delay unit :ms
void outPress();// Press the elevator button 
unsigned char inPress();// Press the floor button in the elevator 
unsigned char elevator();// Reach a certain level and return 1, Otherwise return to 0
void storeUP(unsigned char);// Store all current uplink requests 
void storeDOWN(unsigned char);// Store all current downlink requests 

// The time delay function 
void time(unsigned int ucMs);

// Initialize all lights 
void initLights(void);

// Set the current floor 
void setFloor(int floor);

// Set up the upward running light of the elevator 
void setUpLight();

// Set the elevator downward running light 
void setDownLight();

// Set the elevator stop light 
void setStopLight();

// Set up the upward running light of the elevator 
void setAlarmLight();

// Set elevator alarm light and horn 
void setAlarmLight();

// Turn off the elevator alarm light and horn 
void offAlarmLight();


// Alarm switch 
int alarmSwitch=1;

unsigned char UP_req[5]={
    0,0,0,0,0}; // Uplink request 
unsigned char DOWN_req[5]={
    0,0,0,0,0}; // Downlink request 

// Motor positioning 
void position(void)
{
    
  OUTPUT=0x01|(P2&0xf0);time(200);
  OUTPUT=0x02|(P2&0xf0);time(200);
  OUTPUT=0x04|(P2&0xf0);time(200);
  OUTPUT=0x08|(P2&0xf0);time(200);
  ucMotorDrvPuls=0x11;
  OUTPUT=0x01|(P2&0xf0);	
  
}

/****************************************/
/*  The main function  */
/****************************************/
void main(void)
{
     
  time(100);
  initLights();
  position();// Motor positioning 
  ucMotorDrvPuls=0x11;
  OUTPUT=0x00|(P2&0xf0);// Motor stop  
  setFloor(CURFLR);
  setUpLight();
  time(100);
  
  while(1)// Main circulation 
  {
    
	  outPress();// Press the elevator button 
	  while(STOPCUR==1)// The elevator is on the current floor , The elevator doesn't move , You can continue to accept requests 
	  {
    
	    outPress();
	    inPress();
	  }  

	  if(inPress())// Press the floor button in the elevator 
	  {
    
	    while(START)// Wait for the start button to be pressed , The elevator doesn't move , You can continue to accept requests 
	    {
    
	      outPress();
	      inPress();
	    }
	  }

	  while(1)// Motor running cycle 
	  {
    
	    if(UP_req[1]==0&&UP_req[2]==0&&UP_req[3]==0&&
		DOWN_req[2]==0&&DOWN_req[3]==0&&DOWN_req[4]==0) 
		{
    
		  break;// No request , Jump out of the motor operation cycle , The elevator doesn't move 
		}
		  
	    if(FORREV)// The upside  
	    {
     
		  setUpLight();// The up light is on 

		  if(STOPCUR==1){
    break;}//

		  if(elevator())// Go up to a certain level 
	      {
    
			if(CURFLR==4) {
    setDownLight();break;}// Get to the fourth floor 
	      }
	      OUTPUT=(ucMotorDrvPuls&0x0f)|(P2&0xf0);
		  ucMotorDrvPuls=_crol_(ucMotorDrvPuls,1);
	    }
	    if(!FORREV)// The downside 
	    {
    
		  setDownLight();// The down light is on 
;
		  if(STOPCUR==1){
    break;}

		  if(elevator())// Down to a certain level 
	      {
    
			if(CURFLR==1) {
    setUpLight();break;}// Get to the first floor 
	      }
	      OUTPUT=(ucMotorDrvPuls&0x0f)|(P2&0xf0);
		  ucMotorDrvPuls=_cror_(ucMotorDrvPuls,1);
	    }	
	
	    outPress();// Press the elevator button 
	    //if(inPress())// Press the floor button in the elevator 
		//{
    
		 // while(START)// Wait for the start button to be pressed 
		  //{
    
	      // outPress();
	        inPress();// When the elevator is running , Press the internal button , No need to press the start button 
	     // }
		//}

	    time(380-UCTIMES*16);

	  }//end while- Motor running cycle 
	
	OUTPUT=0x00|(P2&0xf0);// Motor stop , Press the start button to start when there is a request 

  }//end while- Main circulation  
}

8 Elevator control system design
 Insert picture description here
 Insert picture description here
8 Simulation analysis of floor elevator
Press the key outside the elevator 8F, simulation 8 Residents on the first floor need an elevator ,8F LED The indicator light is on , Nixie tube from 1 To 8 Show... In turn , The elevator up arrow lights up ; The following figure shows the elevator ascending process .
 Insert picture description here
The elevator arrives 8 Behind the building , The up arrow flashes and goes out , The prompt tone beeps twice , Indicates that the elevator arrives at 8 floor ;
 Insert picture description here
hypothesis 8 The resident of the building is going to 5 floor , Press the key inside the elevator 5F,5F LED The indicator light is on , Nixie tube from 8 To 5 Show... In turn , Simulate elevator descending , At the same time, the down arrow lights up ; The following figure shows the elevator passing through 6 floor ;
 Insert picture description here
The elevator arrives 5 Behind the building ,5F LED The light goes out , Again , The down arrow flashes and goes out , The prompt tone beeps twice , Indicates that the elevator arrives at 5 floor ;
 Insert picture description here
There are resources

(1) Four storey elevator Proteus Simulation file ;

(2)C Program ;

(3) Reference material ;

(4) System diagram ;

(5) Design 2: Eight storey elevator control ;

Resource screenshot
 Insert picture description here
 Insert picture description here
 Insert picture description here
8 Elevator design resources
 Insert picture description here
 Insert picture description here
 Insert picture description here
Get four layers / Design of control system of eight storey elevator ,Proteus Simulation 、C Programming resources , WeChat search for my official account : Jiaoyuan Xiaozhi .

版权声明
本文为[Jiang Yuzhi]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231412472141.html