 So friends, the last presentation for the day, it's CYLAB Arduino, so friends give a huge round of applause for them. Good evening everyone. Thank you, Mansa for making it so interesting and I hope We would also be able to match up that level though our presentation is quite simple. So our project topic was under CYLAB Arduino toolbox Which comes under Fossi group because now our mentors Rajesh sir, Mana sir and Samrod sir Here's our team Pabni Shukla, Sonal Singh, which is me, Sudhakar, Kiranmai, Tanmai had to leave early because of some other issues She had a workshop to attend So I'll give you an introduction Basic overview which consists of the introduction about open source Arduino, CYLAB, XCOS then the interfacing part of CYLAB and Arduino Then the main toolbox, CYLAB Arduino toolbox, which is used to link CYLAB with Arduino, the hardware Now XCOS blocks, then MPU-6050 block which was created by Kiranmai and Abhilasha So then in the end we'll explain you with a demo and we'll implement The Modbus protocol, which is a standard industrially used serial communication protocol Using CYLAB Arduino toolbox, it has not done before So open source as you all know has been divided in two parts, open source software and open source hardware Softwares are those parts whose source code is published and made available to the public Same is with the hardware The designs basically, they are free to study, modify and distribute to common people Arduino is the standard open source hardware And the board which we are using, it is Arduino 328, has 32 KB RAM And you have different memory spaces So you have different Arduino boards for that The development environment, the Arduino hardware that needs to be programmed using a special software That environment is Arduino IDE, Integrated Development Environment So now CYLAB, you all know it isn't because the previous all the demonstrations and all the presentations were upon CYLAB So it's a free and open source software for numerical computations It has very powerful computing environment It is almost compatible to MATLAB Though it is not exactly same as MATLAB Still it is developing and has excellent matrix manipulation capabilities and hundreds of inbuilt functions Then these are the list of things that you can do with MATLAB These one thing in each is a huge application and used widely in industries So MATLAB, why there is a need to replace or have an alternative for MATLAB Because it is really costly first of all But really useful, it is used widely in the industries But hardly people have a real like true original copy of MATLAB with them So there was a huge need for CYLAB introduction So now in CYLAB we have the graphical editor that is called as XCOS So this is basically for those who there are some people who are not from the computation and computing background They don't know coding So for them these blocks individually they represent the functions or it is like simulink in MATLAB There you have different blocks for your entities like power or sources So you just make circuit diagrams and then just execute it and do the same similar hardware connections And it will automatically run your code the same as it would write in a script of CYLAB So it can directly do it It is used for designing hybrid models and huge circuitries It is really good for those who can't code properly So in our CYLAB Arduino toolbox we have included this part also So Arduino being a hardware component and CYLAB software So one side we have open source software which is CYLAB Now the other side we have open source hardware which is Arduino So this combo is the best because you have open source and open source So Arduino IDE, though you have Arduino IDE you will say what is the need of CYLAB I can program an Arduino with an IDE So CYLAB as I told earlier for complex computations it is the best And Arduino IDE does not provide you with that much of wide range of applications In CYLAB you can just drop plots, do huge amount of processing of data and all Which are never given in Arduino IDE So how is this done? CYLAB does not provide you with direct serial communication with the Arduino board So what do you need to do is load a firmware in the Arduino board Arduino board only understands the Arduino IDE commands So it can only be programmed through Arduino IDE Because it has been inbuilt in the boot loader when you are programming the microcontroller There we can use only this software to program it So we are loading a firmware in Arduino board And the user is having a CYLAB interface The bridge which is the Arduino toolbox which we have developed The bridge is used to connect CYLAB to Arduino board So the commands which you were giving in Arduino IDE Those can be given through CYLAB interface using the toolbox Here the firmware maps the corresponding commands in CYLAB interface Like open serial port or close serial port to establish the serial communication Between your computer and a hardware board So that is done using Arduino toolbox Now these are the basic macros or you can say commands or functions Which are used in the Arduino which are there in the Arduino CYLAB Arduino toolbox We have this open serial, close serial These are used to the open serial command It opens the serial port for communication It takes some inputs as your Arduino number and port number and all board rate So the rate at which you are transferring the data Open serial, close serial and there is digital and digital All the things which are there in the Arduino IDE Have been replaced here with these commands And these had to be programmed and written So next we have XCOS blocks How those blocks the graphic user interface was made That would be explained by Kiran Mai Hi everyone Already Sonal has given a good description of the CYLAB So I will be giving the description about XCOS blocks And how do we create the XCOS blocks in CYLAB and Arduino toolbox So first of all when you open a XCOS we actually have two windows in it One is a palette browser and one one is XCOS editor window The palette browser is a window where actually we select the blocks And drag and put it into the XCOS editor And XCOS editor is where we actually have the simulation will be done in that window So coming to the creation of the blocks For creating blocks we actually need two functions One is an interfacing function and one more is a computational function Interfacing function is where the parameters size and size of the block are defined It is actually defined in the format of SCIFL Where the SCIFL is a format of doing the scripts in CYLAB And computational function actually defines the behavior of the block It can be defined meaning those functions are defined in either C or SCIFI file So these are the two windows One is a palette browser and XCOS and we can track the block And put it over the XCOS editing window and we can simulate the model As our project is about the CYLAB Arduino toolbox This is the Arduino toolbox which consists of configuration, digital, analog and motors Configuration actually consists of Arduino setup Where we actually have to give the card number Card number is like how many Arduino boards we are using And we have to give the compute number which is given by the shown on the PC And time sample is for the sampling period An Arduino scope is to view the plots And similarly we have digital, analog and motors with different blocks And I have created a block for MPU6050 Actually MPU6050 is a world's first 6-axis motion tracking device Where we have accelerometer and gyro sensor with digital motion processing It actually tracks the motion of a device So actually the accelerometer and the gyroscope is Both the sensors are directly embedded onto the MPU6050 And that is how it's really featured very high So this is the MPU6050 block This actually reads the coordinates of the device Like accelerometer will give us three values Either in the x, y, z direction That is given by the accelerometer Then the gyroscope will give the angular velocity of the device This is a simple basic application where we get the values From the MPU read using the MPU6050 So this is the x-coast block And these are the plots which I have got along YPR direction where YPR is nothing but yaw, pitch and roll Which gives values along side-by-side rotation And front-to-front rotation and front-to-back rotation And these are the values And as it is created on x-coast, I have created the same macro functions on Sylab also Which are three functions One is launch, read and stop Where launch will initialize the MPU6050 And read will read the values whatever is read by Arduino from MPU6050 And MPU6050 stop It will actually stop the acquisition of the MPU6050 It actually stops the values So this is a code which has three functions And this is the values which I have got A, Y, A, Z And one more application is like I can control the DC motor by using MPU6050 This is the x-coast block Where the motor runs from the speed of 255 to minus 255 And it actually selects based on the input of Meaning the changing of movement of MPU6050 as it controls So these are the plots which I have got And the next application will be done Good evening everyone I know some of you might have got saturated But now this is something really interesting So now what we did till now was that we told you about Sylab We told you about x-coast We even created a Sylab Arduino toolbox In order to connect Sylab with Arduino And we built a block and then demonstrated an application using it But the question which comes now is that Can this be used in industries Where large amount of equipments are required Can it be used? So for demonstrating that We have implemented the Modbus protocol So what we are doing here is that We are dealing with the Modbus protocol And we are using a master and a slave The master in our case is the Arduino And the slave is the energy meter So you might be wondering what is Modbus? So Modbus is an industrial serial communication protocol It is used to connect supervisory computer with RTU That is the remote terminal unit Now take an example of a cement industry Where there is limestone in one place Then it gets pulverized in another place So different raw materials are present in different small places But there is a control unit where everything is getting monitored So how will we know what is happening at each place? So SCADA or supervisory control and data acquisition Is done where there are many remote terminal units So for communicating with that We use the Modbus protocol So using Modbus protocol has many advantages For example we can monitor many remote terminal units And not just one Here as it is written We can monitor up to 247 slaves if we use the RS485 serial standard So here comes the question What is RS485 serial standard? RS485 standard is a recommended standard Which is used mostly in the case of Modbus protocol Now I know many of us know about RS232 So the maximum range we can use RS232 Is just 50 feet Now if we have in industries If we have long distance communication Then it is not possible to use RS232 Another reason we don't want RS232 is that It's not differential signal and hence There is a chance of the noise getting added there And the data transfer rate is also just 20 kb per second But if we use the RS485 serial standard As you can see here this is the RS485 module The data transfer rate is 100 kb per second And it can transfer up to 1200 meters Using RS232 we were getting just 50 feet And this is differential pairs of signal As you can see that is A and that is B Which is just G plus and D minus So the noise gets cancelled And multiple slaves can be used Using RS232 standard which we normally do We can communicate just through one unit And not through many units at a time But using this we can communicate multiple slaves So this is the RS485 module which we have used here It contains A and B for differential signals And then VCCN ground This is the main chip Max485 This is received output pin and data input pin Which is just RX and TX And receive enable and data enable Now how does Modbus protocol work? We will just take an example of a simple Master in slave system So there is a master It would initiate a request For example I want the value of voltage At one plant in some particular meter So I will initiate the request I would send it to a slave And then the slave will perform the action And then it would send another response And this response I will decode The master would get that response And then I will tell what the value exactly is So I guess you might be knowing That we can't send the request directly It has to be in some encrypted form Or in the form of packets So let us see just a brief intro To how the packet exactly looks like So for example the packet we send Is always of 8 bytes But the data we receive can be of variable bytes So if you see that, that is in hex So the first two digits correspond to one byte The first thing is that Since there can be multiple slaves We don't know which slave we are communicating Which slave we are communicating to So first is the slave ID In our case it is 11 Then the second is the function code Using Modbus protocol we can do many functionalities For example we can read the analog value We can read the digital value We can write in some digital coil Or analog coil So function code is 03 Which means we want to read the analog value Of some register And then 006b is the address Which tells the memory register Which we want to access And then after that the number of registers Which we want to access is 003 Now we have to note that each register is of Two bytes here And then 7687 is the CRC Or the cyclic redundancy check This tells if the data we have sent Is valid or not Mod will be told to you by Sudhakar Shortly So the packet we have received in this case Is 11 which is the slave ID Now since if there are multiple slaves So firstly the slave would check If the slave ID is matching or not If it's not matching then it would reject the packet So this is the slave ID Then 03 is the function code Then next to it is the number of bytes Since I told you That there are only three registers And each register consists of Two bytes each The number of bytes the data would consist of Would be six bytes And then there comes the byte received So you can see the six bytes of data And then there is the CRC Or the cyclic redundancy check So what we did was that We used an Arduino And we implemented Modbus protocol So here you can see the Arduino And which we have treated as A master in our case And there is the energy meter Which is the slave Now obviously we will connect it Through max 485 And you can see The Arduino is interfaced In our computer using Sylab And The hardware serial For example if you can see Most of you might have seen an Arduino So 0 and 1 pins correspond To the hardware serial of Arduino board So that we have connected That is automatically connected to the CPU But if we have to transfer Data to a slave We can't use those two pins Since they are already reserved For serial communication with CPU So we have Software serial pins So pin number 10 and 11 We declared them as software serial Using a library and then we used them And Max 485 is the chip we have used The Rx is connected To the Tx of Max 485 and the Tx to Rx of max 485 And then since We are operating it in half duplex mode So R, E and D Both the enables are shorted and connected To a controller control pin And this is then connected to the Energy meter The energy meter is then connected to the load Anything, bulb, fridge, anything This is just the flow chart of what I explained till now So we start with the serial communication With Arduino What we will do is that using Sylab We will send a packet to the Arduino Now that packet Is received by the Arduino Or the master The Arduino would send the packet to Energy meter The energy meter would See the packet And would send the value of The required registers back And then it would be sent to the Arduino And from the Arduino We will read it using Sylab So we have used Software serial and hardware serial So there had to be data transfer From hardware serial to Software serial Now after As you saw there The packet here Was in hex format But the values of analog Pins would be in Floating numbers for example 237.5 or something like that So how is it decoded So the value is 32 bit hex And it is converted To floating point using IEEE 745 Hex to Floating point conversion So now What exactly is energy meter The CRC checking and this conversion Would be explained to you by Sudhakar Thank you Good evening to one and all So everything is explained by our Taiment Steel now So as Babani has already explained that We are treating our Arduino as a master And energy meter as a slave So here the energy meter which we have used Is brought to by Sinaito Electric India It is basically a three phase electrical instrumentation And this is the picture Of that particular energy meter And there are various functionalities In that particular energy meter It measures the amount of electricity No doubt and apart from that it measures The various parameters like voltage Voltage from phase to neutral Line 1, 2, 2, 3, several factors And active power, reactive power Everything it measures And apart from that there are some interesting Functions like energy generator function Run dotage for example Run dotage just describes that from how much time The load is running And also the on dotage Which describes that from how much time The energy meter was on And in order to read the various parameters Like voltage, current, power We have to mention the different addresses So for example Voltage we have the address 3927 and in the same way For current there is a different address For power there is a different address So here I would like To just take the packet which we use For reading the voltage on our energy meter So here we have used the slave address 1 because there is only one slave here 03 is the function code for Read holding registers it is already specified By modbus protocol and here we have Mentioned the address 3927 Which is converted into hex first and then Sky coded and it is the 0f56 and after this the Number of registers to be read And then for error checking and all Those things CRC, cyclic energy check And here the LSB is taken first And in response to that particular Request the modbus sends Something like this here again The 01 is the slave address 03 is the function code for the total number Of byte set till now we Received all these things After a lot of trouble But despite of being here we had to face The problem because we are unable to decode This particular value for example In this case our value is 2921 And 4373 so it was Difficult that how to read this value In the usual format So we had to make the corrections I 754 norms and not only that Particular we had to read the value In little indian format So we just in little indian format We mention the LSB byte First and then higher byte It means that the LSB will be Stored in the lower address And the MSB will be stored In the higher address So our value was this much And after IEEE 754 norms And little indian format we get The value was 243.16 word Which we will be demonstrating it very soon Why don't you just go to the demo Sure sir That's what people are interested in They want to see lights flashing So sir all of us All of us write soft things we don't see anything You are the people who Show something to us I don't think you are any moving part Yes sir So let's go to the experimental setup Here this is the load And the Arduino Uno board Along with the max 485 Energy meter along with the this load Here all the connections are in parallel So we will be getting all the voltages Whether one load is on or the two load is on But in case of current and power The voltage will vary according to The loads number of loads We will be showing it So we would like to show it through the X-Cos blocks Which we have prepared Leading the value that is being shown On that snitter meter On your PC right Yes sir Without having to go there and call it out Yes sir So there is no load on and the value Of current is zero Now one load is being on and the value Of the current will be shown on the Sylab console Depending on the value you have received In Skylab you will take some decision Yes sir And then you will turn some play on and off You can use this ideas card system And we can use some control loop size well Because you have got two 47 slaves Yes sir we can connect You are only using one slave so far Yes sir right now we are using only one slave So all those three bulbs are slaves If the energy was more you would have turned them off No sir those three bulbs are serving as a load for the slave I know But if they were also slaves You could have turned them off Yes sir of course we can take action based on the value Correct Temperature like shown by the other program Yes sir We are having the value of current 0.27 mpa So as soon as we turn The second load on So the current will be doubled So the current is just doubled And in the similar way we can so forth The third load as well And likewise we can so the voltage And the power which is being consumed by the load If we hand it to them Like I told somebody The missile will go in a different place They are floating point error Okay so now we can So the power as well Yes so four Two loads it is and Similarly it can be Spread for the three loads as well And in case of voltage there will be no change Because all the connections are made in parallel We have to change the buttons for this So it is one thirty three point eight Approx and In the similar way we can so the voltage as well Basically you measured The second reading That is power By changing something Yes sir we are sending the packets from Sylab The packets Do you change the thing to in Skylab here Yes sir And that send the That send the signal to your Aadi Yes sir We said now I want the power Yes sir here Aadi will be a master And it will be transferring the packet to the slave And slave in turn will respond This system can be basically So this system can be designed for developing SCADA like systems and for control systems As well Let us break Yes sir it is almost our Just one or two Let me tell you something These four guys Who are not even engineers Have gone and conducted a workshop Those batches they see are not I don't have a batch you don't have a batch Some of them are organisers And some of them have Already I think one of I saw a speaker batch somewhere You see already Before boring us she has bored somebody else Okay And all the experiments which we had conducted During these Show that This has been already compiled in a book with the help of Condenser Really a privilege for all of us We all got a chance to become authors in this Your name is there no It is not actually It is actually condenser's book And we have just co-authored it We have just helped him It was actually his idea to conduct the workshop It was actually his experiment He has designed them we have just helped him with those We have just co-authored the book Which We were all busy since Morning over there and We have worked really it's like This and that workshop They have gone parallelly they were together So these are the Few hours before One hour before these pictures Condenser is taking the workshop He is having this talk In lecture hall 102 So we were all busy over there And then We managed to And a big thank you to Kandan Margalyar sir Then Fatak sir And NK Khosla sir The Modbus idea was his Rajesh Khoshalkar sir without him It would not have been possible Some road sir and Manas sir without your help We used to stay in lab Like overnight because the Modbus Part was not working we didn't know how to Crack that thing The slave idea and everything we didn't know No one had studied it No one had studied it from Like this basic as we did Because there was no documentation on it And even the excise block part That we found only one paper on it How to make it So we started everything from the very beginning And that's why the slides are so many Because we were told to document it So sorry to bore you with that But then those parts were necessary So that the people who come after us They get the things ready Yeah thank you thank you Thank you very much So finally it was a great day With all such great projects I request everyone to give a round of applause For yourself For such a good presentation We all have to gather again At 8.15 I suppose it's already 8.15 To Gulmohar third floor For this certificate distribution By professor D.B. Patak sir Followed by our dinner Lastly I would like to thank All our dignitaries Mentors and all the summer interns Thank you thank you everyone I wanna miss you all Thank you