Kiran Arcot EE 587 Advanced Embedded Systems Hardware
Kiran Arcot EE 587: Advanced Embedded Systems Hardware in the Loop (HIL) March 5 th 2014 1
Outline • • • Introduction Hardware in the Loop (HIL) Pieces required for HIL on the Discovery Board with PX 4 Firmware Conclusion 2
Introduction • What is simulation? – Modeling of a real-world system and process • Many types of simulation – Completely in software • • Simulation of collision of galaxies Lawrence Livermore National Lab nuclear weapons simulation Simulation in Computational Electromagnetics Many others (Lexmark printers) – To-scale modeling and simulation • Tsunami simulation at Oregon State University 3
Introduction (cont’d) • Many types of simulation (cont’d) – Military exercises • Training and preparedness • War games – Simulation with hardware input/output • Arcade motorcycle games • Wiimote for tennis game • Occulus Rift the virtual head mounted display – Hardware in the Loop • Mostly a technique employed in real-time embedded systems 4
Hardware in the Loop (HIL) • HIL typically involves – A computer that simulates the “plant” – An embedded microcontroller • Why use HIL? – – – Cost of the plant is extremely high Shorter time-to-market Safety Parallel development Testing in inclement weather is made easier Faster development of newer vehicles 5
Pieces Required for HIL • For HIL on the PX 4 we need – X-Plane 10 – Q Ground Control (QGC) – The STM 32 F 4 -Discovery board Control inputs UDP MAVLINK Sensor Data 6
X-Plane 10 • X-Plane 10 – Flight simulator by Laminar research – Uses something called “blade element theory” for modeling to calculate aerodynamic forces such as drag, lift in different conditions • In blade theory each wing is divided in to subsections to calculate the forces on it in real time. Then the forces are combined to figure out the overall effect on the aircraft. – Plane Maker and Airfoil Maker – Hi. LStar 17 f is the simulation fixed wing aircraft provided by PX 4 developers 7
Q Ground Control (QGC) 8
MAVLink • Micro Aerial Vehicle Link – By Lorenz Meier – Released in 2009 – Used for communication between ground stations and the micro aerial vehicle 9
MAVLink (cont’d) 10
HIL on the Discovery board • Default firmware has modules turned off 11
HIL on the Discovery board (cont’d) • Main modules are – Hil • Subscribes to attitude_control topic and publishes attitude_output – att_pos_estimator_ekf • Subscribes to sensor_combined, vehicle_gps_position, parameter_update topics and publishes vehicle_global_pos, vehicle_local_pos and vehicle_attitude topics – fw_pos_control_l 1 • Subscribes to vehicle_global_position, vehicle_global_position_set_triplet, vehicle_attitude etc. Publishes vehicle_attitude_setpoint 12
HIL on the Discovery board (cont’d) • Main modules are – fw_att_control • Subscribes to vehicle_attitude_setpoint, vehicle_attitude, vehicle_control_mode etc • Publishes actuator_controls_0, vehicle_attitude_setpoint_0 13
Conclusion • No sensors, no problem – Can still run HIL on the Discovery board • Can test/tweak the PID loops • Can develop on $15 board as opposed to the $100$150 PX 4 FMU 14
- Slides: 14