
” 写作P21410编程设计、 辅导C/C++程序Academic Year 2020/21P21410 – Real-Time Embedded SystemsCourseworkDeadline For Submission: 15/05/2021, 23:00Submission Instructions You will demonstrate your code and discuss the results in the lasttimetabled online session for this moduleYou should submit your report and associated C code via Moodle.Report should be in the pdf Format, and the code should be in .cformat, ready to be executed.Instructions for completing theassessment:See attached pages for further detailsControl SystemReal-Time Embedded Systems1Conveyer Belt Control System |1/ IntroductionYou are required to develop an embedded real-time control system for a parts sorting facilityon a factory assembly line. The sorting facility consists of two conveyors that operateconcurrently. The computing platform used for the controller is an embedded PC104 singleboard computer, running the VxWorks real-time operating system. The controller softwareshould be implemented using the WindRiver Workbench software development tools and bewritten in the C programming language (though C++ may be used if so preferred).2/ System DetailsThe handling system consists of 2 conveyor belts, each allowing for the concurrent sorting ofobjects (parts). The system interfaces with the controller using the PCs parallel port.Figure 1// Hardware layoutEach conveyor features two sets Of sensors and a sorting gate. The first sensor set allows forthe detection of the object size. There are two types of parts presented to the conveyor: Small parts can only trigger one of the size sensors at a time. Large parts are long enough to trigger both size sensors simultaneously.The second sensor set features just one object detection sensor, and is used to count theparts collected at the end of each conveyor for quality control purposes.Your task is to develop the controller software to sort parts into the correct categories.3/ Basic Controller RequirementsThe basic requirements for operation of the controller software are as follows:1. The controller should be able to detect and distinguish between small and largeobjects present on each conveyor belt.2. When a large object is detected on a conveyor, the respective gate should remainopen to allow the large object to pass to the end of the conveyor.3. When a small object is detected on a conveyor, the respective gate should close toroute the small object off the conveyor.Real-Time Embedded Systems2Conveyer Belt Control System |4. The sorting gate should be opened once a small objecthas been routed off to allow for the correct routing of subsequent objects on theconveyor.5. The controller should maintain a separate count of the number of small and largeobjects detected on each conveyor.6. The controller should maintain a count of large objects collected at the end of eachconveyor.7. The controller should provide a simple text based user interface that allows the userto perform the following actions:i) Display the total number of small objects detected for each conveyor.ii) Display the total number of large objects detected for each conveyor.iii) Display the total number of large objects collected for each conveyor.iv) Reset the counter values for each conveyor.v) Shutdown the controller application and free up any memory used by it.8. When shutting down the controller following a user prompt, the sorting gates shouldbe opened. The application Should also delete all created data structures (includingsemaphores, queues, etc.) and OS tasks.4/ Conveyor timing parametersTo fulfil successfully the requirements of Section 3, you will need to know the timingparameters of the conveyor unit and the objects used on the conveyor:Figure 2// Detection and timing zonesThe values of these parameters will be provided in a separate appendix downloadable fromthe module Moodle site.5/ Possible ExtensionsThere are a number of possible extensions to the basic functionality that you can implementfor higher marks: Hardware testing. You can implement code to test that all conveyor hardwarecomponents (sensors, gates, motor) are operational. For instance, you can promptuser to place an object in front of different sensors and verify readings, or operate thegates/motor and ask user for visual feedback.Real-Time Embedded Systems3Conveyer Belt Control System | Automatic calibration of the system timing parameters. Some timing parameters inthe previous Section can vary from one physical conveyor unit to another. Instead ofusing hardcoded values obtained from prior measurements, you can implement codethat will carry out necessary measurements within your application and automaticallyconfigure it for a given conveyor unit. Load monitoring. You can monitor the CPU load to detect when the system becomesoverloaded. The current load measurements (e.g. the amount of idle time) can bedisplayed in the user interface. Overload protection. You can further enhance the automatic calibration functionalityto detect when the determined timing parameters can result in the system missingscheduling deadlines. In such cases, an overload alarm message can be displayed tothe user. You can think of your own extensions to the system functionality.6/ Simulation TaskThe system uses a C library that enables the interaction with the conveyer. You need to dothe following: You should simulate the library Mimicking functionality, naming convention andoutput. To gain extra marks, you should create your own simulation library. You should create a test scenario for the new library. Finally, you should create a Text-based user interface for your scenario. Extra markscan be gained by the introduction of system calibration and debugging.7/ Coding GuidelinesIn your code, you should adhere to the following coding standards: You should use descriptive names for all of your variables and functions. You should use symbolic identifiers for all non-trivial numerical constants in your code(i.e. for everything except 0 and 1). You should include comments in the code detailing its functions where necessary. You should use a consistent and readable scheme for indentation, spacing and blanklines8/ Assessment methodThe exercise will be assessed using a CODE DEMONSTRATION and a REPORT.The CODE DEMONSTRATION will take place during timetabled online session and will consistof a demonstration of the working system. Your assessor will put your system through anumber of test situations to see how your system reacts/handles them. You must also beReal-Time Embedded Systems4Conveyer Belt Control System |ready to explain and discuss your program design and todemonstrate your familiarity with the code.Please note! If you do not demonstrate your work by the deadline, your working system willbe assessed from the submitted source code and the report using the same approach as above.However, your assessor will not be able to deal with any issues appearing during tests and thiswill likely result in loss of marks. Therefore, it is in your very best interest to make sure thatyou demonstrate your system in the lab yourself before the deadline.The REPORT should be submitted via the unit Moodle site and should include the following: A description of your application explaining key software components (functions, datastructures, etc.) as well as the tasks that your system is running, their purpose,functioning details (i.e. what each task does and how), and justification for the designdecisions made. Detailed scheduling parameters of your system including details of task periods, theircomputational requirements, blocking dependencies, and determined priorities theanalysis must match the actual system design and operation! Scheduling analysis of your system to determine whether the tasks can be scheduledusing relevant Rate/Deadline Monotonic Theorems. Analysis of schedulability thresholds. The timing of your system largely depends on thespeed of the conveyor belts. In this part of the report, you should analyse whatmaximum possible belt speed increase your system could tolerate. For instance, youcould show with your analysis, that the tasks could still be scheduled, if the belt speedincreases by up to 10% Alternatively, if you have not managed to prove in the previous section that the taskscan be scheduled, you could analyse here by how much the conveyor would need tobe slowed down to prove schedulability. Reflection on how ongoing feedback from the lecturer helped you with theassignment. Breakdown of individual contributions from team members (these will be taken intoaccount when allocating the individual student marks). Complete source code of your application. This must be submitted in a separate file asexplained on the unit Moodle Site. If your source code consists of a single C file, thenjust submit this C file. If you have more than one C file, then submit a ZIP archivecontaining your C files.The report must include a cover Sheet available from the unit Moodle site.如有需要,请加QQ:99515681 或WX:codehelp
“
添加老师微信回复‘’官网 辅导‘’获取专业老师帮助,或点击联系老师1对1在线指导。






