Posts

Introduction to Embedded Systems | What is Embedded System | Embedded System basics | How to learn Embedded C

Image
Embedded Systems Embedded systems are ubiquitous in today's world, from small consumer electronics to critical systems in automobiles and aircraft. Embedded C is a programming language used to develop software for embedded systems, and it is one of the most widely used languages for this purpose. If you are new to embedded programming, this post will help you understand what Embedded C is and how to get started with it. What is Embedded C? Embedded C is a variant of the C programming language that has been specifically designed for use in embedded systems. Embedded systems are computer systems that are designed to perform a specific task, and they are typically embedded within a larger system. Embedded C is a subset of the standard C language and includes additional features and syntax that make it easier to write code for embedded systems. Getting Started with Embedded C To get started with Embedded C, you will need a few things: - A Development Board: A development board is a sma

Simscape Library | HIL testing Simulation in Simulink | Simscape blocks and their application in Simulink | MATLAB/Simulink based simulated HIL testing

Image
   Source: MathWorks Website  Simscape Blocks Libraries According to MATLAB/Simulink documentation, the Simscape contains all those blocks that have some physical parameters that exist in real life for dynamic modelling of systems. For example we have electrical elements like transformer, diode, MOSFETs, whose transfer functions or state space modelling is not always possible. For that purpose Simulink provide a library with such blocks to model. It is generally divided into 5 main parts comprising of Electrical and Mechanical basic bodies of simulation. They are:  Electrical  Fluids  Driveline  Multibody  Utilities  Foundation Library These are further divided into many more categories but majority of the simulation verification of physical environment can be done by Foundation Library . This is again divided into the categories given in below image. Examples of some basic physical system 1. Spring Mass Damper System Let's have a spring mass damper system as shown in below figu

PID Controller in MATLAB/Simulink using Transfer Function approach | PID Controller in MATLAB | How to simulate PID Controller in Simulink

Image
Source: MathWorks Source: MathWorks   REVISION In previous blog, we saw what is control system , what is  PID controller and it's basic explanation. I really hope you all are familiar with all these concepts and now we can further go to MATLAB/Simulink application of this controller. Steps to Simulation It has always been observed that with low RAM or after internet connection, the MATLAB/Simulink become slow in functioning. The Simulink takes time to open, so using command line to open Simulink would be better. Command Line text for MATLAB Follow the steps after opening the blank Simulink Model now add the following blocks: 1. Transfer fcn 2.  Add block 3. Step 4.  PID block Now connect all this in given formation in this image Now open the transfer function block and configure it like this In this, the array of the numerator coefficients of  s², s and constant, must be written and same as for denominator as highlighted . Now open the PID controller block and given this dialog

Introduction to Control System | Application of Control System | Open Loop and Closed System | Types of Feedback systems

Image
Control System What is Control System? The control system is responsible for the behavioural response of any system with input and output ports. It deals with the response of any system with input conditions and corresponding output.  There are 2 types of systems: Continuous System (represented in s-plane and in Laplace form) Discrete System (represented in z-plane and in Z-transform) The input I(s) means continuous input signal and O(s) means continuous output signals to the system represented as H(s). The transfer function means the ratio of output to input in any domain. The transfer function equation  H(s) = O(s)/ I(s) This equation is for continuous form of system when the initial condition is 0. There are 2 types of loop system, i.e., a) open loop, b) closed loop system. The above H(s) system is an open loop system as it does not have any output connected to input. In the closed loop system, the input of the system is added with the output of the system. This is also called a

Introduction to PID Controller

PID Controller What is PID? PID stands for Proportional Integral Derivative controller. It is one of the modern controller technique that use negative feedback in order to have proper required output. To make it understand let me use some analogy of riding a bike. Let say we are riding a bike on a highway with some no rmal traffic. To accelerate, we will rotate the knob on the right handle, so the vehicle will accelerate in proportional to how much the knob is rotated at that time. This is known as Proportional controller . We increase and decrease the acceleration according to our need and proportionally with the help of knob. In this, we are maintaining our speed to move constantly on the path. Now, there is a hill the bike need to climb. In order to maintain the same speed, we quickly apply more acceleration to gain same speed on the hill so that the vehicle do not slow down. This is called as Derivative control. Whenever there is a large error in speed achievement, it can be ac