Search for question
Question

/n Global Health Drone: Autopilot Controller Thermal imaging Health Drone Injured Person Remote region INTRODUCTION Global Health Drone is designed to travel across large landscapes in remote and resource-limited parts of the world - areas where traditional healthcare systems struggle to provide assistance, particularly during emergencies. The drone's job is to search across large landscapes, locating potentially injured person(s) via camera systems and then use a thermal imaging system to scan and provide vital medical feedback to medics who can assess and come to help... So your task is to program a control system for the drone which it uses to reach a target height and maintain this while the system scans.... You • Lab Notes • Practice WOKWi Simulation ⚫Testbed for code Unlimited attempts RELOAD •Real Hardware • 50 Attempts! Please read this coursework guide carefully for full instructions, including your objectives, technical background and a mark scheme. Over and Out. Global Health AIM AND OBJECTIVES The aim is to develop a height control system which moves your drone to a stable height and maintains this for 5 seconds while it performs a thermal scan... APPROACH Drones are expensive... so you will need to develop your code carefully in two stages using: 1. A drone simulation (in WokWi): develop your code until it is functional and error free... 2. The ReLOAD drone model: now test your code on a real system and tune the controller IMPORTANT: You are limited to 50 test runs on the ReLOAD system! Drone (This represents industry practice - testing on hardware is costly... only attempted when you have a system you are confident will work effectively! OBJECTIVES 1. Produce a Flow Chart of your program from the Specification (see Page 4) 2. Write an Arduino drone controller program (based on your Flow Chart) which: a. Initialises your system hardware b. Implements a closed-loop controller to reach and maintain the target height i. Your controller should run at 25Hz ii. As a minimum you should implement a Proportional controller c. Lights LEDs to indicate (System start, Reached Target Angle (Scanning Start), Scanning complete d. Sends flight telemetry data via Serial - see Page 4 for the detail e. Use good programming practice to produce a well-structured and understandable program f. Use functions to implement i. Sensor measurement ii. The controller iii. Other functions of your choice... 3. Collect and submit evidence from ReLOAD of your system in action (see Deliverables, Page 6) a. Your flow-chart (1 side of A4) b. Your program c. RELOAD outputs (.CSV and Video file) Global Health SYSTEM DESCRIPTION You will develop your controller using the model drone system shown in Figure 1. The drone is represented by a beam, pivoting at the end, with a motor-driven propeller at each end. The beam is free to rotate about the pivot, simulating the drone moving in the air. Your Arduino controller is connected to: 1) A potentiometer which can be used to measure the angle of the drone (relative to ground). 2) Two H-Bridge motor controllers, each linked to a high-power DC motor and power supply Drone Target Height (50mm over ref) Oref=0° ground=-68.5° DC motor H-Bridge Arduino Indicator LEDs V pot Support Rod (0.491m) Figure 1. Configuration of the model helicopter system Potentiometer HARDWARE The hardware in the drone model is described here. You will need to use this to configure your Arduino system correctly, and to calibrate your sensor measurement. Item H-Bridge Controllers + Motors 80 DC motor H-Bridge Arduino Potentiometer For calibration, we took the following measurements: ADC out Angle (0-1023) 212 410 -68.5 0 Output LEDS Information A commercial H-Bridge controller is used to control the motor. This takes a 24V supply and uses DIRECTION and ENABLE inputs: H-Bridge Connections ENABLE: Pin 10 DIRECTION: Pin 9 The potentiometer output voltage will change linearly as a function of the angle 0 shown in Figure 1. The output Vpot can be measured using Arduino Pin AO Table 1: Equipment specification for the model helicopter Use these LEDs to signify the status of the control system. LED (Green) = Pin 2 LED (Yellow) = Pin 3 LED (Red) = Pin 4 Global Health SPECIFICATION Your balance controller should be written to go through the following process - please read this carefully! You need to convert this into a Flow Chart as part of your submission Drone The process is defined by a series of numbered stages. Each stage requires you to perform some tasks which are detailed. 1. As your control program starts it must initialise the system. Setup your Serial communication so you can send messages. Configure your hardware connections to the sensor and motors. Show that your controller (the programme you write) has started by lighting all LEDs for 0.5 seconds 2. 3. Your controller should now start. It should run continuously at 25Hz - as precisely as possible. a. The controller first reads the potentiometer sensor to determine the angular position of the drone b. The angular position is converted into the current height of the drone C. Now your controller should calculate a motor control signal based on the target height = 50mm. d. Send telemetry information using Serial communications e. Light the output LEDs according to the current control error: f. i. Error less than ±20mm [Green] = TARGET HEIGHT ii. Error <-20mm [Yellow] iii. Error> +20mm [Red] Continue the controller for 5 seconds g. Land (Stop Motor) 4. Shutdown: a. Light all LEDs for 1 second and turn-off the motor b. Optional: Calculate and report the following performance statistics (as many as you can): i. the time taken to first reach TARGET HEIGHT ii. the maximum error encountered after first reaching TARGET HEIGHT iii. the average error encountered after first reaching TARGET HEIGHT AUTO-PILOT BLACKBOX DATAFILE As your program runs it should generate a BlackBox datafile - formatted in the same way as the example below but with your own data. This must be submitted as part of your coursework to demonstrate that your program runs and how well it performs! (Note the... just indicates lots more data!) 0.System Started 1.System Initiated 2.Controller Starting Time, Angle, Height, Error 0.00, 0.3,0.15... 0.02,0.29,0.14... 5.00, 0.151,0.01... 4. Shutdown Maximum Error: REPORT HERE UNITS: Please ensure you report your data in the following format Time Current Angle Height Error seconds degrees 2 decimal places 2 decimal places metres metres 2 decimal places 2 decimal places Data that should be printed to Serial as your program runs. Note: the numeric values are only examples - yours should use the actual values you record! THE CLOSED LOOP CONTROLLER CONTROLLER TYPE Your program should implement a closed-loop controller. The basic version you should attempt is a Proportional Controller - see lecture notes/slides For additional marks you can implement a more advanced PID controller - see links below This must be made clear in your code comments! REFERENCE: PID CONTROLLERS https://scholarscompass.vcu.edu/cgi/viewcontent.cgi?article=5737&context=etd https://www.omega.co.uk/prodinfo/pid-controllers.html Global Health CONVERTING YOUR CONTROL SIGNAL INTO MOTOR SIGNALS Your controller will generate a control signal that must be used to drive your drone motor. For the motor you can control both speed and direction using the H-Bridge controller (see your lab and lecture notes). SIMULATION Please find the simulation and template code at this address: https://wokwi.com/projects/327380710302155348 Item Blue LED Purple LED Green LED Yellow LED Purpose H-Bridge Direction H-Bridge Enable Red LED Gottes LED Potentiometer Template Code Angle Sensor Your starting point! O UNO ARDUINO Drone