Frequency and Peak Voltage Monitoring during 5th April 9pm Load Surges

Introduction

The world is currently going through a crisis due to Corona Virus (CoViD-19). India is on a lock-down which means all industries, except essential services, have been temporarily closed. People are advised to stay at home and not venture outside unnecessarily. Electrical Power is one of the essential services and hence all the Power System Engineers are on duty even during the lock-down. But 5th April 9pm activity posed a serious threat to the National Grid, if not managed properly. As per the PM’s address to the nation, people were advised to switch off their lights (not all appliances) and light candles, diyas or flashlights from their balcony. This activity is timed for 9 minutes after which all the lights have to be switched on. What this means from Power system point of view is a sudden load removal of around 32GW all over India (as per the data given after the event) in a short span of 3-4 minutes and then load increase by almost the same amount in almost the same time. Whats even more challenging is that the 32GW value wasn’t known beforehand and preparations had to be done based on some estimates which predicted around 12GW change but reality is stranger than estimates.

This event was different from normal days. You might wonder that people anyways switch off the lights when going to sleep and switch on the lights in the evening. But the difference here is the synchronization. People normally switch off/on their lights or other loads at quite random times which reduces the steepness of this surge. There is a difference between reducing say 10GW in 20 mins and between reducing the same 10GW demand in 3 minutes. This steep slope needs action from some peak load plants like Hydro, Gas, Diesel etc where demand can be matched in a matter of seconds. Some base load plants like Coal Thermal plants, Nuclear plants or Solar/Wind plants do not offer such flexibility. Since this was a planned event, the engineers were already mapping out a plan to stabilize the grid. Adding to these troubles, the shutdown of most Industrial loads during lock-down also meant that the lighting load is quite significant part of the total load. Otherwise, Industrial loads overpower domestic loads.

Entire India forms a big connected grid running at a nominal frequency of 50Hz. The frequency has to be maintained between a small tolerance band of 49.5Hz to 50.5Hz (or 1%). If frequency changes too much it will start affecting every appliance like the speed of your fan or the motors in the industries. This frequency is directly linked with the speed of the turbine-generator set in the Power plants across the country. If the load demand decreases, the Power plants are generating more energy than needed, so the generator starts running at faster speed and hence the frequency rises. If the load is more than the generation, then the generators slow down and hence the frequency falls. And such speed changes are happening to these highly massive mechanical structures hence even small changes means a lot. In this particular case, the transients were of concern.

The Setup

I made a setup to log the frequency and the peak voltage for each cycle from the Plug point. The setup can be divided into 3 parts:

  1. Data capturing
  2. Data Logging
  3. Plotting

Data Capturing

For this part, I designed a simple circuit on the breadboard.The circuit diagram is shown for reference.

circuit
Circuit Diagram of the setup

Let us go step by step. The first step is rectification and attenuation. For this I used a 1N4007 Diode followed by a potential divider of 2.2Mohm and 27kOhm. This approximately attenuates the voltage by a factor of approximately 0.01x which means that a 500V peak would be converted to 5V peak which is perfect for our electronic circuit. Also the negative voltage part is clipped by the diode to 0V. The waveform after this step is like this (note that y axis has been scaled appropriately):

Half Wave Rectified Sine

Half Wave Rectified Sine wave

The next part is a Schmitt trigger circuit that converts the Half Sine wave into rectangular pulses. This eases our frequency calculation process. The OPAMP used is LM358. I have used this design for single supply OPAMP: https://electronics.stackexchange.com/a/109285 I used the calculator suggested in this link and got the following results:

SchmittCircuit

The calculations for resistor value for desired triggering voltages

This is an inverted Schmitt trigger. As soon as the attenuated waveform goes below 0.19V, the Schmitt trigger sets the output High. Now the trigger point is changed to 1.05V and hence some minor noise will not produce any troubles. Now the waveform has to rise above 1.05V, then the Schmitt trigger output goes Low, and again the new trigger point now becomes 0.19V. The actual results were plotted and were satisfactory:

Schmitt

Actual working Schmitt trigger plot

So now we just need to find the frequency of this pulse. For doing this, the pulse is given to Digital pin 2 of the Arduino Nano and in the program a RISING interrupt is set-up. On every positive edge of the pulse, the time in microseconds is noted and previously noted (for previous edge) time value is subtracted. Then 1000000/t gives us the frequency in Hz.

The next part is to capture the peak. So I supplied the Attenuated voltage output of potential divider to the Analog Read pin A0 of the Arduino Board. The ADC on the Arduino is a 10 bit ADC which means that 5V corresponds to 1023 reading on the Arduino. A factor of (5/1024)*Reading*(2227/27)=0.4027 must be multiplied with the reading to get actual voltage value. Due to tolerances in resistance value and loading effect, I had to calibrate the setup to get the correct value which was 0.4275. So reading*0.4275 gives the actual voltage value. The calibration was done by reading RMS value on a standard Multimeter and then calculating the peak value using a factor of sqrt(2) for sine wave and comparing it with the ADC output. As seen in this figure the factor gives good results:

MultimeterandLaptop

Calibration setup

The multimeter gives the RMS value as 252V, Arduino calculates peak of 351V. Since 252*sqrt(2)=356V Peak, the result is very close.

Peak is calculated by comparing the new reading to previously calculated peak value. Initial value is set as 0 for the start of each cycle (in the ISR for frequency calculation)

Circuit_setupo

The complete capturing setup

Circuit_top

Data Logging

The Frequency and Peak for each cycle is sent via Serial communication to the laptop. This data is logged and saved in the form of a CSV file. A Python script was setup to start capturing the data at exactly 8:55pm and stop at 9:15pm. The current time is also logged corresponding to each reading. Even after 9:15 the data is logged until the user intervenes but it is saved in a different file. Total 60165 points were logged in 20 minutes.

Data Plotting

The data was plotted using Google Sheets. A smooth line graph was made to observe the trend.

The Results

The result were great thanks to all the people working across the country to achieve the stability.

Looking at the frequency graph, we can observe that the Grid was initially running at rock bottom frequency of around 49.8 Hz. This was done by reducing the generation so that as soon as lighting load is removed at 9pm, the frequency rise is within safe limits and offers enough time for proper control. As seen from the graph the maximum frequency went to about 50.3 Hz for a very short time, and more or less was contained below 50.25Hz. At around 9:10pm we see a decrease in frequency. This is due to addition of lighting load back to the system, and at this time the generation would have been ramped up to meet the demand. That is why the frequency remains very close to 50Hz.

 

Variation of Frequency on 5th April 9pm

The Peak voltage also rises as the loads are removed and falls again when they are added back. It also remains within safe limits of 322V to 334V.

Peak Voltage v_s Time on 5th April 9pm

Do not forget to check these Important Links:

Projects List

These are a list of Projects made by me (Himanshu Verma):

Recent Projects:

  • From Nand to Tetris part -1
  • B.Tech projects in chronological order:

     

    School Projects in chronological order:

    Music Visualizer

    Music has been quite a dragging force for many advancements in the electronics field. Take for example one of the first popular consumer electronics device: The Radio Set. There was even a magazine named “Radio-Electronics”.

    A Music Visualizer is a device that creates some sort of imagery in-sync with the music being played. Windows Media Player and WinAmp have quite fancy ones too but the traditional bar type music visualizer has not lost its charm yet. It started to appear in the earliest of Radio sets. The basic principle is that each column reacts to a frequency band. For a normal user the visualizations are just an eye candy, but it contains information about the amplitude of different frequency levels, just in case someone wants to know that. As crazy as it may sound, there are even t-shirts with music visualizer.

    So for our Integrated Electronics Lab project we decided to go for making a music visualizer.

    The team: Ganesh Bhagawat, Abhishek Bhargava, Himanshu Verma

    First, we took input from an electret microphone and amplified it using an op-amp based amplifier (Gain = 200). Then we planned to have analog filters for 4 different ranges of frequency (approximately):

    • <500 Hz
    • 500-2000 Hz
    • 2000-4000 Hz
    • >4000 Hz

    For this part we designed a PCB in EAGLE. It also includes a regulated dual power supply.

    The PCB

     

    Traces on the PCB

    The output of each filter would then be passed through envelope detectors to detect the amplitude of level without fluctuating. The diode used was a Schottky diode due to better frequency response and lower forward voltage drop. The output from envelope detectors is passed onto 4 channels of the ADC. The analog value is hence converted to a digital value and can be read by a digital circuit now.

    For designing he digital circuit, we used Verilog HDL. Implementation is done on a MimasV2 FPGA board. The digital circuit controls the 8 X 8 LED matrix based on the level at each of the channels of the ADC. Since we have only 8 levels to show we used only the 3 MSB side bits of the ADC0808.

    MVall
    The complete setup

    Here is a video of the setup working: https://www.youtube.com/watch?v=ZJlJN1vSaHo

     

    I can’t dance but this robot can (well… somewhat)

    It was going to be the second time that our school was organizing an inter-school technical competition , B.O.T. (Battle of Titans), as they named it.  This was also the last time I could be a part of it (well, unless I’d fail my 12th final board exams 😛 ). The previous year, our school partnered with RoboSpecies and conducted a free kick-starter robotics workshop so that we could represent our school as an organizer side team in B.O.T., and also participate in other such competitions conducted at other schools nearby. This is where I met and worked with people I could team up with. Now it was almost an year of tinkering, learning, making, participating, failing, trying and sometimes succeeding. But now it was time to try something different from competing with the other teams.

    I had a good teacher for Computer Science and my CS notebook had a lot of doodling, but the teacher won’t bother me as long as I finished the class-work on time. This is where I would pen down all my ideas and thoughts from the left half of my brain, although it would be a complete nightmare for anyone with even a slight artistic tinge. So I had been drawing versions of an overly simplified boxy humanoid and over several iterations adding description to various parts of it, turning it into something achievable. And then it stuck me, why not present a dancing robot similar to this design in the upcoming opening ceremony of BOT. The teacher approved the idea and now the only problem was the limited time available: around 3 days…

    dancing

    I teamed up with my friend and fellow volunteer for the event, Prashant. We knew it would be difficult. We would have to design the complete bot in school itself as transporting in school bus would be tough. So we separated it into two parts:

    • Head: This would be small but would contain all the power sources, and the major electronics including the micro-controller board ( we used Arduino Uno for this). This would be very difficult to design at school, so we thought of making this at home and then finally plugging it with the rest of the body. when both would be ready.
    • Body: This would be larger in size but functionally simple. Hence, it was to be designed in school itself.

    We started searching for boxes of appropriate size and found some in the labs. We also made a portable cardboard workstation where we kept all the tools for making the body. The next few days, we would move around searching for empty labs and classrooms for making the dancing bot. We could manage to get around one hour each day. The work at home would involve designing the hardware for the head, designing the song track to dance on and also choreographing and marking time of various instances on the track.

    It was now the opening day of the event and somehow the robot was still not ready to be presented so we requested to change the slot of performance for the closing day after awards distribution, hence gaining one more day. So after a bit of synchronizing here and there, it was ready to be presented. I didn’t know how the audience would react to it, would they like or or would it end up being a mistake that everyone would laugh upon? In the beginning, everyone was bored with the repetitive steps but somehow a few highlights and surprises saved the show. It was presented twice, and the audience liked it 🙂

    Here’s a video of it during the event: RoboDance

    Video credits: Varun Heta Singh

    OMR Grading Setup

    Every year RoboManipal conducts recruitment for freshers. More than 300 people show up for the preliminary test every year. Checking the answer sheets of each and every applicant manually is a tedious job. The whole team combined has to spend more than 5 hours to complete the job.Hence I planned to shift to Optical Mark Response(OMR) sheet. But the challenge was to make proper hardware setup and code for fast, convenient and error-free grading of sheets. The hardware is designed using wood and has a proper slot to place the sheet, a mount for the webcam and an LED strip based uniform lighting system controlled using a relay driven by Arduino as per commands from the laptop serial port. For the image circle position detection part, MATLAB is used as it is a powerful tool and is perfect for fast and easy implementation of ideas, thanks to its numerous in-built algorithms and functions.

    The setup of the scanner made of wood and aluminium extrusions

    Here’s a video of it working: https://youtu.be/Gtg08GoKv10

    I started by designing an OMR sheet. The corners have big circles for detecting the sheet position. It has been designed for 15 questions. Then I cut wood into shape for holding the sheet and use extrusions to raise height to place the webcam properly.
    The function of the MATLAB script is as follows:

    • Create webcam object
    • Send serial command to arduino to turn on the LED lights and make buzzing sound out of the speaker
    • Acquire image array from the camera and send serial command to turn off the lights and buzzer
    • Crop out rectangles from the top right and bottom left where the alignment dots probably would be
    • Detect circle position in the two cropped images. I used imfindcircles function that works flawlessly.
    • Transfer coordinates from cropped image to main image reference
    • Crop out the part of the image that contains tha answered circles using ratios calculated for one sample. This makes it independent of slight changes in camera height and sheet position.
    • Again use imfindcircles to detect circles in the answer region
    • Then the circles are classified into question number and option alphabet depending on their X and Y positions
    • Each option is given a weight and forms a binary number. So if someone marks options A and C, the answer number corresponding to that question gets the value 1*2^0 + 0 + 1*2^2 + 0 = 5
    • This number can be compared with the actual answer number stored in correct answer matrix. It can be used for single correct, multiple correct and is also fool-proof this way
    • As per the marking scheme (Single correct, +3 for correct, -1 for incorrect, 0 for no answer or multiple answers) the script also assigns marks for each question and calculates the sum to get total score
    • A final image is rendered to account for any errors. A user can manually confirm successful grading. The correct answer position is shown as blue box. The circles marked are encircled with red circles. The marks allotted are shown besides each question (+3 green, -1 red, 0 blue)
    • An in-built speech synthesizer is used to announce the score and also a few instructions in between.
    • The grading goes on as long as the user enters 1. It stops after the user enters 0 when prompted to.
    The final image to check for any errors

    Further improvement plans: The enrollment number can be read using OCR and we can create a database of marks.

    First year at MIT, Manipal- an experience worth sharing

    New Lecture Hall

    Okay, so you chose engineering, gave a few entrance tests and ended up joining some branch in MIT, Manipal. You may have dropped a year for JEE preparation. You may have opted SAT and tried for foreign universities as well. You may have found some of your uncles and aunties telling you that Manipal is famous just for notorious activities (but let me tell you, some of them still think that Manipal is in Manipur). At this point of time you may be slightly disappointed because you may not have got your dream college and apparently MU-OET wasn’t that tough. Don’t be!

    Let me share my story. I attempted IIT-JEE twice. To be frank, it is a challenging exam and securing a good rank is no less than winning a prize. Long story short, I would’ve got ECE in 2013 but I ended up with EEE in 2014 even after securing a better score, due to (let’s call it) Nadella effect. But I thought (partly due to the thinking developed during JEE prep) that the crowd at MIT won’t be great. But I was wrong and I’m happy that I was. I have found some amazing bunch of people here from different parts of the country, excelling in a few more fields than just engineering.

    The facilities you get in the institute are unparalleled. The hostels are better than what you could ask for in even the top IITs (Some hostels have AC and attached toilet with good furnishing). The labs are well-equipped, the faculty is helpful and friendly, the classrooms are big and well-lit. Basically, you will never have lack of facilities or opportunities. Undergrad students are actively involved in research projects and other competitive projects. The university funds a lot of student project teams like Formula Manipal, RoboManipal, Mars Rover Manipal, Parikshit, Project MANAS, Team Manipal Racing, SolarMobil, AeroMIT, just to name a few. There are also competitions like Provenance which could help you get the initial funding and an office you need for your start-up incubation. Major competitions like Microsoft Hackathon, INK Makathon, AngelHack, etc. are also held in the campus. If you’re into sports, the college offers good facilities and opportunities to compete in national level competitions. If you’re into dramatics, join AAINA or ADA to work with other amazing actors and develop your skills further. If you like to dance, you could join amazing teams like Blitzkreig. If you like playing an instrument, you could join MAFIA, or maybe form a band and perform. And yes, be ready for the applause! And just in case you feel left out, you could start your own club! We even have an Anime & Manga club in the institute.

    So, let’s get clear on this:

    The level of entrance exam of an institute is not the sole parameter to decide the worth of that institute.

    Never miss out on opportunities. First year is relatively easy to score and there is not too much to study, so you can devote time to other things you like.

    When you reach here, you’ll be greeted with a clean environment and lots of rain. To someone coming from a polluted city, it would seem like you suddenly shifted to HD world. Don’t worry it rains so much only for 2 months or so. After that it would be pleasant and it would be extremely sunny after February. The first stop you’ll probably notice is Tiger Circle. It’s close to KMC and is a major spot. This is also where you’ll catch most buses from. Then it would be time to do all the paper-work. This would take a day or two. You’ll be allotted a section and given the time-table. There are two different cycles you could be into depending on your branch- Physics cycle or Chemistry cycle. Your batch-mates would be an assortment of students from different branches. After that it’d be time to say goodbye to your parents, shift into your hostel room and start attending your lectures. The first few lectures would probably be just introductions to your fellow classmates. If its your first time staying in a hostel, you’d miss your parents and your home for a few days but the daily chores and new friendships will help you get over this.

    You’d get your laptops in a month’s time. Use this time to know your neighbors, classmates and places nearby (You could also catch pokémon). In not more than a month’s time, you’ll have your first sessionals, immediately after which you’ll get a one week teaching break (ask your seniors how much they miss this).

    The daily schedule would be varying as per your time table. 2 days would be full days and rest would be half days. Saturday is a working day. The number of classes per week for each subject is equal to the credits allotted to that subject. In general, morning lectures would be from 8-12:30 with 1 hour each per subject and a 30 minutes break in between(10-10:30). Afternoon lectures would be from 1 to 5:30 in a similar fashion. Morning labs would be from 8:30-11:30 and afternoon labs will be from 2-5. Full days will have Lab+Lectures and half days will have just labs or just lectures. You would get 4 meals per day: Breakfast, Lunch, High-Tea, Dinner. If you join a team/club, you’ll have to devote some time after classes to them as well.

    For the initial months, there would be a ban on interaction between seniors and juniors. After this ban is lifted, the various teams and clubs would one-by-one start recruiting freshers. Choose the teams/clubs you like and sit for the recruitment. If nothing, you’ll gain some experience. Don’t worry, the ones recruiting you would be your immediate seniors or third years. During October, there will be Techtatva. It will host various interesting and fun events. You could choose to be volunteers for some events, or participate in some events or both. Most of the technical competitions will help you gain practical knowledge in your field. Also, this could help you during tech-team recruitments.

    Not even a month later will you have the second sessionals. And then in a fortnight’s time be ready for the end sems. The excitement of reaching home after end sems will be your motivation to study for end sems. Take them a bit seriously. Your first semester’s GPA helps you get a better hostel in second year. If you’re a part of some project, you may have to stayback for a week or two. If you under-perform in some subjects, you also get to give make-up exams during this time. After a nice vacation, you’ll reach back college to get into your second semester.

    To shorten it up, this would be similar to the first semester except for a hot ‘n’ humid weather and different subjects. Instead of TechTatva, there will be Revels, which will help you showcase your artistic side. During Revels, there will be a Pro-show which would basically be a performance by some celebrity(or a few of them)[Farhan Akhtar, Nucleya, Sorabh Pant].  Also this semester would be your last chance to get your branch changed. Branch change is very random and cutoffs keep changing, so don’t be upset if you can’t switch.

    Subjects:

    • Physics cycle-
    1. Mathematics: Maths will suddenly seem to be a bit complex. But ultimately its not very hard and the questions in the exam would be more or less standard.
    2. Physics: Physics would be interesting and easy. It’d be easy to score, although relative grading may not let you get an A+ even at 90+ score.
    3. Basic Electronics: Some people find it the toughest subject. People with electronics background may find it easier. If you read the last two chapters of CBSE 12th physics with interest, this subject would be interesting.
    4. Mechanics of Solids: Easy if you liked mechanics. Although questions won’t always be dealt in SI units and there are a few new concepts as well.
    5. Basic Mechanical Engineering: This subjects will have a very few numericals and lots of theory.
    6. English: Easy. You may have to give presentations in class.
    7. Engineering graphics lab: Be ready to use all the stationery you have. Also second semester will have AutoCAD.
    8. Physics lab: Interesting experiments. Although maintaining the lab record could be boring.
    9. Workshop practice: The most interesting lab where you’ll get to do things in Mechanical, Electrical and Civil domains. Civil fieldwork may be a bit exhaustive.
    • Chemistry cycle-
    1. Mathematics
    2. Chemistry: The slides provided for chemistry have an interesting analogy with icebergs. The slides being just the tip of it. The footnotes- don’t miss them.
    3. EVS: Easy as you can make answers except for a few new things to learn. Lectures would mostly consist of watching short films or going for field trips.
    4. Problem Solving Using Computers: C++ programming. Very easy for those who had CS in 12th class. Others may find it difficult at first.
    5. Biology: Easy for PCMB students. Others may find it difficult. Video lectures will help you through this.
    6. Basic Electrical Technology: This subject may seem complex to some, initially. Also, this is the subject you buy your scientific calculator for.
    7. Engineering graphics
    8. Chem lab: Every experiment is of titration. Not really a great experience to have.
    9. PSUC lab: C++ coding using Turbo C compiler (the good old blue screen). Now it has been replaced with the CodeBlocks compiler.

    That’s all. Hope you enjoy your first year at MIT!

    I think this idea has ‘potential’

    This is not an Instructable. I won’t be describing ways to achieve what I have (actually I haven’t achieved much, I am still working on it). This blog will describe my journey about making a wireless power transfer device with acceptable efficiency.

    image

    It all started when the great visionary Nikola Tesla thought about transmitting power wirelessly. He couldn’t get his idea working and most of the people thought of this as a fancy idea rather than something that could be actually helpful. But the need emerged again as people got frustrated about charging all their handheld devices(plenty of them and increasing). It was around a century later that people started looking into this idea again.

    I had studied elementary physics. I knew I had to produce a varying flux using one coil and that would induce an emf in the neighbouring coil. Faraday’s law that is. But, how far can I go? How efficient would it be? I went to a winding shop in my neighbourhood, bought some enamelled copper wire and made a basic setup with two coils. I connected an LED to one coil and started shorting the other coil to a 6 V battery. I knew I can’t do it fast enough. The coil started heating up. But yes, the LED did glow!
    Now I started reading up on Wireless power transfer. I came to know about Resonant Inductive Coupling (RIC) which would give much more efficiency than the conventional setup. I remember seeing one school project on resonance where they had a few pendulums of different lengths on a single rope and moving a pendulum of some length moved the other pendulum with same length with maximum swing. I remembered how they have the example of child on a swing in the Physics textbook. In electrical it’s L(inductance) and C(capacitance) that make a system resonate at a frequency given by f=1/2π√(LC). Okay so I was about to test another setup now by adding a pair of capacitors on each side. I need a variable frequency function generator as well. I took the easiest way out by making a variable frequency square wave using an Arduino and amplifying the signal with a ULN 2003 IC (darlington pair array). I varied frequency and yes the glowing of the LED did depend on frequency of the signal applied. I got around 160KHz as the desired frequency. Now I was waiting to reach back college and test another setup with a function generator and oscilloscope in the lab.

    Incomplete…

    Design a site like this with WordPress.com
    Get started