This is Part 3 of my MATLAB to FlightGear Series where I cover advanced topics on building flight simulations using MATLAB, Simulink, and FlightGear (FG). We will be looking at how to simulate moving control surfaces such as flaps, spoilers, rudder etc.
The Aerospace Blockset within Simulink will once again be used extensively. The topics covered in Part 1 and 2 will not be repeated here so please watch those to learn how to get FlightGear setup with MATLAB, and to run basic Simulink models using FG. The ability to get FlightGear working with Simulink smoothly is a prerequisite for this video. Make sure you use the correct version selected within the Aerospace Toolbox blocks.
Connecting MATLAB & Simulink to FlightGear (Part 3) - High Fidelity SimulationsVDEngineering2020-06-05 | Hello,
This is Part 3 of my MATLAB to FlightGear Series where I cover advanced topics on building flight simulations using MATLAB, Simulink, and FlightGear (FG). We will be looking at how to simulate moving control surfaces such as flaps, spoilers, rudder etc.
The Aerospace Blockset within Simulink will once again be used extensively. The topics covered in Part 1 and 2 will not be repeated here so please watch those to learn how to get FlightGear setup with MATLAB, and to run basic Simulink models using FG. The ability to get FlightGear working with Simulink smoothly is a prerequisite for this video. Make sure you use the correct version selected within the Aerospace Toolbox blocks.
Learn how to connect and send aircraft data from variables within a Python script (e.g.: position, orientation and control surface information) to FlightGear (Windows / macOS) to build custom high fidelity flight simulations from scratch!
This will be of use if you're interested in building your own algorithms and visualizing them using open source software.
Similarly how Matlab and Simulink connects to FlightGear, Python does the same via a UDP connection. Moreover you can also send data in reverse from FlightGear to Python. You can transmit and receive data between FG / Python simultaneously. This would be required when designing your own autopilot using the build in flight dynamic models in FG.
Instead of running the Python script from the IDE, you can directly run it from the terminal. This will improve performance. On my Windows 10 machine I was having trouble using Spyder, however using the command prompt fixed this issue.
Learn how to design a smooth trajectory for landing of rockets, given the start location and the landing zone coordinates in latitude, longitude and altitude. You will gain familiarity with the basics of navigation using GPS coordinates along with the sigmoid curve which is used in multiple areas of engineering.
Timestamps: Theory: 00:00:40 C++ and Qt GUI App: 00:06:32 App Demo: 0:14:20
Learn how to create a simple Arduino based radar detection display, along with plotting data on a realistic user interface created in C++ and Qt. The user can control the angle of the radar through the UI via QSerialPort. The range and detection information is passed back from the Arduino and then displayed on the UI.
Components: 1) Arduino Uno (or any other 5V compatible microcontroller) 2) HC-SRO4 Ultrasonic Sensor 3) HC-SR04 attachment frame 4) Breadboard 5) Servo Motor
My first robotics project, an Android app Bluetooth controlled car powered by an Arduino Uno, L-298N Motor Driver, and HC05 bluetooth module. Sensor feedback for acceleration and orientation is provided by an MPU6050 IMU.
Timestamps:
Introduction: 0:00 Parts List and Circuit Diagram: 00:46 3D Model: 04:00 Code Explanation: 04:35 Outro: 11:21
Learn how to create a graphical user interface based desktop or web application to design a rocket engine nozzle using the method of characteristics. I have used C++ and Qt, however you can also use anything else (Python, Javascript etc). I will explain the theory of compressible flows, propulsion, nozzle design and the method of characteristics in detail before going over the design process and architecture of the app. This way, you can recreate this application in any programming language of your choice.
Timestamps:
Ch0 - Introduction: 00:00 Ch1 - Review of Rocket Propulsion, Nozzles and Compressible Flows: 00:00:41 Ch2 - Method of Characteristics - Theory: 00:04:51 Ch3 - Method of Characteristics For Rocket Engine Nozzles: 00:13:04 Ch4 - Object Oriented Programming - the Backend: 00:39:05 Ch5 - App Frontend Walkthrough (C++ and Qt): 00:50:57 Ch6 - The MOC Algorithm: 00:53:51 Ch7 - Demo of the App!: 01:06:12
Learn how to build a GUI using Qt to send data from your computer to Arduino for various projects. I cover two examples, controlling the position of a servo motor, and the speed of a DC motor.
In this video we will use multithreading to build a car simulator in C++. Two threads will be created representing each car with different parameters and initial conditions. Multithreading is an extremely powerful tool in programming to create efficient robust code. The result values will be output to text files and then visualized using gnuplot. You will need the standard thread library in C++. Alternatively you can also complete the program without using threads.
Car Dynamic Model: 0:45 Code: 02:11 Testing: 16:45 Results: 19:47
Using the recently developed AI ChatGPT to solve common problems in mechanical and aerospace engineering. Topics covered include rocket propulsion, motion planning, guidance navigation and control, along with finite element analysis.
Hello, Interested in robotics and self driving cars? Then check out my new project website! Set a start location, goal location, obstacles and visualize RRT, RRT* and A* algorithms. You can also visualize the A* algorithm on Dubai or Las Vegas maps. I had a great time creating this project, thank you for checking it out!
You will learn how to implement the well known Rapidly Exploring Random Trees (RRT) algorithm in Python from scratch. I will show you every step including creating the configuration space which will be a binary image along with setting up the grid and finding the generated path. You will also learn how to calculate the length of the trajectory generated by the RRT algorithm along with the number of waypoints and their locations.
There are more advanced versions of the RRT such as RRT*, CL-RRT and RRT# and these will be covered in future videos.
Timestamps:
RRT Intro: 00:45 RRT Explanation: 01:24 Setting up the code: 07:24 Completing the code: 12:50 Running the code: 25:10
In this video I will go over the complete C++ source code for my first desktop application - Company Manager, created with Qt Creator. You will learn how to connect the UI (frontend) with the backend, how to properly pass class objects and use constructors.
~~Instagram: instagram.com/vinayak_deshData Structures: Delete a node from N-ary tree | C++ TutorialVDEngineering2022-08-10 | In this data structures video you will learn how to delete a node from an n-ary tree using C++. This is a tree in which each node can have more than 2 children. There are four unique cases, the node to be deleted either; 1) Is a leaf node, 2) Has one child, 3) Has many children and you want to promote all of the children. 4) Has many children and you want to promote only one of the children. You will also learn how to use recursion to search for a node in an n-ary tree using Depth First Search (DFS).
Previous topics covered included deleting a node from a binary tree or binary search tree. This topic is slightly more advanced and is not asked on LeetCode. However, it is relevant to real world projects.
Thanks for watching! ~~My Udemy Courses on Motion Planning / Navigation / Trajectory Planning: udemy.com/course/autonomous-robots-nonholonomic-motion-planning-algorithms ~~Website: vinayakd.com ~~Instagram: instagram.com/vinayak_deshData Structures: Create an N-ary Tree: C++ Quick TutorialVDEngineering2022-07-10 | A quick tutorial on creating a tree with a varying number of nodes, i.e an n-ary tree in C++. You should have a basic understanding of pointers and structs. From this point onwards my channel will focus on C++ mainly, data structures and algorithms. These topics are relevant to the field of control theory and software engineering in general.
I introduce Collimator, a California based startup company creating a modeling and simulation tool which is similar to Simulink however cloud based, having a Python backend and compatible with High Performance Computing (HPC) platforms.
In this video I explain my first web application, a simple hotel reservation system having a front-end and a back-end. The editor used was VSCode and the Django framework of Python was used. The backend is also written in Python. In addition, the web pages are made using HTML.
Note that the purpose of this video is just to go over the framework and a basic implementation of a frontend and backend program.
More complex functions such as back buttons, form reloads / refreshes, username and passwords and databases are not covered.
I recently worked on a programming side project related to Object Oriented Design. This video explains the code, the activity diagram and the class diagram in detail. This will be helpful if you are working on your own programming projects either for school or for work.
In this video I explain how to design your own Model Predictive Controller for any Linear System which you can define. The design of the MPC is validated through running 2 iterations of one of two Quadratic Programming algorithms.
In this video we will build a simple observer based Fault Detection algorithm in a Linear Time Invariant (LTI) control system. The purpose of this algorithm is to be able to detect and measure actuator faults as a Loss of Effectiveness (LOE). In the field of engineering, the ability of a computer algorithm to detect faults which can occur in real time is very critical for the safe continued operation of any software or hardware.
There are several algorithms available for detecting actuator faults. As this is an introductory tutorial, this specific algorithm is simple to design and implement. A major advantage is the ability to tune the parameters offline to avoid calculations in real time.
Timestamps:
00:58 - Actuator Faults 03:45 - Observer for States and Faults Theory 04:31 - Observer Implementation 05:15 - Python Implementation 09:00 - Simulation Results
In this video you will learn the basics of MPC and how to put together a quick simulation in Python without using any optimization toolboxes and solvers, so you can learn the process from scratch. Note that if you're using a version of Python which is not 3.7, then you may need to change the syntax. Numpy, scipy and matplotlib will be needed.
The MPC algorithm used will be the efficient MPC algorithm originally developed by P.W. Gibbens and E.D. Medagoda at the University of Sydney. This algorithm is a little less complex than the standard integral action MPC methods, however the underlying concept is identical in all methods of model predictive control.
Thanks for watching!
Sorry for the delay in uploads, as I am moving cities and just graduated from University!
In this video you will learn how to implement a Quadratic Optimization solver in Simulink without using any built in toolboxes. Optimization is an extremely important mathematical concept used within statistics, machine learning, control systems, and artificial intelligence algorithms. It is also used in all industries (finance, engineering etc.).
The background is covered in that paper I published as part of my Master's thesis. This video is the first part of my tutorial series on model predictive control (MPC). You will learn the following Simulink concepts:
1) Working with project files 2) Variant Subsystems 3) Iterator Subsystems (For / While Loops) 4) Struct objects 5) Assignment and Selector blocks
You will also get the hang of basic Optimization concepts needed for MPC such as:
1) Cost function 2) Constraints 3) Primal-Dual Procedure
Welcome to Part 3 of my Simulink Beginners Series. Here you will learn very useful tools which are commonly used by the industry in Simulink.
Knowing these skills will help you in a job which uses Simulink extensively (such as control systems, simulation, dynamics, electronics etc.)
This tutorial will cover:
1) Working with Simulink Project (.prj) files. 2) Bus Creator and Bus Selector blocks (very important) 4) Signal routing to source and destination (extremely useful) 5) Logging signal data into the workspace. 6) Other quick tips (default font, subsystem masks, running models from MATLAB)
In this video you will learn the fundamentals of missile guidance, navigation and control. This tutorial will cover developing a MATLAB and Simulink model of a missile hitting it's target using Proportional Navigation Guidance. Next, a Simulink 3D animation is done! You will learn
1) 3-Loop Autopilots (pitch attitude control) 2) Proportional Navigation Guidance 3) Missile Line of Sight and Miss Distance Calculation 4) Build a full flight simulation!
Thanks for watching! Subscribe for more videos like this! My Instagram: instagram.com/vinayak_desh My Website: vinayakd.com ____________________________________________________________________
This video is a follow up from Part 1 (in 2016) where I introduced how to connect MATLAB and Simulink to a joystick. I use the Logitech Extreme 3D Pro, in this video you will learn:
1) How Actuators Work? Command / Rate Saturation, Deadzone, DeadTime etc. 2) Advanced topics on building an actuator model with a joystick
It will be assumed that a single stage rocket takes off and lands i.e there is no stage seperation for this tutorial. You can then visualize it in FlightGear. If you do not have FlightGear, I also show you how to use MATLAB 3D Animation instead, which is just as good!
TIMESTAMPS:
00:31 - Intro and Theory 05:03 - Free Body Diagram of the Rocket 06:50 - Explaining the rocket flipping, re-entry, descent and touchdown 07:30 - Matlab Code Tutorial 08:30 - Simulink Model Tutorial 20:13 - Explaining simulation results 21:40 - Connecting the simulation to FlightGear 22:00 - Matlab 3D Animation (if you don't have FlightGear!) 22:51 - What the simulation looks like in FlightGear! 24:10 - Explaining the results / conclusion
Useful Links and Videos:
Falcon 1 (Merlin 1C Engine): http://www.georing.biz/usefull/Falcon1UsersGuide.pdf and here: http://www.b14643.de/Spacerockets_2/United_States_1/Falcon-9/Merlin/index.htm Connecting MATLAB to FlightGear (Part 1): youtube.com/watch?v=jB-80cvV1Ao& Guidance, Navigation and Control Design: youtube.com/watch?v=0AJ6E48Aj9U&
In this video you will learn how to build a complete guidance, navigation and control (GNC) system for a rocket / missile which is commanded to reach a specified target starting from a random initial position, by using LQR /LQG and Kalman filtering methods for control and estimation. You will learn
1) How to calculate azimuth, latitude, and longitudes 2) Calculate guidance commands, range, miss distance, elevation 3) Design Linear Quadratic Regulator / Gaussian (LQR) for a 2d state space model 4) Build a 3-DOF Simulation with the Aerospace Blockset provided within Simulink 5) Perform simulation with FlightGear
Thanks for watching! ~~My Udemy Courses on Motion Planning / Navigation / Trajectory Planning: udemy.com/course/autonomous-robots-nonholonomic-motion-planning-algorithms My Instagram: instagram.com/vinayak_desh My Website: vinayakd.comWho is VDEngineering? Life of a Mechanical Engineering Graduate Student in CanadaVDEngineering2020-09-07 | A glimpse of some of my research, lifestyle and stuff I do on a regular basis living as a funded graduate Master's Degree student in Mechanical Engineering at Concordia University, Montreal, Canada.
I also have an interview with a friend who came from Mumbai, India on adjusting to life here along with his internship experience at Bombardier Aerospace.
Note that due to the current global situation things are not usually the same as before.
TIMESTAMPS:
Intro: 00:00 My Research: 01:52 Flight Controls Lab: 02:36 Interview: 04:25 Life in Montreal: 08:06
Thanks for watching! ~~My Udemy Courses on Motion Planning / Navigation / Trajectory Planning: udemy.com/course/autonomous-robots-nonholonomic-motion-planning-algorithms My Instagram: instagram.com/vinayak_desh My Website: vinayakd.comMATLAB / Simulink Tutorial: Discrete MIMO Kalman Filter Design and ImplementationVDEngineering2020-07-27 | In this video you will learn how to design a Kalman filter and implement the observer using MATLAB and Simulink for a multivariable state space system with 5 states and 2 inputs. The dynamic model represents the longitudinal dynamics of the aircraft and is taken from here:
1) Algebraic Riccatti Equation and Observer Theory 2) Assessing stability of the Kalman Filter 3) Determining the optimum Kalman Gain based on covariance matrices (Q and R) 4) Implementing the design in Simulink and using tools such as: adding noise, discrete time integration (z domain), block diagram structure of the observer, along with analyzing the kalman filter results (innovation error) and filter performance.
The model predictive control (MPC) design was implemented in Python and then the states/inputs were exported to MATLAB via a csv file, then loaded onto FlightGear.
A linear MPC formulation is developed for both longitudinal and lateral modes (where there is coupling between the two), via constrained quadratic programming QP.
The simulation shows that due to the inherent MIMO coupling of inputs, some of the controlled variables exhibit overshoot.
However, the actuator position and rate constraints are satisfied, thereby demonstrating that the QP solver works well.
Furthermore, there is a limit on the maximum setpoints that can be used on the controlled variables. For instance,nthe maximum pitch angle which can be reached is 0.04 rad and -0.035 rad. This is due to the QP formulation itself.
Part 3 of my FlightGear video series is coming soon.
In this video I will be explaining the process of getting admitted to a fully funded Mechanical / Aerospace / other Engineering graduate degree (Master's and/or PhD) program at a Canadian University. This information also applies to other STEM majors (Physics, Math, Biology etc.).
I will be explaining admission requirements, deadlines, scholarships, opportunities and sources of funding, along with specific details about how a thesis based program works.
My Instagram: instagram.com/vinayak_desh My Website: vinayakd.comArduino Tutorial: Register Programming | Analog to Digital Conversion | Multiple ChannelsVDEngineering2020-05-07 | In this video I will be showing you how to use register level programming on Arduino, to perform analog to digital (ADC) conversion of multiple channels at once.
For this example, we will be using Pins A1, A3 and A5.
ADC involves tweaking registers such as ADCSRA, ADMUX and the Arduino prescaler.
The ADC conversion program results in a perfect voltage reading on the Arduino, where an RC filter is implemented, and an average of 100 samples is taken for each pin.
VDEngineering
My Instagram: instagram.com/vinayak_desh My Website: vinayakd.comC++ & Arduino Tutorial - Implement a Kalman Filter - For BeginnersVDEngineering2020-05-04 | In this video I will be showing you how to use C++ in order to develop a simple, fast Kalman Filter to remove noise from a sensor measurement.
TIMESTAMPS:
Kalman Filter Theory: 00:07 Probability Theory (Review): 03:23 Kalman Filter Equations: 06:09 C++ Tutorial: 08:18 Arduino Tutorial: 13:29
You will also learn how to implement this filter on an Arduino via a C++ function.
You will learn basic C++ techniques (functions, loops) along with the theory of the Kalman Filter method as well.
Thanks for watching and be sure to subscibe for more videos like this!
VDEngineering ~~My Udemy Courses on Motion Planning / Navigation / Trajectory Planning: udemy.com/course/autonomous-robots-nonholonomic-motion-planning-algorithms My Instagram: instagram.com/vinayak_desh My Website: vinayakd.comC++ Tutorial | Numerical Methods | Runge Kutta 4th Order - Solving Nonlinear EquationsVDEngineering2020-05-01 | In this video I will be showing you how to use C++ in order to solve a system of 2 nonlinear ordinary differential equations (ODEs), by using the Fourth Order Runge Kutta Numerical Method.
This is a follow up to the MATLAB RK4 video which I released a couple of years ago.
You will learn basic C++ techniques (functions, loops) along with the theory of the RK4 method as well.
Thanks for watching and be sure to subscibe for more videos like this!
VDEngineering ~~My Udemy Courses on Motion Planning / Navigation / Trajectory Planning: udemy.com/course/autonomous-robots-nonholonomic-motion-planning-algorithms My Instagram: instagram.com/vinayak_desh My Website: vinayakd.comANSYS Tutorial: Quick and Easy Nozzle Meshing for CFD SimulationsVDEngineering2020-04-03 | In today's video we will be using ANSYS Fluent CFD Meshing to develop a nice accurate 2D mesh for a nozzle. This can be used to obtain great CFD results. The relevant ANSYS tools you will learn are:
1) Face Meshing 2) 2D Geometry from SolidWorks 3) Mesh Control, Sizing and Face Splitting
The reason why a nozzle must be meshed accurately is to account for the throat velocity effects, change in Mach number from subsonic to supersonic, along with oblique and normal shocks, if they form inside the nozzle (this is dependant on the pressure ratio).
In today's video we will be using the Root Locus Method to design a control system for lateral flight control of a fixed wing aircraft. The topics you will learn are:
1) Root Locus 2) PID Control 3) Final Value Theorem 4) Steady State Error
For those of you who have me as a TA right now, feel free to email me if you have any questions.
Thanks for watching and have a good "quarantine period"!
Best wishes, Vinayak, VDEngineering
My Instagram: instagram.com/vinayak_desh My Website: vinayakd.comSteering Control Design for a Self Driving Car - MATLAB / Simulink TutorialVDEngineering2020-02-15 | #MATLAB #Simulink #Self-Driving #Autonomous
In this video we are going to be designing a discrete time Linear Quadratic Regulator (LQR) for a self-driving car steering system.
This video covers the following concepts central to control theory and controller design.
1) PID Control 2) LQR Control 3) Discrete and Continuous Control 4) Laplace and Z Domain 5) Discretization Methods: Step Invariance, Impulse Invariance, Zero Order Hold (ZOH) etc. 6) Samping and Pole Zero Matching 7) Linear Quadratic Integration (LQI) Control
I suggest you download the project files and go through the code yourself to grasp the concepts completely.
1) Using Variables 2) Matrices in Simulink 3) Subsystems 4) Scope 5) Matrix Multiplication 6) Integral action 7) Signal Re-routing 8) To stop a simulation 9) Converting Coordinates 10) Reading Excel Files 11) Writing to Excel Files 12) State Space Models 13) Matrix Norm 14) Matrix Rank 15) State Space to TF
All these tools can be found within the MATLAB tutorial documentation and the Simulink blocks can be found within the Library Browser.
Be sure to watch my other MATLAB, Simulink tutorials which go in-depth into these tools.
Best wishes, Vinayak
My Instagram: instagram.com/vinayak_desh My Website: vinayakd.comHow Do Rocket Engines Regulate Temperature - Regenerative Cooling Explained!VDEngineering2019-12-21 | #Rockets #Propulsion #NASA #Nozzle #Cooling #Regenerative
In this video we are going to talk about how rocket engines regulate their temperature by a process called Regenerative Cooling.
We will focus on liquid rockets as they produce an extremely high amount of thrust and impulse. The primary concepts which will be covered in this video are:
1) Area-Mach Relation 2) Isentropic Flow 3) Convective Heat Transfer 4) Sizing of cooling channels 5) Material strength vs temperature
The scientific references that I used to produce this video are as follows:
1) Crunch CFD for Cooling: crunch.craft-tech.com 2) researchgate.net/publication/321314974_Regenerative_cooling_of_liquid_ rocket_engine_thrust_chambers 3) Ulas, A., & Boysan, E. (2013). Numerical analysis of regenerative cooling in liquid propellant rocket engines. Aerospace Science and Technology, 24(1), 187-197. 4) Marchi CH, Laroca F, Silva AF, Hinckel JN. Numerical solutions of flows in rocket engines with regenerative cooling. Numerical Heat Transfer, Part A: Applications. 2004 Apr 1;45(7):699-717. 5) The Best Book on Rocket Propulsion: Sutton, George P., and Oscar Biblarz. Rocket propulsion elements. John Wiley & Sons, 2016.
Longitudinal Nonlinear Flight Dynamics and Control of an unstable Fighter Aircraft.
The equations of motion, stability derivatives, aerodynamic coefficients for a longitudinal motion of an aircraft are all computed using Simulink which provides quick turnaround time.
A linearized MIMO state space model is then developed using PID Loops to control both speed and pitch angle simultaneously
My Instagram: instagram.com/vinayak_desh My Website: vinayakd.comMultivariable (MIMO) Control Fundamentals: MATLAB & Simulink TutorialVDEngineering2019-11-10 | In this video we're going to look at the following concepts for multivariable control, using a 3-DOF longitudinal flight control model as an example:
1) MIMO state space models 2) State feedback 3) Observability 4) Controllability 5) Matlab and Simulink example
This video is a quick C++ tutorial on how to import files and scan data into an array (or various arrays), so you can perform mathematical operations on it. This can be very useful for aerodynamic coefficients, or working with external data obtained from another software. It is assumed you know the basics of programming and loops already. This C++ video covers:
1) fstream 2) stringstream (sstream) 3) vector (arrays) 4) opening and closing a file 5) cin / cout functions 6) vector push_back function 7) converting string to float (stof)