 Welcome all to using Python to give the last one Give the give give Scott some clapping So this talk is really about well, I guess it's more of a celebration the last talk was Excellent about the architecture and such like I guess this is a compliment in that we talk very little about the architecture But it's more about talking about the problem that we're solving And why we like using Python so much to solve it So I'm the technical director at lime jump. We've been going as a company proper for a couple of years This next slide So lime jump is a utility in the UK We're able to trade energy and the thing that we're interested today in his Aggregation services we're gonna talk a bit more about that in a minute, but we work with small companies In association with the national grid So the national grid in the UK own the high-voltage electricity network Just for England and Wales and they work to maintain that and also they try to keep supply and demand of Electricity balanced and that's kind of where we come in so if we go back to 1870 or 1933 in the UK when our first national Power network was created. You had big mostly coal powered power stations That created a large amount of power which was then distributed through high voltage lines across the country going into lower voltage lines Eventually down to big factories smaller factories and consumers now that worked well back in 1870 and 1930s, but Things are changing now We've got concerns about climate so we don't want to have big coal fired power stations or Other big stations for that matter and there are new types of power generation coming in like wind solar generation We've got some wave power and other things like aerobic and earth digestion where you use Waste food products and animal manure to generate gas which can then power engines which produce electricity and we've got landfill gas which is methane coming off Waste to produce electricity again and just now things like batteries are coming in so The power network has to change to meet these new challenges So this is the kind of thing that we're starting to see so we're getting a much more Distributed power system So you can see some solar panels and some aerobic digestion there All sorts of different ways of producing power and they're working on a much smaller scale the amount of electricity They generate is smaller. They don't come down these high voltage lines so much as more local systems, so we need to start controlling them more locally to Balance balance the grid, but really what do I mean by balancing the grid? so if you think back to the original power stations you had a big coal fire boiling water up turning it through turbines that would turn a huge shaft and then You go back to a magnetic field theory if you turn a shaft and magnetic field you can generate electricity And the speed of that shaft is proportional to the frequency of the AC current you get out so What we're trying to do is to keep this shaft moving at a constant velocity so we get 50 Hertz out So what we have to think is if there's too much load on this shaft say you've got Too many lights on or for example a power station is broken down Then this shaft is going to start slowing down because there's not enough power to push it the frequency of electricity will go down and vice versa if it's the middle of the night and no one's really using electricity and Suddenly the wind starts going very strongly in Scotland has happened sometimes you get too much wind power So there's more supply than demand and the frequency starts to go up So that's kind of summarized here. So When supply is able to demand which is where we want to be Everything is at 50 Hertz and then as supply is outstripped by demand the frequency goes down and when supply is higher than demand then the Frequency goes up and really what we're trying to do is to keep it within 49.5 and 50.5 in reality We keep it in a much tighter band than that, but when we start getting to these points then we start having problems Electronic equipment will stop working in some cases and if things get really bad you'll get a complete blackout and that's Really not what we want So that's where we come in so as I said earlier the national grid's job is to Balance supply and demand so they have products which we work with customers So we work with lots of small customers who aren't big enough to go to the national grid directly, so we Coordinate their response and then sell them as a group together to deliver different products to the national grid the one we've been working on for the last year or we've been starting to Implement for the last year with customers a static response So when things are getting quite bad so when frequency goes down to forty nine point seven or up to fifty point three We either get customers who produce electricity To turn things on if the frequency has gone low or if they use electricity We get them to turn things off and vice versa when the Frequency of the grid goes too high we get people who produce electricity to turn their production down or Customers who use electricity to turn their usage of electricity up I'm going to touch upon this a lot more and how we do that but then also in the future we're going to be starting to look at things like Dynamic products where we track the grid frequency so we keep it in a much tighter band And you get two seconds to respond to a change in grid frequency And then enhanced frequency response which is responding very quickly and that's coming out in the future In the next one to two years and there you have to respond to a change in grid frequency within one second So the only thing capable of doing that at the moment is to have a big battery and to turn the power output from the battery up and down So what exactly do we do and where does Python come in well because we're working with lots of small Customers we have to go and install a panel on each of their sites So this sits with generators or with factory equipment and we have a PLC in there a programmable logic controller, which is industrial Computer effectively that you can use for automation tasks We have data being back for a 3g modem. We have a quad core Raspberry Pi type device where all our Python sits At a customer site level and also we're starting to use things like Arduino's to Control and measure customer equipment and also we have power meters which sit on the Power lines out of equipment so that we can measure what's going on. Well, how much electricity they're producing And we do this we monitor power every second so we can see second by second how much power Customers producing or using We measure frequency on site so we know what's happening in terms of frequency on site ten times a second and We also measure what our system is doing ten times a second so we can keep a track of whether anything's performing properly now for those of you in the last talk this is a Very similar architecture to the one being discussed in the last talk. I'm not going to talk about it quite so much Other than to say that the data logger there is pure Python and everything to the right of it is also Pretty much Python except the front-end stuff And everything to the left of the data logger so that submit controllers and PLC is there in a mixture of C and PLC code which I'll show in a second which is some ladder logic and some programming by diagram really And then we've got industrial power meters which we communicate through a protocol called Modbus from the 1970s So we've got those connected to assets, and we can also control assets from there I should also point out the data log. It doesn't just log data also sets up the PLC so we can have a semi-autonomous response to to events so The PLC is the part that responds when frequency goes out of the spec that I was talking about earlier And it's also the PLC that that controls the output of an asset if we were to want to do dynamic or enhanced frequency response So that's kind of how we do things. Why do we use Python? Well, it's faster to develop This has been developed within two years really I think we've written virtually everything that's in production now within the last two years Which I come from a CNC plus plus background. I don't think we could have done this if would you see There's a huge selection of free libraries. I'm preaching to the converted. I guess with this, but It's transformed the way that we can do things, especially with things like Modbus and The testing I'm a big fan of pie tests So we use pie test in all our testing and I say lastly we use Python so I can come to Euro Python each year So where have we been having problems with Python? That's a good question. We haven't been having massive problems with Python We've been moving to a sync IO recently and we've cut down our load on our Embedded processes the process of the customer sites by five tenfold by using a sync IO. So That's been really great We think it's not quite as elegant as it could be that that seems to be changing a lot with each new Version of Python. So we're really enjoying using that. I guess the biggest problem we have is Finding good Python developers in London, which I'm sure lots of people can sympathize with So that's kind of really our Problems or all things that we've been using where would we like to use Python? well, as I said before I like to talk yesterday on the micro bit and starting to use Python in microprocessors The diagram on the right is part of the PLC software that I was talking about earlier I've spent days and days with our PLC suppliers debugging this software It's it's tricky. It's very very tricky. This is the kind of code you get You can't put test harnesses around it very easily. So you end up having to try and create every single situation by a mixture of Forcing variables within the program and creating the conditions with IO and hardware to try and test it It's going to respond how you wanted to respond in each way. So if anyone has any ideas for Getting us out of using PLCs Then I'd be really really pleased to hear them Especially if it's using Python. I was also say we've been using embedded controls with C but again That's not quite as nice Anyway So what are we going to do next? This is a test case from last week. I spoke about dynamic frequency response. So If you look at the second Graph down, you'll see this is a test profile with injected Into one of our panels. This is a battery site So this is a big solar panel array with a 800 kilowatt battery attached to it So the battery is charged up by the solar array during the day And then we can discharge it when the customer can get the best prices for the electricity So what we've done here is we've got a charged system. I should say SOC stands for state of charge So 140 actually means 70 percent charge for said to battery systems attached So what we've done is inject different frequencies into that and if you look at the top one the kilowatt out So that's the kilowatt output of the battery Mirrors the frequency so our frequency goes down the output of the battery goes up and tracks pretty much the frequency As it goes up and down and you can see the battery discharges and then charges again as we use their Brown different ways. So once we've done that our next job is going to be delivering dynamic response and which I haven't mentioned now This is a response at a local level. So this is just a battery responding to the grid What we're looking to do next as well is to have a Response across several pieces of equipment. So we might have an engine and a battery Maybe solar farms as well And what we're looking to do is have each one of them produce their own individual response Which when some together creates this kind of group response. This means that a lot more Customers can get involved in this program and we can give a larger Lump of responsive power to the national grid. So it kind of helps everyone And let's do some more Python as well That's it who has any questions Thanks for the talk What kind of scale is this running how many of these devices? So we had our first site installs last year. We're now in the tens of installs Probably by the end of the year we'll be moving up to hundreds of installs and on from there in terms of power sites range from about a hundred kilowatts for small sites up to a Couple of megawatts for big sites So if you compare that with a power station a power station might be 1300 megawatts, so we're we're rising very quickly So it's getting bigger and bigger. I'm not sure if I understood this correctly from what you said earlier, but is it the case that when Demand falls so much that the frequencies at risk of rising or or demand rises and the frequencies at risk of falling That you will get large users of electricity to use more or less Yeah, that's right and and is there a possibility of doing this not I guess you can do that with very easily with huge users but with embedded systems in all kinds of devices in people's homes you could presumably get ordinary things like fridges and Heating systems and so on to use more or less appropriately. Is that a possibility? Yeah. Yeah So we've started at the industrial scale because it's easier to have a viable business at that scale But as we refine our technology we can move into smaller and smaller producers So in the end hopefully yes, we'll be able to use home supplies So if you think of a fridge for instance a fridge is only on some of the time But if you had a thousand fridges, you could predict the base load that the Aggregated thousand fridges you so yeah. Yeah, that's definitely what we're aiming towards How much was security a consideration because I could imagine if these systems are hacked You could destabilize the power grid pretty easily. Um, yes Security is a big consideration. Yeah, so yeah, we can turn on and off these big batteries and engines So yeah, that is something we think about a lot Yeah, I don't want to talk about that bit too much Yeah So Is it the case that when the frequency drops you respond but what's What happens if you respond and somebody else responds and somebody else responds? Isn't there a risk? How do you how do you not like yo-yo that that is very true actually and has happened So we're all employed by the national grid so they know how much The response will be so they contract out a set response, but you're right It has been seen on a few occasions where everyone responds at once and you go from having low frequency to having high frequency So yeah, that's that's one for the national grid to sort out luckily but that's why they're moving to the Dynamic responses because of course they're much more granular so they correct things much more quickly so you don't get that Yo-yoing I should probably also mention that when we're moving away from these big Rotating shaft type systems the power generation the coal fired power stations We're losing a lot of inertia in the system, which is a stabilizing effect So a big shafts turning acts like a flywheel whereas we're things like wind They don't have a flywheel as such because they're electronic inverted So yeah as the UK reduces that we're gonna become more unstable So we have to be more careful to stop this swinging up and down a frequency Any more questions great Give yeah, I'll answer questions if anyone wants afterwards or yeah