Lab4 This Lab prepares you to solve problems with MATLAB. Execute the commands given in the MATLAB Commands column and fill in the results in the MATLAB Output column. At the
end of the document there are exercises that must be done as well. For those exercises, please provide the commands used and the screen shots or the MATLAB output. How to find State Space equations Steps 1 2 7 MATLAB Commands doc ss2tf doc ss A=[1 2 3 4 5 6 7 8 9]; A=[0 1 0,001; -9-8-7] B=[7:8:9] C=[234] D=0 F=ss(A,B,C,D) num=24 den=[19 26 24] [A, B, C, D]=tf2ss(num,den) T=tf(num,den) TSS=ss(T) >> numf-150 [127] >> denf=[1540) >> F=tf(numf,denf) >> fss=ss(F) sys=ss([-2-1;1-2],[11;2-1],[10],[01]) MATLAB Output Displays help for the ss2tf command Displays help for the ss command To suppress any output, add a semicolon at the end of the MATLAB command Description Type 'doc any_matlab_command" to display the help on that command. Convert A, B, C, and D to state space equations Convert transfer function T to state space equations. Transfer function has a polynomial in the numerator :numf (150 [127] denf is the denominator F displays transfer function in the s- domain fss now has the state space equations State-space equations can be found directly from the A, B, C, and D/n Faculty of Technology School of Engineering EAT240: Automation for Manufacturing Control Coursework 2023/24 Hand-out Date :WC 16-10-2023 Hand-in Date: WC 15-12-2023 This control coursework assignment requires the submission of a report detailing your solutions to the following tasks and contributes 50% towards your overall mark. You should keep all your simulation files in a safe place as they may be requested at a later date. The marks shown overleaf indicate the maximum possible marks that each element contributes to the final mark. Your completed coursework should be submitted via Canvas by the date specified in the assessment instructions. This coursework specifically covers following learning outcomes of the module. LO1: Describe the properties of typical sensors and signal conditioning used in automation systems and evaluate their suitability for a given application. LO3: Describe the internal structure of typical processors and controllers and evaluate their application in industrial automation systems. LO5: Design and test typical programming solutions for use with automation systems. You are permitted to use a variety information sources to complete your research. However, your findings must be presented in your own words and must not be taken directly from any other source. All sources you have used must be clearly and appropriately referenced using the Harvard referencing system. Using sources which have not been appropriately referenced or taking any data directly from a source and included in your work will be regarded as plagiarism and may result in you being accused of academic misconduct. Scenario Design Exercise A manufacturing company has recently installed a new paint line. The paint line can mix different colours of specialist paint to a set temperature. After the mixing process has been completed the tank will empty to fill a batch of tins. The completed batch will then be transferred to a labelling process before final transfer to a warehouse, ready to be shipped to the customer. Task Your company has been contacted to tender for the control system for the paint booth. The project manager has decided to utilise your skillset and you have been tasked with designing a microcontroller code for the machine that as a minimum meets the basic requirements outlined below. The system is controlled by the PIC18F4455 microcontroller. The microcontroller will perform the following functions. Note: Please note that all work should be completed on an individual basis. System Overview The system has two possible sequences: Sequence one - (Paint A) is heated at a temperature of 50 °C. Sequence two - (Paint B) is heated at a temperature of 70 °C. The system has two temperature sensors, which give a 0-5V signal depending upon the temperature sensed. System Control Basic System Program Requirements Two latched switches are used to allow the operator to signal which type of paint is being processed (either A or B). If no paint type is selected, or both switches are active, then a red LED will be illuminated to show the operator that no valid selection has been made. Once a valid single selection has been made, the microcontroller will monitor the relevant temperature sensor. If paint A has been selected and the paint temperature is below 50 °C the microcontroller should switch on tank A heating element. If paint B has been selected and the paint temperature is below 70 °C the microcontroller should switch on tank B heating element. Once the paint has reached the required temperature, the heating elements must be switched off and a signal should be activated to let the microcontroller know that the mixing cycle can commence. This signal can be simulated using a green LED. While either of the tanks are being heated a warning red LED should be illuminated i.e. there is one LED which will illuminate regardless of which tank is being heated. Deliverables Sensor selection You should elaborate on the temperature sensors that you are going to use. For the temperature sensor, you need to reflect on its parameters like range, accuracy, and linearity. You will also need to provide calculations to show the proposed interconnection between the sensor and the microcontroller to illustrate the required thresholds that must be set in the program to detect the specified temperature. Design Notes The customer has asked for a comprehensive set of design notes based on the required functionality described above. This may include: 1/0 list Variable list Microcontroller pin diagram Flowcode flowchart You will create your PIC18F4455 flow chart using flowcode tool. You will have the opportunity to demonstrate the functionality of your flowchart using flowcode tool in the class (week 20, W/C 11-12-2023). You will be given a task during the session to modify your program which will reflect your ability to demonstrate originality of the work and ability to change it. You may not collaborate or communicate with anyone else, and you may bring your flow chart into the session. You will have 60 minutes to complete the coding. Engagement with Lab Sessions While there are a number of elements to this assessment much of the work is based on the activities that you will carry out online and during the laboratory sessions. Therefore, if you engage with these activities you will greatly enhance your chances of achieving a good mark. After each session you should try to think about how the material covered could contribute to the assignment and make a note of this to support the design exercise. Importance of Design One of the most important themes in this module is the importance of design. It is important, therefore, that you allow adequate time to design your program. If you fail to do so you will not only jeopardise the design elements of the coursework but you will also make it extremely difficult to score well for the coding activities. Avoiding Accusations of Plagiarism Any code you write must be entirely your own. You may bring listings into the coding sessions but if these have been sourced from another source e.g. a text book or the internet, then this must be fully acknowledged using comments which clearly and unambiguously identify the extent of the code involved (e.g. by labelling the start and end of the section in question) and the source. You should also ensure that all work in the written submissions is your own and correctly referenced. Where you draw on references you should ensure that you clearly explain their relevance to your own work. If you are unsure on the correct way to reference any material, please ask or refer to the guidance available via the University Library Website: http://library.sunderland.ac.uk/find-resources/referencing/ Presentation of Work Presentation of work is of critical importance. The elements being submitted electronically should be typed and clearly formatted making appropriate use of headings and subheadings. Your design notes for the flow chart may be hand written or typed but MUST be clear and legible. Marking Scheme Sensor Selection (to be submitted electronically on canvas) Critical evaluation of the proposed sensor and it's suitability for use with the PIC18F4455. Calculation of required thresholds for sensing application. Design Notes (to be submitted electronically on canvas) Design notes which may include a flowchart or Sequential Function Chart, I/O list, variable list, pinout diagram Flowcode flowchart (to be demonstrated in class) Demonstration of required functionality and originality. /5 /5 /15 /5 Structure of flowchart: Clear logical structure Use of sensible/appropriate variable names Further Tasks (to be submitted electronically on canvas) Task 1: In continuation of the design exercise described above, you have to design a signal conditioning circuit for your sensors. The signal conditioning circuit should be a non inverting avergaing amplifier. Draw the circuit diagram and derive a generic expression using suitable resistor values for a non inverting averaging amplifier (use ideal op amp for this purpose) (8 marks) Task 2: Consider the PIC18F4455 microcontroller used in the design exercise above does not have an ADC and you need to use an external 8-bit ADC. The input signal range to the external ADC is 0 to 5 V. Assume that the input to ADC is M =1+ +0.5 where X is the last digit of your student X 3 ID. Task 3: a. For the external ADC described above, determine the digital value in binary format after the conversion. (2 marks) b. Assume that the ADC described above is a counter type ADC and it has an internal 8-bit B = X R-2R DAC. If the decimal equivalent of input given to DAC is 'ABC' where A == " 4 Y Z and C == where 'XYZ' are last three digits of your student ID, then what will be the 3 2 output of R-2R DAC? (3 marks) For example, if last three digits of your student ID are 456, then 'XYZ'=456 and decimal equivalent of input to DAC will be 'ABC' = 113. c. Build the R-2R DAC described in part b using proteus and verify the results of part b through simulation. Submit the snapshot of your simulation results. (3 marks) Consider a microcontroller 'A' used above operates at 10MHz and executes a program in 10 seconds. You can use another microcontroller 'B' that can reduce the execution time by 4 seconds. But using microcontroller 'B' will increase the clock cycles of the program by a factor of 1.2. Under these circumstances, what should be the operating frequency of microcontroller 'B'? (4 marks) END OF COURSEWORK