 Welcome back. The first project is the Sandhi, mentored by Mr. Aviral Chandra. The project in charge is Mr. Kiran Kishore. Sandhi is a graphical programming language designed for control system simulations and real time system control. It offers simple abstraction and massive computing ability to the end user. Hello everyone. I am Rishabh from Project Sandhi, a part of the FOSSI team. Our group FOSSI is a group which aims at providing and enhancing the scope of open source software. So one of such attempts is our project, Project Sandhi which you can see is envisaged to be an open source alternative to LabVIEW. Now most of us are familiar with what LabVIEW does. It is a graphical programming software used for A, control simulations and B, data acquisition. So such things are very enticing on first look but when it comes to the cost factor, it is costly. It costs around 60,000 rupees and the renewal charges are around 10,000. So here is an open source attempt to bring down that charge and that cost of, obviously it will be free of cost. The essence of graphical programming is what we have tried to bring in our software. Well, what graphical programming is, it functions as a sequence of blocks. You connect blocks after blocks after blocks, create a flow graph and then generate the entire program. So you do not have to write a single piece of code for your software or program. So let me give you a slight demo so that you get an essence of what we are doing in Sandhi. So this is how our software looks Sandhi. Here you can see is the main pane. In this I have made a simple program of x raise to power y, a simple power function. As you can see here we have got a block, a power block which has got two inputs 25 and 2 as base and exponents and we have a number sync. That is sort of a printf statement in your command line. So when we execute it, we get the output 625. Alright, now we have incorporated the features of blocks and flow graph in our user interface. Now everything in Sandhi is in the form of blocks. It can range from as simple as an addition block to something as complex as a Kalman filter block. Everything will be in the form of blocks and they will be connected so that we get a total flow graph as our program. Now how we structured it? Well we obviously did not start from scratch. That is the beauty of open source. So we used a software called GNU radio. It is an open source software used in the field of digital signal processing. It also runs in the principles of blocks and flow graphs. So we took that as a basic platform for our software and then we expanded over it. We deployed more and more because and we chose this thing because it facilitated very robust system of block addition. So we can add to the functionalities of our software of GNU radio sorry and create something that is relevant to an entirely different domain, a domain of control engineering. Now GNU radio is coded entirely in C++ but it allows you to code in Python as well. But actually the control computations and calculations in control engineering are way complex than they normally are. So coding entirely everything in C++ and Python were out of time and a lot of lines of codes. So we took a workaround. We used the power of Sylab. It is another open source software which is taken as an alternative to MATLAB. So we have Sylab as a back end for doing all the computations. We have GNU radio in the front end for giving us a wonderful GUI and in middle we have Python to interface both of them. So the flow goes like we have a GNU radio software. The values are fed from this brought to Python workspace. Then these values are fed to Sylab and the Sylab returns the output and we then push it up to the mainframe. Now the purview of our work. Well we were four people. I have some earth with me. I have a Kansha with me and I have a noop with me. All of us were working on different modules. My task was to deploy more, more custom blocks so that they fit in the domain of control engineering. Summers was working on plots. A Kansha's work was in interfacing more and more hardware devices. Right now only one hardware devices were interfaced before we came. That was SBHS and she has been working on devising strategies of interfacing more and more hardware devices and then we had a noop who was working on interfacing this and the framework from browser. So the compile file that you saw there could be actually triggered from the browser and the output could be seen at any remote location and that's a larger aim of bringing this software forward in the field of virtual labs. So here is my task. First of all I begin deploying a generic Sylab block. What this block does is you give it any Sylab script. It will execute it for you and print the output or sorry dump the output into the flow graph. Now you would ask why code? Because it is meant to be a graphical programming software. But the answer is that right now it is in a very nascent stage of developing. We don't have all the blocks available for us. So a lot of things that should be done should not be delayed only because we don't have enough blocks. So for simple purposes you can use Sylab, take its output, fit into the flow graph and do whatever you want to do with it. Let's have an example of this. This is a very simple Sylab script quite similar to Matlab. Here I am printing and plotting a sine wave. This is the block and here we feed in the parameters. You can see I have mentioned the path of the Sylab file and I've also mentioned the variable whose values are to be dumped because you can have more than one value. You can have x, you can have y, you can have z. So the variable that you specify here, that value will be dumped to the flow graph and then here is a normal plot thing that plots the values for you. So these are the two blocks, two plots that we get. The first plot, this one is the one that has been generated by Sylab because Sylab also executes that flow of control and this is the values that have been dumped to the Python workspace to the flow graph. Well, this has to deal with plots. That is what we have done for the debugging purpose. If it is a real-time plot, what is changing here? I don't see 200, 400, 600, 800, 1000 changing. Sir, we are coming to that. That will come on the plot section on which he has worked. We have got a lot of plots. For the demonstration purpose, I have used this plot to show to you. He will come on to this when his part is there. So that was the generic Sylab block. This is the snapshot. Now let's come to Merdley order transition block for continuous simulation of a system. Well, before we came here, we had a block called C-Sim block that was used to simulate plant and controller dynamics together and simulate the entire system. Well, it worked totally fine. The only glitch with that block was that it supported only plants of order of transfer function of 1, but we wanted more. We can have it up to any level that we wanted. So we have now added functionalities to this block. We have made it in two versions. In the first version, you can specify the coefficients of the numerator and denominator of the transfer function. So if your transfer function is like a1x plus a2 upon b1x plus b2, you can specify the coefficients a1, a0, b1, b0. So that will define your transfer function. The other version is you can input the entire transfer function in the form of a string. Now, why did we have two versions? Well, the first version facilitates the use of sliders. So suppose in runtime you want to vary the value of some parameter, say b0. So we can have sliders and we can vary its value as per our needs. So that is why we had two blocks. Now the limitation with the version of coefficients is that it supports up to three order. And I think that is quite enough as per the contemporary needs are there. It can be expanded without any trouble. This is how the block looks. We have got these parameters. Definitely it looks ugly. If you want a beautiful version, you can insert the entire transfer function in the form of a string. Here is a polynomial plotter block. Often and on the people of control engineering and general electronics people, they would need to know the behavior of any polynomial, say x cube or x square anything in a given certain range. So this is the block that facilitates it. You just provide the value of the polynomial, the expression for the polynomial and you specify the range of values over which the plot has to be plotted. So the range for this is minus 40 to 40 and it plots it for you. This Crete time simulation block. I am pretty sure the people of electronics background must have heard about something called Z transform. Simulating systems are discrete timed. So this block simulates a system of discrete domain. Now the math behind it is something like this. So we have got a transfer function that defines your system. Then we have got an input in the form of in time domain. What we get as an output is another sine wave, another output signal in time domain that is the response of this system given the input. I will show you the working of this block. So this is the discrete time simulation block. Here is the transfer function I have fed. Again I have to fill in in the form of the coefficient. We have fed in the numerator, we have fed in the denominator and we have connected a input as an input and the plot thing plots it for us. This is the response. ECP will must be familiar with response. It will plot according to it sir. You give anything, it accepts only string values. It will pop out an error. You want me to type your name? It will simply not run. Sir we have not yet worked on the entire GUI fine. I do not know anything about control systems. Can you feed in some values which give me minus infinity and plus infinity as whatever the value of the plot? If you are giving it an input it will behave according to the output sir. Correct. So tell me I have generate some number there which creates minus infinity and plus infinity on the plot. Right and more or less sir whether the infinity is plotted or not is not our issue. It is the issue of the plot. All right. Everything that you I try. Definitely. As a user. Definitely. This is not my infinity and minus infinity. Well we have another block WX GUI sync that will plot all the things for you. Give me straight line. Whether you get an infinity or not depends on the transfer function that you are feeding. So I cannot because I am not a control engineer. So I cannot predict on which values we will get infinity. So we have sir we have tested it up to transfer functions of order 10 and we have got good enough plots. That is not good enough. Give something to the world. It has to be robust. Definitely. Robust means I should do everything including I think your point is very valid and we were confronted with the situation whether we should go on adding more and more functionalities or we should develop everything together entirely full proof. So we were guided in such a way that we had taken a step towards making things more and more functional. Right. As you can see the GUI is very cramped. Okay. It does not look very good. It has to be improved. So there are certain things that need to be done and beautified and more function and you know spreading of these things can be done. But right now we have just added more and more functionalities to this thing. You are a good talker. No, no, no, sir. That I can see. Okay. That does not absolve anyone from the responsibility of writing well tested code. Sir. And because of. That everybody knows who has worked. Definitely because of such interruptions by our guides we have been able to do this thing. This is good. Okay. Now Samath, it is your part. He will explain more about the plots. All right. Before I start, I would like to stress on the fact that it is still in the development phase. Everything that we worked on is in the development phase. And our focus was more on adding more functionality rather than giving something which can be given out as a product outside to the world. I basically dealt with plots in Sunday. The first one was my major task. I have been working on a generic plot block which would give you more or less anything that you try to plot. But again, there is as we found an error infinity. It does not show that you are plotting an infinity. So it is just in the development phase and then we are trying to accommodate more and more. Either we will shift to a plot because this plot is basically a real-time plot. You feed in values, it will plot real-time. That is what its main functionality as of now is. If it is a real-time plot, if I keep on feeding it 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, up to 1000, does my Y scale automatically change? Yes. It changes? Yeah. There is an auto zoom feature. There is a, there is also a feature. No, does it change? Yes, it does. So when after going up to 1 million, I start ramping it down. Does it change back? Yes. You can also view whatever happened at time t equal to 0 to till time t equal to 1 million. And you can view and it will fit whatever you have given in the screen, whatever range is there in the screen, it will demonstrate you according, it will scale it down accordingly. According to whatever is visible. Yeah. It will scale it down accordingly. Good. So, yeah. That is what I said. I have been working on something which is generic so that you can use it. And also, we have created two versions of it. And first of all, I would like to tell that initially when I started working on this, we had bugs. This module was already existing in Sandhi. And this thing had bugs. The first and foremost was that first of all, it was not giving you real-time plots. A window used to freeze. And that bug was fixed. And then, if you suppose want to change, if you have a slider and if you move the slider to adjust the values, then they were not getting deflected onto the plot. So, that is what we implemented. Now, again, it is capable of handling real-time plot. Now, it can plot the output from almost all the blocks. I would like to say, I forgot the part where it says almost all the blocks. Then there was a certain extra features added where one is auto zoom, the other is the history part. Like from t equal to 0 till t equal to 1 million, you can view the entire plot wherever it goes. If it is plotting real-time, you will be able to scroll it as and when the values are accommodated. So, this is a snapshot of the working of the plot-sync block. I will demonstrate that. So, this is how it works. So, you are getting the values. It is changing the scale accordingly. And then once, now this is the first version wherein after it reaches the end of the window, it will move forward and you will not be able to view what has happened in the past. So, this is for one use and that the other version is where you have the scroll bar functioning, you can view back and forth. Now, why do we need two plots? First of all, the Z-transform value, this interval where we are updating is very small. But then the Z-transform, the block that we had. Yeah. So, this is one version of it. The other version was where you have a scroll bar functioning and it gives you proper plots. So, that was the major work that I had. Now, the challenges that I faced was there was no proper documentation of GNU radio block. GNU radio software. So, we had no clue where to look for. First of all, I didn't know what the problem was. The problem was in a way defined as that the blotching block is not working. Now, we didn't know which files to look for, what to look for in those files and what to change. So, it took a good amount of time to can through all the files and find the files which are associated with the lot block, modify those files accordingly and then bring about the change and that is how we got it functioning. So, that was the entire work which is related to the blotching block. Now, the bode block. Now, from whatever I have learned about control systems in the past one-one-and-a-half month work, that everything revolves around transfer function. And you want to visualize some plant, a system, you model it using a transfer function. Now, transfer function looks like basically a polynomial function. Now, what you want to do is you want to see it using different plots and you want to like literally view it as a graph. So, that's what the bode and the plots, the blocks which I am going to demonstrate they will be doing. One is the bode plot. Now, why do we need the bode block? The first reason is that it is capable of plotting the frequency response of a given transfer function. Now, what is frequency response? You have an input, you have an output. Now, if you do a change, certain changes in the input, how is the output going to change? So, that's what the bode block represents. So, it has both magnitude and phase plots. It is something which belongs to the control engineering domain and if a control engineer is sitting here, then I am pretty sure it will be able to realize what exactly I am talking about. So, I will demonstrate this software is basically focused on work, control engineering domain. So, this is the input. You give it a normal transfer function which is in the form of polynomial. It is unlike what Richard had done, he had given coefficient and was looking bulky. But here, you just give it a polynomial and it will work. And again, this script is run using silas and if at all there is an error as if you give say a random string like Avinash, then the silab won't run it and then again, it will not work. It won't throw an error, but it won't work. This is again a screenshot. And since this is graphical, how do you handle unending loops? We don't have loops. There is no loop block as such as now in Sunday and in Sunday. Control systems normally have a feedback loop, no? That's what I am telling you that there is no functionality of loop as of now. We don't have, we haven't dealt with it. It's not our, we weren't assigned to work on that. It's somebody else who's worked on it and he's our mentor. So, we won't be able to comment anything on that. Yeah. So, this is again a snapshot of the Bode plot. Now, the Nyquist plot again, it's again a plot which is used to visualize the transfer function to assess its stability to find the region of conversion. It is similar, let somebody else talk about something. We will run out of time. We understand what you have done. Okay. So, then again, you have full zero block and then I would transfer it to, yeah. So, I'm Anup. I've worked on triggering these scripts to the browser what we just saw. So, initially I worked with the SBHS as a single board heater system. And the main aim was to access the graph, I mean give heat and fan values and generate the graph on the browser. So, here we have a three tier architecture. We have the client, the Google App Engine and server. And the server interfaces with the single board heater system. So, what happens is the client sends a request to Google App Engine. Google App Engine picks up the heat and fan values and forwards it to the server. The server sends the heat and fan values to the SBHS. The SBHS upon receiving heat and fan values starts changing its temperature values. These temperature values are picked up by the server and returned to Google App Engine, which returns it to the client. At the client side, we plot a graph using Google charts. So, this is the basic approach for handling the SBHS. Yeah. So, this is basically how we designed it. This is the client page where the client can enter heat and fan values using the knob input. And upon clicking submit, he gets a sample graph something like this, depending on the heat and fan values that was submitted. This is another graph that we got for a different heat and fan value. Now, we move to a remote triggering of the Sandhi framework. What we earlier dealt with was the SBHS. Now, we were looking at generating plots from Sandhi on the browser. So, the main objective was to be able to run Sandhi framework on receiving a request on the browser and sending back the actual plot onto the browser. So, what we have, this is the architecture we have used. We have a client and a server. And the server, client sends a request to server. Server makes use of an XML parser to modify the actual flow graph that was on the server. The server also maintains a mapping of different directories which contain flow graphs. And it invokes the appropriate flow graph depending on the incoming request. Once the request comes in, the server executes the flow graph and sends the response back to the client. And again at the client end, we use Google charts to render a graph. So, now we have the issues like sending parameters to the flow graph. Since our flow graph is already defined, we have to have some way to send parameters to the flow graph. Who designed the XML? That came with GNU radio. So, the GRC file itself is an XML file which we modify to send parameters. Yeah, so we modify the GRC file. The GRC file is basically an XML file. So, we modify the XML file and send the parameters that the user requested. And now we have to retrieve the file and send it back to Google charts. We faced with two situations. One is with the plot sync and one is with the file sync. In plot sync, the file is sent to STD out. So, that's where we pull it out of and send it to the browser. In a file sync, the values are pushed into a file that was defined on the server. So, we process that file to get the values. One sec. What about a T? Oh, both. Yeah, then you can pick it up from either place, because the same values are going to plot sync. Am I allowed to do both? Yeah, you are allowed to do both. Yeah, you are allowed to do both. This is the sample application of that. We have a client page where you can select a sync and the type of flow graph. Currently, it was only designed for two flow graphs, the square and the generic. So, in the square block, when I select square, it asks me for the vector values, which is 1, 2. I've given 1, 2, and minus 2. And then for now, we just have a static flow graph being displayed on the browser along with the plot. The GUI is in work in progress. So, this is the flow graph. This is exactly the flow graph that was there in Sandhi on the browser now. And this is the corresponding plot. So, you have 1, 2, and minus 2 being plotted repeatedly. Yeah, this is for the generic block now. In the generic block, you can also specify which function you want to use. Like, here I'm using the absolute function. You can also use sine, cos, etc. So, yeah, again, a flow graph is displayed. And this is a corresponding plot of the absolute function. Now, go to action. It asks us to deploy a block, a standalone block for a MIMO device. Up till now, only one device was interfaced with Sandhi, that is SBHS, and that single output device. But now, I was supposed to take up multiple input, multiple output device. So, the requirements were multiple port mapping, handling data from multiple channels, and we had a quadruple tank and reactors available that we could have interfaced. A quadruple tank system. It's a multi-variable control process in which we have six outputs and two inputs. The two inputs are fed to the two pumps, and we have to control the water levels in the two tanks. And the six outputs that we get are the four flows in the four tanks and the two water levels in the lower two tanks. The earlier approach that we took up was to use a DAC card to acquire data from the device and use comedy drivers to interface the device. A comedy block. We could deploy a comedy block in Sandhi, and then we could easily access the drivers to collect data from the sensors that are the output from the quadruple tank. DAC cards, data acquisition cards, function as a device that digitizes incoming analog signals, signal conditioning, interface sensor output with the system, comedy, control and measurement device interface that provides drivers for a variety of DAC cards. So, there's a list of cards that are already being interfaced and the drivers are available. Why did we choose Arduino? Because the DAC cards weren't available to us because of the ongoing research. So, we had to take up another approach for it. So, we used an Arduino to interface it because it provided with the six analog pins that could be helpful in acquiring data and the digital pins as well. So, we used serial communication then. We decided to take this up for acquiring data. Then interfacing Arduino and bringing it to Sandhi framework. Reading sensor values, we had to establish a serial communication. So, we started off by interfacing two sensors that the Hall effect sensor and the thermistor with the Arduino and finally bring it into Sandhi framework. So, our task was to first check that out. So, we decided to have a standalone block in Sandhi that could read the values from the sensor and then we could plot those values using plot sync. So, this is the diagrammatic representation of the same. We had the two sensors and we interfaced it with Arduino and then finally brought it to Sandhi framework. This is how the block looks like and these are the two values that were plotted from the two sensors, the Hall effect sensor and the thermistor. Interfacing, we had the same approach. Could then be followed for interfacing the quadruple tank as well, just like we interfaced two sensors. So, we could try the same thing with the quadruple tank sensors as well. The other thing that we did was facilitating sliders with SPHS. So, up till now, we had an SPHS block but we had to give feed-in values with separate blocks, the fan value and the heat value. But now we had sliders. We had sliders to input the fan value. So, this is how it looks like. We could just pass it as a parameter to the SPHS block and now the fan value could be changed from here itself. I would like to conclude with the future scope. First of all, the GUI doesn't look that good. So, the next task is to beautify this so that people use it because if it doesn't look good, nobody is willing to use it. The next task is to whatever functionality has been added has to be properly tested with almost all the inputs and considering boundary conditions and give out proper errors instead of code, I mean errors in the form of code. Next one would be facilitation of multi-channel plots and plots. As of now, you can only plot one source. What if you have two sources or three sources? What if you want to view all of them together at the same time and they're interrelated to each other? At that time, what you do is that the next thing that we can go forward for is a multi-channel plot thing. Now, again, we need to have more hardwares which need to be interfaced with Sandy so that this can be used across all the colleges as it is being planned to incorporate it with virtual labs. And the one more thing is that as of now, the security aspect of using Sandy via the browser is not touched upon. So, it'll be very, very good if it's secured because otherwise people, if it's not secured, you won't use it. So, that's the end of it. And I would like to tell you that five experiments as of now have been converted from LabView to Sandy using the tools that we have developed over the past one and a half months. So, that is there and that's it. I have one question. Is nothing similar available on the web? It is something which has been used, which has been forked from GitHub and we have modified that. But there is nothing similar for control engineering. For a particular aspect, I mean, when you're talking about control engineering, you don't have blocks as Kalman filter or Z transform or something, whole zero plots, four day plot. You don't have anything which can do such things. Now, what is the stage at which Sandy is there? Does the LabView product, for example, have a pump? And their graphical representation of pump is some rotating thing. Is that what it is? When you say my, our graphics is bad? Yes. The answer is yes. The LabView is at a level where you have, when you're talking about a plant. Where instead of a plot or instead of something, I have got, I can see that rotating animal or rotating pump or whatever it is. Whatever SbHS, I see a graphical view of SbHS. And apart from that, there is a temperature which says, is that what you are saying better? I'll tell you about the graphics. Suppose you have a knob. You can rotate that knob in, like, you can literally get the feel of rotating a knob when you are using LabView. But in our case, we just have a slider. You have to slide it. And there are various other functionalities which are there, like, which are graphically appealing to a user, which are there in LabView, which for a person who's working on it might not require, but they're appealing to the user because they look fancy. So that's what we're trying to tell you that our graphical user interface is not that, at that level where LabView is as of now. And also, if you click on a particular block of LabView, you can view what are the internals of the block. You can go deep. What if that block is composed of, say, sub-blocks, you can view what is there inside the sub-block to an extent or gives us. And when you say view, it means physical pictures. It's like you have a circuit. You can view the circuit diagram. Suppose you have an SPHS block and you have a lot thing. So you put a wire over there. So if I want to see what is there inside SPHS block as of now, you can't do that in this. But LabView, if it has an SPHS block, then it will allow you to do that, go into details to see exactly how it is. And one of you, when you say you are integrated, triggered using web, that is the first step towards giving a graphical representation on the client side so that I can use it to trigger the server and get the output. Is that what you're saying? When you said you integrated Sandeep with a browser, is that the first step towards giving me a client-based application with all the graphics? I can turn a knob. You will send a signal to Sandeep and get it back. That has to be done in Sandeep. This is just for remotely triggering the framework. Suppose you have the main aim was your virtual lab. So I'm sitting right here and I want to do an experiment with a device which is there in IIT Bombay. So now I want to give a heat and temperature value and I want to see the graph, but I don't have the device and I'm not even willing to pay for the device. So what exactly IIT Bombay was planning is to allocate a particular slot where you give a particular slot to a student and that student during that time will give a particular heat and fan value and he'll perform the experiment just by sitting at home and not with the actual hardware. So that was the purpose of giving it to a browser.