ELE2303 Embedded Systems Design Assignment 1 – Lift Controller – Stage 1
ELE2303 Embedded Programs Design Project 1 – Elevate Controller - Stage 1 Description Marks out of Wtg (%) Due date Embedded System Design – Stage 1 200 20 23/04/18 Objective This evaluation is meant to judge the coed’s functionality in configuring a microcontroller, designing easy interface and writing C code to function these interfaces. Grading of this evaluation This process can be assessed in opposition to the course goals 1, 2, three, four, 6 and seven. This evaluation can be graded (F, C, B, A, HD) utilizing a guidelines marking scheme in opposition to standards comparable to: the suitable choice and use of microcomputer ; the design of I/O to satisfy a specification; implementation of software program to satisfy a specification; high quality of documentation together with organisation of concepts and format; spelling, grammar and punctuation. Be aware - this course is a communications benchmark course; therefore marks can be awarded for the standard of documentation. Project Necessities This evaluation requires college students to satisfy the necessities the specification under. Choose an appropriate microcontroller from the PIC18 household, design easy interface , write and take a look at some C packages (subroutines) to function the interface after which doc the and software program as a proposed design. Software program is to be written in C utilizing the MPLABX IDE. You have to create a undertaking in your program which can embody a number of C supply information. The testing is to be accomplished utilizing the PICSimLab simulator – NO EXCEPTIONS. There may be NO requirement to assemble any , or format a PCB for this task. The circuit design for the could also be drawn utilizing electronics CAD software program, OR neatly hand-drawn and scanned, for inclusion within the documentation. The interface for the applying could be efficiently examined on the PICSimLab simulator. A Zoom recorded demonstration of the software program under-going testing have to be included with the task submission. Every scholar is required to submit: 1. A report in Microsoft WORD format (with tracked modifications enabled) which incorporates: • a short introduction (150 – 200 phrases) outlining the design necessities primarily based on the specification. • the design (300 – 400 phrases) briefly explaining the circuit design and the way it meets the specification. Present any calculations you make to verify the scaling and determination of analog enter values. • a single web page circuit diagram of the proposed . This can be A4 or A3 in measurement. This diagram could also be offered in a separate file (presumably a picture file) whether it is extra handy. You have to specify the digital parts (eg. IC’s) and the values of any discrete parts used (ie. resistors, capacitors, crystals). Producer half numbers should not required. • the software program interface routines (600 – 700 phrases) briefly explaining the subroutines and the way they function and meet the necessities. • a short evaluation of the testing of the software program (200 – 300 phrases) explaining what's working and isn’t working. • A Zoom recording exhibiting the compilation in MPLABX and testing of the performance of this system on the PICSimLab simulator, with commentary by the coed. • copy of the C supply code exhibiting all of the subroutines. (as an appendix to the report) The doc must be formatted as a report and should embody: • a title web page exhibiting the coed identify and quantity • numbered sections with applicable sub-headings • grammatically appropriate English, full sentences in paragraphs • clearly drawn diagrams together with determine numbers and captions (could also be a separate file) • the task identify and web page quantity within the header of the doc • the coed's identify and scholar quantity within the footer of the doc 2. A replica of the undertaking listing (instance myproject.X ) saved as a ZIP file. Be sure all of the information within the listing are included. Notes on tutorial integrity That is a person evaluation. College students should full and submit their very own work and documentation. College students might talk about ideas and strategies of implementation with others, however it's forbidden to share circuits and supply code, copy one other scholar’s work or submit work ready for you by one other particular person. Pupil might talk about the right way to remedy the issue, however should give you their very own work. Circuits or packages ought to NOT be copied (ie. scanned or minimize and paste) from the web or different sources. For this kind of evaluation two or extra college students submitting the identical circuit or program could also be thought of as plagiarism or collusion. There are additionally a number of ways in which every a part of a program could also be carried out, so two ‘independently’ written packages are extremely unlikely to be equivalent. “Working collectively on the task” mustn't lead to precisely the identical design or program. Re-using task work from previous years can be not allowed and simply recognized. College students are additionally warned that paying another person to do your task is taken into account a critical breach of the tutorial integrity coverage. This too may be very simple to determine! College students suspected of getting colluded, copied one other’s work (with or with out permission) or suspected of getting paid a ghost author to organize their work can be required to obviously exhibit they've ready the work. Submission of the report with tracked modifications enabled is meant to assist defend the trustworthy scholar, so failing to observe this instruction will focus consideration in your submission. College students should put together their report in MS Phrase format with the monitor modifications function enabled. (If you're not sure how to do that – ASK NOW within the discussion board) The Specification 1. Define of the duty You've got been requested by your Senior Engineer to design a PIC18-based controller for a elevate design. You're to organize a design, write C capabilities or subroutines to interface with the , take a look at these routines on a simulator and put together a report detailing your proposed resolution for the Elevate Controller. The sequence of steps within the elevate’s operation are but to be totally outlined by the shopper, nevertheless the elevate’s electro-mechanical gear has been specified. So step one is to design the MCU and interface circuitry, write and take a look at the low-level code that appropriately operates the electro-mechanical gadgets which is able to monitor and management the elevate. Eg. winch, name and flooring buttons, place sensor, and door ajar sensor. The shopper has specified a PIC18-based controller is required, as they're aware of that household of MCU. The controller is to just accept enter from the buttons and sensors and be capable to management the operation of the elevate through relays. The interface to the elevate gear is described in Hardware Necessities. Stage 1 of the undertaking (this task) requires you to (a) design the circuit for a PIC18 microcontroller and the enter/output required to interface with the electromechanical gadgets specified within the Hardware Necessities and (b) write and take a look at a set of enter/output routines (in C) to function all interfaces in response to Software program Necessities. [ Stage 2 (assignment 2) will require you to write a state-based control program to operate the lift according to requirements. Some additional hardware and/or interface routines may also be required. ] 2. Hardware Necessities Microprocessor help circuitry • The circuit diagram for the Elevate Controller should embody the minimal parts essential to function a PIC18 processor at a clock pace of eight MHz. • A push button reset circuit IS required for the microcontroller. • Present the facility provide connections essential to energy the PIC processor utilizing a 5Volt energy provide. (However notice that the 5V energy provide itself just isn't required as a part of this design drawback.) Electro-mechanical Interface The elevate gear contains the elevate itself, the doorways, the winch, a place sensor, a door ajar sensor, four name buttons on three flooring and three in-lift flooring choose buttons. The element for interface to gear are proven in Determine 1 and is defined under. The abstract of interfaces required to the elevate controller are: • 2 winch management alerts UpDown and RunStop management the lift- Up(1) Down(zero), and Run(1) Cease(zero). • A door management sign OpenClose is used to open(1) or shut(zero) the elevate doorways. • An analog place sensor (PS) measures the vertical place of the elevate. 0m = 0V to six.4m = 5V. • An analog door ajar sensor (AJ) signifies if the doorways are ajar ( zero.5V) or correctly closed ( zero.5V). • The four name buttons (U1, U2, D2 and D3) enable passengers to name the elevate to their flooring. (Up solely on flooring 1, up and down on flooring 2, and down solely on flooring three) • three flooring choose buttons (F1, F2, F3) within the elevate enable passengers to pick out the ground they want to journey to. Determine 1: Elevate gear and interface particulars The detailed necessities of interfaces are: • The winch makes use of a 240 Volt 50 Hz AC motor, to which electrical energy is switched by two 24V relays; such that the UpDown sign controls the route as Up(1) relay is on, Down(zero) relay is off; and the RunStop sign runs the motor as Run(1) relay is on, Cease(zero) relay is off. The relays additionally present electrical isolation between the LCU and the elevate gear. Your design should embody appropriate interface circuitry to drive the coils of the 2 24V relays every requiring 100mA switching present within the coil. (Be aware that the 24V energy provide and the connections from the relay contacts to the winch should not a part of this design drawback.) • The door management sign OpenClose used to command the elevate doorways to open(1) or shut(zero). It's a digital logic sign which is enter to the door management unit instantly. No relay is required or isolation is required, however the sign should have a 0V reference connection. Be aware- the operation of the door just isn't instantaneous, so the state of the door have to be monitored by the door ajar sensor. • The elevate place sensor (PS) gives a zero – 5Volt analog sign indicating the place of the elevate over the nominal full scale vary of zero.zero to six.4m. Your design should be capable to decide the place the elevate by measuring this sign to a decision of not less than zero.0125 m for a variety of positions from zero.0m to six.375m. • The door ajar sensor (AJ) gives a zero – 5Volt analog sign indicating the quantity of closure of the elevate doorways, the place the doorways are thought of ajar when the sensor outputs a voltage zero.5V and correctly closed when the sensor outputs a voltage zero.5V. • The consumer interface (buttons) for the elevate are a set of seven active-low momentary push button switches – which permit the consumer to name and management the elevate. o four flooring name buttons are required labelled U1, D2, U2 and D3. o three management buttons are required labelled L1, L2, L3 A debounce circuit is required on every button enter. three. Software program Necessities The next interface routines have to be written. (Be aware – you're NOT allowed to make use of any library capabilities supplied with MPLABX XC8. Your routines should write/learn on to/from the PIC18 particular operate registers controlling the ports and the ADC.) Half 1. Write a C subroutine referred to as init_io to initialise all of the I/O ports you've gotten chosen in your design, to organize ALL inputs and outputs prepared for operation. Half 2. Write a C subroutine referred to as init_adc to initialise the ADC able to learn the place sensor and the door ajar sensors (as partially three and four). Half three. Write a C operate referred to as place which reads the ADC channel linked to the place sensor, calculates and returns the place of the elevate in metres as a floating level worth. Half four. Write a C operate referred to as ajar which reads the ADC channel linked to the door ajar sensor and returns an integer worth of 1 if the door is ajar and zero if the door is closed. Half 5. Write a C operate referred to as name to learn the standing of the four name buttons and returns a single byte (brief int) whose worth is zero if no button is pressed, 1 for the U1 button, 2 for the D2 button, three for the U2 button or four for the D3 button. Assume just one button is lively at any on the spot. Half 6. Write a C operate referred to as flooring to learn the standing of the three flooring buttons and return a single byte (brief int) whose worth is zero if no buttons is pressed, 1 if the F1 button, 2 for the F2 button, or three for the F3 button. Assume just one button is lively at any on the spot. Half 7. Write a C subroutine referred to as winch that accepts a parameter handed to the routine referred to as w, the place w = zero stops the winch, w = 1 drives the elevate up, and w = 2 drives the elevate down. This routine should management the output pins of the PIC18 you've gotten chosen to connect with the RunStop and UpDown alerts. Half eight. Write a C subroutine referred to as door that accepts a parameter handed to the routine referred to as d, the place d = 1 opens the elevate door and d = zero closes the elevate door. This routine should management the output pin of the PIC18 you've gotten chosen to connect with the OpenClose sign. Half 9. Write a essential C program which totally checks the performance of the interface routines above. (half 1 to eight) The primary program should initialise any variables used, initialise the IO ports and the ADC, enter an limitless essential loop, then inside that loop make a sequence of calls all of the routines specified above in some logical sequence, in order that their capabilities could be examined on the PICsimlab simulator. The performance checks should confirm every sensor enter and button press operates appropriately and take a look at the controls for the winch and door. To simplify your testing you need to contemplate aligning your alternative of IO ports and ADC channels to match the (buttons, relays and LEDs) offered on the PICsimlab simulator. Finish of specification In case you have any questions on the task publish them to the task dialogue discussion board so a standard reply is out there to all college students on the similar time. A marking guidelines can be offered very quickly so you possibly can see how this work can be assessed.