Hi guys and welcome back to another episode of our Pokemon vgc 2019 battle series. I hope you're all well It is Friday. So that means one thing we are ending the week up with this I got sober layer team that we played for the last couple of weeks and it's been so much fun I hope you've enjoyed it We've tweaked it a little bit along the way But we've had a lot of success with that we've been able to overcome a lot of the cause that we've had troubles with We've had some incredible games the last few days as well on the channel. We had Juan We had win more yesterday. So if you've missed any of the games from this week in particular Make sure you do go back up to here I'll put a card in for you to go back and look at those battles because they're definitely worth checking out this team It's been incredible. I've had so much fun playing it. I love Zygarde. I love so go layout as well They're both really good Pokemon But the one Pokemon that we did make a change to at the start of the week was the Raikuu and it is Really stood out as doing and a phenomenal job against all sorts of different threats that you see commonly in this format So something I would definitely suggest you trying out in in the future and the rest of this moon series Remember that we haven't got very long left in the moon series So after our teams that you would like to see played going into the last couple of weeks that we've got left before going to the Ultra series then do leave your comments down in the comment section below with requests And I'll try to cover as many of them as possible over the next couple of weeks But getting into today's episode guys without further ado, let's just hop on the battle spot ladder Let's get some music on Because what's better than music? Nothing. Anyway, and yes, if you enjoy this sort of content Make sure to leave a like do subscribe to the channel So you don't miss any of these daily battle series that we have coming out a guide series a flinch squad circuit Stream uploads and everything else and in between but we've gone straight into it with our first opponent of the day I met a lot So they are running a team of Incinero, Kyogre, Ludicor or Lunala Staka Taka and Tepcoco Right, what have we got? We've got the Kyogre. We've got the Lunala as the restricted pair here for my opponent They've got the partnering Pokemon support options there Ludicor are gonna be with its swift swim fast fake-out potential z move alongside that Lunala That could be the other user there got Incinero with the fake-out support as well intimidate support Staka Taka gonna be the trick room option on this team. We may see a trick room Lunala We can't discount that from my opponent and then the Tepcoco They're gonna have terrain control and really help everything out and function and get around sleep issues and stuff like that I think Raikyu's really nice here again Just because it's got that snarl that can really dent the opposing Lunala We've got the electric that's gonna really help us out especially if that leg trains up against the Kyogre We do need to be a bit careful against that Ludicolor, but we can play around that and manage our board position Well enough to kind of alleviate those issues. So I think what we'll do is we'll lead Raikyu and Hmm What do we do here? I kind of want to lead Finny, but I don't want to really overwrite the electric terrain if it comes out Because I want I'm gonna lead to toxic rock Finny and I think I'm gonna bring Zygarde as well as our last one in today's so Hopefully we didn't run out of time so I will go into it We'll see how we get on in this last episode today as we say have fun farewell To our Zygarde-Sogalaya squad It's done us really well. I mean we were up above the 1700s now. I think well we were but our last match Might have taken us just below that. We're close to it. We're gonna end up over 1700 today Hopefully I'm gonna see the tapu koko and the Lunala come up for my opponent We've got access to that fake out this first term, which is really nice and access to The snarl which is also really good But I think the one thing that I probably want to do is just snarl here and switch out tapu Toxic rock because it is threatened quite heavily from the Lunala side shock here It might mean losing the tapu finny, but we're gonna have to be really really Like precious with our toxic rock here We need to keep it for the Kyoga late game that stack attacker that could potentially be in the back as well The snarl is gonna be really useful for us We're gonna see the tapu koko switch out the stack attacker come on to the field probably feels pretty safe right now with the The toxic rock covered from this Lunala, especially if a side shock does come out from that slot We are gonna just get the misty terrain up with that type of finny though Overwrite that electric train which is pretty nice for us get this snarl off Which is gonna be useful into that Lunala break that shadow shield reduce the special attack there But we'll probably maybe even see a trick room come out from it this turn It wouldn't surprise me too much if we do and there it is There's a trick of room coming out from the Lunala. We have got that snarl off onto it Which is pretty useful and I Think now we really want to try and get their reflect up and hope we don't get Fear rock slid by this stack attacker And I'm just gonna throw out a heel pulse into Raikou as well just to try and get this this This reflect up We're just gonna see the Lunala switch out the tapu koko going to come back onto the field now get its electric train back up What we're gonna see the stack attacker do though. Is it just gonna rock slide? Yeah, it makes a lot of sense to tap a finny avoids which is which is good for us Hopefully like I say Raikou doesn't flinch We do without that. We'll get the heel pulse into Raikou. They'll kind of undo any of that damages already been done and We'll get the reflect up which is really really helpful It does pave the way now for us to get the zygote onto the field and I think I Kind of want to get Yeah, what I'm gonna do pull a double switch. I don't expect the koko to go into Raikou with an electric type attack. It's gonna go into the finny if anything and With the reflect up as well It does kind of alleviate some of the the dangers that we probably have otherwise switching in On a stack attack a rock slide that can be a bit threatening at times So we'll switch out with the Raikou get the toxic cocaine get zygote in for the type of finny Then the next turn we can get our tap of finny onto the field This stack attack is a little bit blind today dodging these rock slides all over just into the zygote Hopefully we see an electric type attack into this type of finny. We're gonna see the gig of old havoc Where's it gonna be? It's got to be into the finny. It has to be into the finny slot. It really does Let's see Yeah, it's into the zygote, which is a bit unfortunate. We get that call right But now what we'll do is get finny back onto the field get this misty terrain activated and I think Did we just throw a thousand hours out? We could see a potential why God here? And we could potentially just keep toxic cocaine and just and drain punch That's the other option because I don't feel like we're gonna go down to anything the coke We can throw out at us at z moves gone now drain punch You'll get the stack attacker and a thousand arrows will get the cocoa and it dents anything coming in on that slot cocoa Gonna switch out Gonna see Lunala come back in it's not gonna appreciate taking a thousand arrows unless the wide God comes out No, just a rock slide got to worry about flinches But we can potentially take down this stack attacker here, which would be ideal toxic hook flinched Of course Okay, what we need to do now is get the finny in now and get this misty seed boosted And then we can go for the thousand hours We've still got to be a bit careful around potential why God come out But like I say we want to keep the toxic rock for the late game when that coyote does make its appearance because no Undoubtedly will late game And if we can just remove these sort of things now, it's gonna help us to know and so the trick room is not gonna last forever We're gonna see the double trick room now really nice play for my opponent just to extend that I'm gonna be able to take that with the stack attacker Get the trick room and we're gonna see another trick room from the Lunala just to extend that even longer Yeah, I love this play That's fine. I mean we still got the reflect up which is good It really does help us out massively and what we'll do is Think we'll heal pulse zygod Well, we could swagger we could swagger Yeah, I think we'll swagger we'll get a bit greedy. We'll get greedy and go for a thousand hours There's a gyro ball. Where's it gonna be into zygod behind this reflect? Wow? Wow does way more damage than what I thought was gonna do we should have healed post Because moon guys beam it doesn't take us down and we will get our power construct form this next turn But and we'll probably take another moon guys beam to be honest. We get the stack attacker. We don't flinch there But in hindsight Maybe the heal pulse would have been a little bit more Would have been a little bit better We'll see the reflectors wear off now, but I mean it's fine now because The stuff that was like threatening us physically is gone And we are gonna get a super power Megazord form Zygod complete form coming out here. I Really want a shiny zygod as well. I really do I think shiny zygod looks great and it is Incineroar as the last lot So I mean we don't really have too much to worry about do we here and I Think what we'll do is we'll switch finny out Or do we I mean we could just stay in and go nature's madness and see Into the Incineroar and just protect here with zygod just to get around any potential fake out moon guys beam double up into the zygod slot There's a fake out. It's into the finny that makes a lot of sense. You know that the air and the size shock Okay into the zygod here But yeah now I mean we just we we can just heal pulse Zygod and go for that thousand arrows 1,000 arrows You turn coming out. I feel like Kyogre is gonna hit the field now Think from the damage that we took earlier from the moon guys beam. I don't feel Massively Massively at risk to go down to this so there's a side shock. I mean Yeah, we should take this pretty well Yeah, and thousand hours will get cocoa and the Lunali just hanging on But we'll get the seal pulse with our type of finny and zygod back in the game back in the game The trick room's not got too much longer I think one more turn so we just need to get around this fake out support And we'll be able to take both of these targets down and pick up a nice victory to kick us off today so there's the intimidate from the Incineroar and And Let's just go It's just got icy wind now with the tailwind ending and we'll protect even though that the fake out probably comes into the Top of finny here, but my opponent just forfeit So we take the first game very good game to my opponent and lovely way for us to kick off in today's episode. So we'll go into our next one and Hopefully we can finish with a win because that would be ideal for us to finish up this episode and this run with This squad because like I keep saying I've had such a good time playing it and it's been amazing Just being able to play this call that I've had so much fondness for since it was introduced in the Sun series So we will hop straight back on and look for an extra opponent So hopefully doesn't take too long to find the next opponent and we can like I say give this team The send off that it deserves. We'll just continue battling. I think we need to cross my vision, too don't we it's overkill a little bit, but We love doing it. Okay, and this this is perfect. We're on 1698 rating at the moment So if we win this one against max who's our next opponent, it will push us into the 7 here in hundreds Then we get that goal that we've wanted to do for the whole entire time.  We've got incinero star after we've got superior Mimic you go for alligator and tyranitar. So some really nice picks here It's a really favorite pokemon of mine as well. Obviously the for alligator is very cool Got all the starters there the firewater grass call We've got the mimic you there that can set up the trick room support that tyranitar got the star after that You have to be a little bit careful about it has got access to final gambit So we can't just take that lightly and I think what we'll do we need do we bring intimidate here?  You can get the mimic you tyranitar The incinero even it's just what we want to do against the star after we have to be a bit careful around the final gambit for sure and I'm gonna lead off with toxic rock It's a faster fake out that we've got access to I'm gonna bring incinero as well for the intimidate support and Do we bring raikou tapu finny or zygod you could bring zygod? Yeah, I think I think we'll bring oh we could bring tapu finny for the terrain control. It might be nice But now let's go zygod and let's not worry about a misty seed in this. It's a good luck to you my friend max Do a nice team skull hat on I feel like I need to extend this camera a little bit I keep looking at myself, and I'm like is the top my head cut off But it's not Could be it could be I don't know I need to sort the green screen out a little bit But hopefully you're enjoying it guys hopefully the aesthetically it looks it looks a lot better We've had a disconnect. She's a little bit sad, and our screens just went completely white So hopefully it comes back on in the mall if it doesn't I'll just cut I Think I don't know if it was us. It's weird. I don't know why it was us But it looks like it was us We're not gonna get that seventeen hundred which is just really heartbreaking because the team serves it And I really wanted to play max as well. I don't know how we got disconnected everything else on my computer No, it's not on our Wi-Fi Some reason my home Wi-Fi went completely kaput So that's why we got kicked out of that last game really unfortunate But we are back now with our second game So hopefully it doesn't take too long to get into it find our next opponent and finally say Adios to our team and a little bit unfortunate that we got kicked off though, and but we've got Marco Friero 1741 pirated player the next opponent so we'll go straight and we've got that team that we faced yesterday It's a tough one, but it will be a great challenge for us against that Lunala groud on tapu fini Serena insino and stack attacker. So what are we gonna do? We had we didn't have such a bad time against it yesterday We know it's gonna be a trick room Lunala We know the trick rooms there on the stack attacker the groud on is probably gonna be banded So we need to be very careful against that it's getting that reflect up with that with that Raikyu that we need to make sure that we are doing so I think we'll leave Raikyu. We will lead in Cinerol Hum, do we bring that? Yeah, we have to bring zygarde and tapu fini It was just such a good call yesterday. So I think that's what we're gonna do worked so well So I think we can we can quite happily lock in with those Four I do kind of feel like I want to bring so go Leo, but it has such a hard time against Lunala That maybe it's better just to leave it benched for this game. So we'll lock in and Go straight into it. So good luck to my opponent and hopefully it's a good one to end us off And hopefully we can get that win to kind of give the team the sendoff it deserves, you know We'll just see what happens So here we go What they're gonna lead off with gonna see Lunala for sure lead off With incineroid emerging Yeah, no no incinero. Let's see where the the the intimidate tickers tick over Because I do still feel like the incineroar potentially on my opponent's and could switch out into ground on But it could you turn as well. That's the other thing and I feel like you probably I Yeah, I'm gonna reflect Just to kind of alleviate that and I'm gonna fake out into The incinero mean it could snarl as well and then reflect the next turn Which is probably better. It's just if that plate works out. It makes it so difficult We could snarl here and just fake out into the incinero. I think yeah, we'll do that. We'll do that. Oh The opposing incident wins the speed tie. Okay, that's that's still fine because we still we still get the snarl off That's the main thing that is the main thing Okay, there could be it could be worse. It could be worse. Okay, we get the snarl onto the Lunala, which is good We see the trick room set up, which is fine. We know that we expect that So that's all it's all gold. It's all all right at the minute So we're gonna get a reflect up and we are gonna you turn out on to the opposing incinero Probably see the the Lunala switch out the ground on coming for the incinero Stack attack could come on to the field type of finny gonna hit the field It does mean again that we can get a zygote out. It's kind of playing out very similar to how it played out yesterday Gotta remember that the finny probably has his if it's kind of like the standard kind of build And we'll get zygote in so that's what we like to do But I think we need to go for a coil as early as possible and it's Now went in this ground on coming in And it makes it easier not having the stack attacker in the finny out instead Don't know gotta be careful about the ice and wind as well potentially ground. I'm gonna hit the field. She's fine I'm gonna start doing some work under this trick room But we need to preserve this right who right who's doing the work now It's getting out the reflect up that we need And we'll switch right who straight back out into incinero and we'll start We'll get the coil up because we need to we need to start throwing some damage out We haven't got the access to the swagger just yet So if you can get powered up a little bit and start chucking out thousand hours, it's gonna really help us Quite a lot in this game because we know how bulky ground on is generally so yeah Just stacking this reflect with this intimidate really nuturing this ground on Stopping its ability from able to do it as much damage. We do see a haze Which is not ideal Do have the reflector, but doesn't get rid of the reflector and There's no gravity here, so we do lose incinero, which is just not ideal at all We do get a coil We're just gonna see Here's this next turn if we can stall out these trick room terms it would be ideal for us Nitch is madness. What could we swagger? Could we swagger with Saigot? It just it feels like the Finney has to has to haze now So they're just getting damage onto the ground on which is the one thing that's really causing us lots of issues in just thousand hours Yeah, there's the haze once again So important that haze combination with the bounded the precipice blades So potent Okay, but like the reflect is the one thing that's like keeping us in this game really is We do like no damage back Which is ridiculous? The problem is now how many terms of trick room we got left one, okay? That's icy wind No, no, no, no, no. What is this Finney on? Okay, let's nature's madness This tap of Finney and let's protect I'm worried about a nature's madness coming into Saigot and then impressive as blades That's what I'm worried about more than anything So you can nature's madness to Finney then the next turn we can swagger Thousand arrows Then we don't care about you don't care about the the old haze then because we'll be able to get rid of the Finney Heal pulse, that's not what we want to see and it's not what we want to see Hopefully Finney can take this precipice blades. It might miss doesn't miss. Hopefully Finney takes this if not, we're done Okay, we take it a very warp Nature's madness. We're gonna lose our reflect soon as well. That's the other problem We're never gonna get the ground on. We're never gonna get the ground on I mean Finney takes another precipice blades. That's the the thing that we've got going for us So we could swagger and thousand arrows Well, I'm gonna switch out. So this is way better for us, especially when Lunala comes in and we can actually nab this with with a swagger No Are you kidding? Are you actually kidding the one time we needed to hit? And it misses now. We can't prevent the trick room going back up again. We just we can't This is really really sad.  So we're pretty screwed now And we can't swagger ourself anymore There's not really much we can do we can't deny the trick room and we can't stop the ground on coming back in now And this like there is nothing we can do We can get rid of the Finney But then it doesn't alleviate the problem of ground on coming back in and the trick room getting set up now with Lunala There's literally nothing we can do there is nothing we can do we can coil I guess but then we're not getting the Finney this turn and it's under trick room And it just keeps on heel pulsing.  Well, not the Lunala, but we get the kale We may get the kale onto it. I don't know. I don't know but without without doing that the heel pulse happened and Yes, it's not so good. It's not so good Could we could is it any potential chance? I mean Percippus blades can still miss for sure Let's try and get an HS minus onto this Lunala and just protect as I God. Let's not give up. I Do feel a little bit bad Just about let's swagger this It's self-restrainting stomping tantrum into the zygarde And here's the Z move. It's gonna be into Finney Yeah, so there's the Finney going down there and it leaves Raikou, poor Raikou to come in against the ground on with Percippus blades Takes away our option of your pulsing this stomping tantrum is gonna be Double power this next turn since it hit into that protect I mean the only thing we can oh well We can't even really I'd like an extreme speed. It's just not gonna be and not gonna cut it at all We can try a double protect we can try a double protect and might save our bacon. We're not gonna switch out Let's see type of Finney come back in But if the ground on sticks to that well, it is locked into stomping tantrum now Yeah, we don't get it. There's a stomping Oh, it's into it's into Raikou And I mean now it's just he'll pull city with the Finney just here pulsing for my opponent And I mean we can coil we can coil we can so do that like we'll take a stomping tantrum Yeah, but there's that I There's no there's no coming back from this now Banner Groudon it's just too nasty to deal with in this trick room environment when you haven't really got a trick room check I mean we get the coil But it's not really helping us now because the the haze just comes out this next turn anyway We do get the the power construct ability We had that one opportunity where we could have swaggered taking both things down and then the game would have been a Lot easier to close up for sure, but never mind. It doesn't always work like that Does it and We can thousand arrows and we could protect as well. That's the other thing. How many turns of trick room we got? We don't want to just give up There's only one turn of trick room, and I mean you do haze here if you're finny But 2000 hours, I mean we get a crit into the ground on it could change things completely couldn't it? You never know so stomping coming out There's so much damage does so much damage, which is not doing we're not doing enough damage I mean that's that the one problem you rely so heavily with zygote when you're playing It's a bulky rely on having swagger support with it And the trick room doesn't but we've got no way to take down this crowd and we can throw out one last ditch attempt to get this pesky finny but our finny was blind too blind to help us out today and The stomping times are gonna take us down. It's a little bit sad where to end the the match up But I mean it happens sometimes and you can't always compensate for that sort of stuff So a very good game to my opponent and again showing how strong that team is The the weird thing is though in both times. We've played this team like I don't feel like it's It's a terrible matchup. I feel like We can we can beat this team And it's just like how how sometimes the RNG roles we had the crit in The the first time round when we played it on as I go which really kind of crushed us and this time the swagger miss It does really punish us there. So it's just little things little things and we will be winning those matches I definitely do not think it's a bad matchup at all It's totally playable and it's because of the reflect on the right key when you're getting a set up You've got that snarl It's denying the the finny though and being able to kind of get through that first round of trick room And then you can attack things like we tried to do there, but Just goes a little bit wrong sometimes, but never mind But thank you so much for tuning in guys I hope you've enjoyed today's episode regardless of my whinging and but yeah, it's been a lot of fun and I hope you've Enjoyed seeing the so Galeos I got brought under the channel and featured It's been a lot of fun playing it and thank you so much for all the comments that we've had all the support We've had over the last two weeks and I really do hope you have had a good time seeing this team in action But we'll be back on Monday with a brand new surprise Featuring something brand new before we we go into the ultra series very soon So that is upon us and just have a great weekend guys Whatever you're up to make sure you're taking care of yourselves and I will see you for our next episode very soon So until then take care of yourselves and bye bye


Here we have the block schematic of the USB host as it's done with the OTG peripheral in STM32.  So again we have the core with the bus and the bus driver and the FIFO. The FIFO are divided different in this kind of application. Again we have one FIFO for the RX for receiving but then there are two additional FIFOs. One for non-periodic endpoints and second for the periodic endpoints. The periodic endpoints are isochronous and the interrupt endpoints. So it can be a bit get out of the nature of these types. And the endpoints are entered using the queues. So there is a non-periodic queue and a periodic queue. So if we have inside our host application something to be sent, it's put into the queue and one is get at the end of the queue. It's put to the FIFO and to the driver. Here it's also important to mention that the periodic queue have the priority before the non-periodic queue. So you are able to put on the bus something from the non-periodic queue only if there is nothing in the periodic queue. So that also make you sure that if you have the interrupt it will be on time the same with the isochronous transfer. Both need to wait. And host channels are then connected to the periodic queue according to the use transfer type. So now why we need to have multiple channel numbers and why the number is increasing, decreasing across the device and why we need to have these numbers. So for each endpoint you are connecting, you need to connect to some channel. So for example as we had the VCP device that are free endpoints, one interrupt, two bulk endpoints. So we need to have three channels to connect this interrupt and also then the control one. So we need three channels but we have for example 16. Because some devices like the GSM model I mentioned may be composite and composite with five UART. So they are demanding to have 15 channels to be used. Otherwise if you don't have enough channels you can connect also some of these devices or some of these UARTs. So in the past what I did so on some older devices I was able to connect maximally free virtual comport. So I have to pick among the pipes or among the interfaces from the device which are needed for the communication in my application for the purpose and which are not mandatory there. Also the channels are not statically allocated. You can relocate on fly but usually this is not done and there are no such examples in our library. So here is the similar picture like before with the device. So again we have the upper layer file so the USB host.c where I am able to see the user structures if the application is ready or it's disconnected. Inside of this file is intended to have the transmit and receive function callbacks and all the handling connected to the upper layers. Then there are the device drivers and middleware. So we already get up to this layer but inside of the core is the USB H process. So the process which is driving the enumeration, driving the connection which we need to call periodically. Then there are two functions. So for the control request and I request and for the host pipes which are the channels. This is common for all the host application no matter what is the class. And also from these functions we are calling then the class function. So from the core we are calling the class function. So we were able to see that from the process we call the CDC process. And if we want then send any kind of data or start the reception we need to go to the I request and to the pipes. These middleware layers are connected through the USB H configuration file where we have the settings of the number of endpoint, settings of the peripheral, settings of the GPIO interrupt and so on. Down to the whole drivers. So now during the reduction of the load on the bus we also touched the ACD.C. So the callback from the interrupt and there is one additional with the lower function of the peripheral. So this is already tightly connected to the device. And after that we go through the register access to the IP. So the hardware peripheral on the microcontroller which is notifying back using the register access and using the interrupts. And here we have the overall structure inside of the host machine. From this point of view it's look more or less heavy but we already were able to see almost all the structures and some of them we already modified. So for the first one this is the structure inside of the USB process. So we have here the state of the host machine, state of the enumeration and of some additional stuff. Also through this structure is connected the active class. So as you can see here it's prepared to support more classes. And here we are showing the active one and also the pipes so the channels work. So in the host state this tells us where we get during the USB host process. So either we are in the idle state and we are waiting for the connection. Once we get connection we go through the bouncing and detection through enumeration and detection of the class up to the host class. Inside here the functionality is passed to the class driver so in our case to the CDC. After that we can get also to the suspend so we decide to put the device into the raw power mode or to the abort. During the enumeration there are also values state. So as you see during the theory on the first day you need to get the device descriptor, set the address. Then you need to ask for the configuration descriptor. Optionally there are the string descriptor, product descriptor and serial number. So you obtain all this information and these are set in some other structure it will be shown later on. And once you are asking for the descriptor sending the data you are also in the value state. So first you are in the idle nothing is done. Then you need to send the request so put into the queue. But still you are still waiting for the confirmation that the request was received and you get the response. So you are in the wait before you can get back to idle and move to different state for example into enumeration or different state. Control type def. So this tells you which pipe you are using, where is your buffer, what is the length and the timer for timing the application. So for example to be able to put there some time out and don't get stuck completely if something is not responding. Control type def. Okay this is for example if you run already sent some type of request you were able to see also during the first day territory how the packet is put together what are the types of the field inside. So you see again value index request type. And the control line state. I think this is quite self explanation. So for what you are waiting on the state. So this branch here you are holding the data about the device you received from the descriptor. So the configuration. Otherwise you assign to the device speed on which it's communicating. Then if the device is exactly connected. For example this is change using the interrupt and then you are reading inside of the process. And then to another structure. So the device descriptor and configuration descriptor. And inside of these two descriptors you are holding the information about connected device. So that is also the reason why we need such a huge heap for the device to be sure that we will be able to put everything inside. So device descriptor configuration descriptor. So after then when the host process is checking if the connected device is compatible with the active class. It's checking with the configuration descriptor. So it's comparing the class number and the subclass number of the set and the one which are set using the defines. So this is different for the virtual comport. This is different for the HID for various type of application. Interface descriptor. So this is now directly about the connected interface and about the endpoint in the interface. Okay what is here. And this is the structure which contains all the class dependent structure. So we already show how to go through this process to the class process from the core process. So the connection between the core and the class itself. So here how it's go through the animation. So once we submit the URB. So this is already the low layer function. So it's just about the hardware. So this at the end send the data to the to the bus. And once we get the acknowledge via we get a interrupt. And in the type def we go through the state. And we need to check the state again in the process. So through the process and we can do the next operation defined by the process. So for the host reception it's a bit similar. Only that first we get we put only the in we get the data data acknowledge and after acknowledge. We trigger the interrupt is triggered and we can move on inside of the host machine. So here it's one more time described what I believe already showed during the CDC demonstration. So first we are in the host idle state and inside of the state we are only checking if there is any device connected. So nothing is connected check again nothing connected check again. But once we detect any any device we will reset and move to the next state. Then after we receive the interrupt that the peripheral detect the connection of the peripheral after reset. We again move to the next state. So we know now that there is the device attached. So we check the speed if it's full speed high speed low speed. Open the endpoint zero which is then taking care about the animation. What maybe I should also mention here that for the OTG full speed we have the full speed host. But the full speed host is also capable to connect the low speed devices low speed functions. But on the other hand it's not possible with the OTG full speed act as a low speed device. No in this case it's only full speed device but the full speed host is compatible with both of them. The same is true with the high speed. So the high speed with the external file is able to act only as a high speed device. But for the host functionality the host according to the specification have to be compatible with the lower standards. So the high speed need to be able to handle the high speed communication full speed communication and low speed communication. But if you go higher to the super speed super speed is not for super speed is not mandatory to handle the low speed. It's not mandatory but it's common. So back to the topic here. We check the speed. Open the endpoint zero and do animation start. So we are going through the all the step of the animation. So get the device descriptor configuration descriptor. And at the end the string descriptors and that lead us to the host configuration. In this step we check if the connected device or the class of the connected device is supported by our current active class. So we check if on our CDCVCP host is connected to CDCVCP device or the master edge. If it's master edge we are not able to go on. If not, if not, we go to the class request. So for the CDCVCP that's our request during the start. So the line coding and any other commands connected to the CDC class. And then we go to the host class. We already were able to see that inside of the host class we are calling the command so the machine of the middle layer of the CDC. So in the structure there we have the reception and transmit for example for the CDC may be different but here it's already class dependent. And from this we can only get to the, sorry, to the disconnection state or to the abort state if the device will store us. And if we go to the disconnection again we are moved to the idle. So this was again a bit more theoretical but at the end we were able to show that it's working like that in the library. I can believe that on first look it can be really strange but like for the CDC you have it here if you have any doubt what is connected how and not able to found inside of the code. You may use or to remember otherwise it's for the first touch not exactly needed but we like to mention it.


the last lecture we had looked at the small signal modeling for the DC machines. We derived the small signal models by assuming that there are disturbances to the inputs that are applied to the DC machine namely the voltage applied to the armature, the voltage applied to the field and to the load torque that may be there and in response to that the system responds with small disturbances in the flow of armature current, field current and in the speed and by assuming that the disturbances are small we derived equations that describe relationships between these disturbances and those are then the small signal equations of the DC machine. And we said that these small signal equations can then be used to derive relationships between a response considered as an output and a input that you may be applying for example the speed as the response and armature voltage as the input and we had said that we can look at those equations in the next lecture. So here it is we can see here the small signal equations of the DC machine you have d by dt of ?if that is the field change in the flow of field current d by dt of ?ia that is the change in the armature current and d by dt of ?r that is the change in the rotor speed. This is then related to the change in the field current armature current and the rotor speed and the input disturbances that may be there. So one can see that the change in the field current that flows is purely dependent upon the field excitation itself. So that is d ?if by dt is nothing but –rf by lf into ?if plus ?vf by lf. So that means it is not influenced by what is happening in the armature or on the mechanical system field is so to say independent. Whereas if you look at the change for that is d equation for d by dt of ?ia you see that it depends on the change in the field excitation due to this term –msr ?r by la multiplied by ?if. So the rate of change of armature flow of current depends upon what is happening in the field and of course –r a by la into ?ia which must definitely be there and then also it depends upon the change in rotor speed due to this term –msr if by la into ?r and the change in armature voltage itself ?va by la and you see here another aspect that the way in which d by dt of ia depends upon the change in field flow of current it is dependent on the speed at which the machine is operating. Therefore you have this ?r that appears here and similarly the manner in which d by dt of ?ia depends upon the change in speed is decided by the value of if at which the machine is operating. So these are therefore dependent upon at what speed you are looking at for the small signal model. Similarly d by dt of ?a if we look at then that is also dependent upon the change in field that is happening and it is dependent upon the armature flow of current that was there at steady state prior to the disturbances that are there and then here it also depends upon armature current change and that is dependent on how much field current was flowing prior to the disturbance and then –b by j into ?r itself and of course the input load torque disturbance that is there. So this is then the small signal equation for the separately excited DC machine and this equation has been written in the standard form where you have x dot is equal to ax plus bu. So this matrix then forms the a matrix this vector is the state vector and this matrix is the input matrix or b matrix and this is the input vector u and this is then x dot which is dx by dt in order to solve this and obtain the responses as dependent on the inputs you then recast this equation in the Laplace domain. So x dot then becomes s of x as we mentioned sometime back the initial conditions for the disturbances are 0 and therefore you do not have sx – x0. So the Laplace transform of x dot is s x and then you have ax this x is really a function of s and then bu is a function of s here x is a function of s that is the Laplace domain and then if you bring this term to the left hand side you can write this expression as s times u where u is the identity matrix u is the identity matrix. So s times u – a x is bu and therefore x itself can be derived as su – a inverse. So you take this left hand side term to the right multiplied by the inverse so su – a inverse b x u. So by looking at this expression one can then derive appropriate Laplace transform expressions for various elements of this vector x when subjected to the disturbances that are there in this vector u. So let us look at one specific example so if you look at that expression this is your vector x ?if as we have said before is the change in field current this is the change in armature current and this is the change in speed. So these Laplace transform expressions can then be written as 1 over d times this description that is provided here multiplied by the vector of input u and this expression that shown here is nothing but s times u – a inverse that is what we had seen here su – a inverse so when expanded that is what it looks like this that is what it looks like and d itself is shown here s plus rf by lf x s plus ra by la x s plus b by j plus msr2 x if2 by jla so you have a fairly big looking expression here so from this one can then extract whichever transfer function that we want transfer functions are basically ratio of a specific output variable Laplace transform of a certain output variable for example one can call it as ?if of s by ?vf of s. So if that is the one that we are looking at ?if of s is related to ?vf of s as is here by the first term that occurs in this su – a inverse and therefore ?if of s is nothing but the first term here divided by d x ?vf by lf and one can see that this term divided by d is nothing but the term here is the same as the one that is there in the square bracket and therefore ?if by vf would be nothing but 1 over lf x 1 by s plus rf by lf it is a simple expression even though this looks intimidating when you simplify it because this term what is here is identical to the term inside the square bracket here and therefore that is removed what you are left with is s plus rf by lf. So in this manner one can derive any transfer function that we want for example if you want to look at the transfer function between if and armature voltage as the input you see that the term which relates the 2 is 0 that means if you change armature voltage field current is not going to be affected. Similarly if you look at the relationship between ?if and load torque that is applied there again it is 0 indicating that they are completely uncoupled whereas if you want to look at the term ?ia a change in ?ia will occur due to a change in ?vf because this first term is not 0 it can also occur due to a change in ?va because the second term is not 0 it can also occur due to a change in load torque because the third term is not 0 similarly one can also look at ?r moving on further if we look at a specific case which is what we wanted to look at in the last lecture. So this gives us the relationship between a change in the rotor speed and change to change in the voltage applied to the armature and that is described like this. Now you see that here this is dependent only on if that means the field current that was flowing prior to the disturbances if you say that the field current is kept fixed that it is not going to then this is independent of where it operates and therefore if you apply a change in armature voltage irrespective of the operating speed of the machine the manner in which the speed is going to respond to that change in armature voltage will always be same independent of at what speed the machine is operating you can see that this is independent of speed it is also independent of armature current so which therefore is a reflection of what is the load the machine is operating at at the time when you give the disturbance. So whether you are talking about a low load situation or a high load situation if there is a change in the armature voltage that is applied the machine will always behave in the same way. Now looking at this expression we know from the understanding of Laplace transforms that we have the manner in which the response is going to happen there are two aspects to it one is the variation with respect to time that means whether the response is going to be oscillatory that means if you change armature voltage a little whether the speed will oscillate and settle down to a new value or whether it will simply rise like that and settle down to a new value all that is the manner in which response is going to change with respect to time and that we know from our understanding of Laplace transforms that this is dependent on the poles of this transfer function poles of transfer function. So one looks at the roots of this equation and then dependent on the root depending on the roots root locations one can conclude how this system is going to behave and that root as we see is dependent on what field current machine is operating in whereas the other aspect is the amplitude of variation and that has is not only dependent on the roots it depends on the numerator as well in this case there are no zeros the numerator that is going to be there and here there are no zeros if there are zeros then it would depend on the location of the zeros also. So one can get a considerable amount of information by looking at this so let us look at another example from the same system so here we are looking at the relationship between the speed and the field voltage that is applied as input. So if we go back one can see that the relationship between the speed that is here and the field voltage that is applied would then be given by this term the term in the third row first column of Su-A inverse and that is exactly what we have taken out and written here in a simplified form so that is what it is and one can see that this expression depends upon the steady state armature flow of current that was there prior to the disturbance it depends on the field current it depends on the speed at which the machine is operating and therefore it is really dependent on what is the system circumstances at the time of applying this disturbance. So I have an example here so for example let us take this DC machine in order to understand what the small signal disturbance means and how the response is really related to the large signal equations of the machine. So here we have a DC machine it is a 5 HP DC machine the armature voltage the rated voltage is 240 volts the field voltage rated is 300 volts the rated speed of the machine is 1750 rpm that means under rated voltage and field conditions if you apply rated load that is the speed at which the machine is expected to operate that has an armature voltage armature resistance of 2.581 ohms armature inductance of 28 millihenry and a field resistance and a field inductance LAF represents the mutual inductance between the field and the armature that is the same as the term MSR that we have been using J refers to the moment of inertia of the load as well as the machine both referred to the shaft of the machine B is the viscous friction term and TF is the friction term and to this a load torque has also been applied and here we look at the large signal model response. So if you remember the large signal equations of the DC machine we are looking like this VF and VA are the inputs that are applied to the machine this was equal to RF plus P times LF 0 and then here you had MSR into omega R and then you have RA plus P times LA this multiplies IF and IA these were the equations for the applied voltage as far as the generated electromagnetic TE that is the torque is concerned we know that that is MSR into IF into IA. So this is the expression for the generated electromagnetic torque and the mechanical equation would then be written as J times d omega by dt is equal to TE minus the load torque these are if you remember the large signal equations of the DC machine these large signal equations of the DC machine are valid under all conditions where the assumptions having derived these machines are met which is by and large under all situations. So one can study what is happening to the DC machine with these equations itself but these are non-linear in general if you are considering both variation of field current and variation of speed and the small signal approach what we have used helps us to derive linearized models and then relationships between certain disturbance inputs and disturbance out. So let us look at how these two are to be used so this is the large signal response itself in this what we have done is applied a large step voltage to the armature that means armature voltage goes from 0 to 240 volts in one single step and there is also a load on the machine right from time t equal to 0 and with that what we are looking at is the response of speed in radian per second with respect to time. So we have drawn a graph of how the speed is going to change with respect to time. So you see that the speed there is a slight dip in speed it goes negative for a small interval before which after which it becomes greater than 0 this dip is because of the fact that load torque is already applied on the machine attempting to rotate the shaft in the other direction. So before the machine can generate sufficient amount of generated torque by itself the load would have rotated the machine in the other direction and that is why the speed has reversed and then when the machine itself generates enough of torque the machine accelerates and you see that there is a considerable overshoot and then the machine settles down to a steady operating speed there are no oscillations here and what is done is we are applying a small change in the field voltage a field voltage change of 1 volt is applied that means the field voltage rated value was 300 volts as you can see here the 300 is made 301. So that is a really small disturbance and that is applied at t equal to 6 seconds that means at t equal to 6 seconds the machine has already settled down into a steady state there is a particular value of rotor speed and because load torque has already been applied there is a certain armature flow of current that is there certain field current is already flowing one can find out what they are by looking at the steady state equations also. But what is done here is a small change in field voltage from this graph one cannot see any effect of that small change in field voltage but let us zoom into this area of the speed graph and what we see here is how the speed is going to change with respect to the small voltage that is applied to the field one can see that the speed was operating at near about 209.22 radian or so at this point instant there is a slight change increase in the field voltage that is been applied and one can see that as a result the speed drops continuously and finally settles down at a speed near about 208.62 or so 208.6 radian per second there are no oscillations here and the speed response appears to be typical of an over damped system the fall in speed is rather slow it is not really happening fast and there are no overshoots and oscillations and so on. Now this is the response that has been predicted by the large signal model that means how we do it is you solve the set of equations until t equal to 6 seconds you solve it with a field voltage equal to 300 and after t becomes greater than 6 you make the 300 as 301 and continue solving so that is what you get from this on the other hand the nature of this response you see that initially the speed was operating here it was at this level and finally it has settled down at this level so this is then the change in speed the Laplace transform expressions that we derived they were expressions for change in speed for change in field voltage that is the expression that we have derived a few minutes ago. So if we use those expressions what we expect to see is this shape we do not know where it was operating initially from these expressions right this expression only gives you the manner in which speed is changing with respect to the change in the field voltage. So if you now use those Laplace transform expressions and substitute if required the value of speed at which the machine is operating value of armature current at which the machine is operating field current certainly those are required because the transfer function as you see from here depends upon the speed of operation field current of operation and armature current of operation so substitute all that and apply this 1 volt change in the field voltage that is nothing but the unit step response for this system and what you see is this. So here this graph shows you a comparison of the response that has been produced due to the Laplace transform description and that which has been obtained from the large signal model we have done since we are only looking at ?o what has been done in this plot for the large signal response is the actual value of ? – ? at steady state so having subtracted ? at steady state the response will therefore start from 0 change at 0. So this is the time that then is equivalent of t equal to 6 seconds and as far as the small signal plot is concerned we are applying a unit step input at t equal to 0 and the response is shown by this graph here it is actually both the responses are shown here since they are overlapping exactly it is difficult to make out that there are two graphs here there is one graph which is green in colour and one that is blue in colour the blue one is the result of the simulation made using large signal model so this is the large signal model and the green one has been generated using the small signal model. So one can see from this graph that the response predicted by the small signal model is exactly the same as the one that you get using the large signal model there is no difference at all but one must note at the same time we are applying only a 0.3% disturbance on the field the field was earlier 300 volt and you are applying 1 volt disturbance that means 1 upon 300 one third 0.3% is the disturbance that you are applying for which it predicts exactly what the large signal model predicts and therefore one can therefore go ahead and use the small signal model itself in order to predict the response. But if you now increase the disturbance let us say you are doing a 5 volt step in the field voltage here again you see the difference between the two responses the blue again represents the response due to the large signal model the green represents the response from the small signal model and you see that while initially there appears to be no difference as time goes by the difference between them slowly increases and it settles down to an error of 1.2% between the two and therefore as the disturbance magnitude increases the response estimated from the small signal model is likely to deviate from the response that would actually be there in the machine. The large signal model response is the actual response whereas the small signal model has been obtained by making certain approximations we have neglected certain terms saying that they will be small but if they are not small this is the kind of error that one is going to land up with. But it is also important to note that initially the responses are almost identical and if one does not if one says that 1.2% error is acceptable then even a 5 volt step is a small signal disturbance for us. Now let us look at the same system that is we are looking at the transfer function between ?r and ?vf so one can see here that the numerator is a first order numerator there is only one s term whereas the denominator is really having order 3 this is a second order and then you have a third order denominator as well. So you have 1 0 and 3 poles so we are here looking at the 0s and the system poles you obviously see that the description depends upon the speed armature current and field current and we are here we have listed how the 0s of the system and how the system denominator roots which are the poles how they are going to vary when speed is going to be changed speed changes we have speed change we have looked at from 100 rpm to 1700 rpm you see that these three which represent the poles of the system they have not changed at all which stands to reason because here the denominator does not involve ?r therefore change in ?r obviously does not impact the roots of the denominator whereas for the numerator you see that as the speed is going to change from one to the other the numerator roots are initially negative in the low speed region and then become greater than 0 that means these two roots are on the left half of the s plane whereas all these roots are on the right half of the s plane. By how will that affect the response you see that ?r by ?vf can be written as some probably gain multiplied by s plus 0 divided by s plus pole 1 into s plus pole 2 into s plus pole 3 there are three poles and 1 0 now as far as the denominator is concerned all the roots are on the left half of the s plane and therefore in the form in which it will occur here p1 will be greater than 0 p2 is greater than 0 and p3 is greater than 0 in this expression the actual pole is negative or maybe if you put it as s minus p1 then the term will become greater but now here looking at this if we want to find out what will be the steady state of this that means having applied a disturbance where the speed settles down at what value the speed will settle down that can be obtained by looking at the relationship here and then trying to let s tend to 0 if you look at s tends to 0 and write down this expression what we see is that the impact of the 0 location being negative or greater than 0 is that for all these 0s which are on the rhp these are all on the right half plane in order to get a 0 on the right half plane the numerator should be of the form say s minus 42.135 for this particular 0 or maybe if you want to look at this particular 0 it should take the form s minus 2022.2 that is what you are going to have and in this if you now let s tend to 0 so what we see is that the numerator now becomes negative whereas the denominator is going to be greater than 0 and therefore ?r by ?vf will then be negative as long as the roots are on the right half of the s plane that is exactly what we have seen here that if you change vf if you change the field voltage by some value the speed drops ?omega is negative is it agreeing with our intuitive understanding if you increase the voltage applied to the field more field current will flow and as a result of higher field current there will be higher magnetic flux generated within the machine and if higher magnetic flux is going to be there the induced emf will increase and if the induced emf increases then for the same applied voltage in order to meet that speed can drop in order to generate similar induced voltages if armature current is not sufficiently disturbed so it appears that this is alright that is ?omega being negative agrees with what we see from the what we see from the 0s of the machine and our simulation output but you get a totally different situation if the 0s are on the left half of the s plane then the numerator will look like if we take the first term for example take the first term it would be s plus 51.541 on the numerator and therefore this is now greater than 0 if you let s tend to 0 denominator if you let s tend to 0 even here it would still be greater than 0 therefore under such circumstances you would find that ?omega r by ?vf as s tends to 0 that means as the speed change approaches steady state is now greater than 0 that means what you are saying is if you apply a small voltage change to the field the speed will actually increase rather than decreasing that is what we understand from the root locations and indeed from simulation you see that speed change is greater than 0 speed is increasing for a unit step change this of course happens at low speeds that is what we see from this near about 100 200 rpm or even lesser this kind of behavior is obtained and that means the machine is going closer and closer to stall conditions so near about stall then this is the behavior that is up to is this explainable well if you look at the DC machine speed torque curves so if you plot the speed on the y axis with respect to the torque on the x axis torque and speed well we should really be plotting it in a slightly different manner so let me extend this line over a long distance so that is what we have and then if you plot the speed torque curve of a separately excited DC machine that is then going to look something like this so that would then be your no load speed and this would be the stall torque that means if you apply that much amount of torque the machine will not rotate at all this no load speed depends upon what is the field that is available because at no load armature current drawn is 0 because the machine is not going to generate any load torque that no load includes no friction also so no load means the machine is really running free under such circumstances the speed which the machine will develop will depend upon the field excitation because the field flux that is there multiplied by the speed at which it is rotating is then responsible for the induced EMF and because no flow of armature current is there the induced EMF must be equal to the armature voltage that is applied so if you increase the field voltage more field current is going to flow and therefore the no load speed of the machine will then come down a little whereas if you look at the stall torque of the machine if you increase the field excitation that is given to the machine more field current flows and for a given armature current the generated torque really increases so the stall torque of the machine would increase if the field excitation is more so with increased slightly increased field excitation the new stall torque would have moved a little to the right and the new no load speed would have moved little below and therefore the speed torque curve of the machine would then look something like this and then if the machine is actually operating at some low rpm and a very high torque you can see that if you increase the field voltage the speed is then likely to go up and that is exactly what is being shown by these plots now however this kind of operation is invariably not seen anywhere because you rarely approach stall torque of a particular machine the useful range of operation of a DC machine would probably stop at some point here which is about one third of the stall torque would be the rated torque probably in that range right so now all this exercise serves as an example to understand what is the relevance of the small signal model of a machine where it can really be applied how does the response of the small response predicted by the small signal model compare with that of the real large signal model of the machine the large signal model is something that is always applicable under whatever be the magnitude of the disturbances whether they are small whether they are large whatever they are but the small signal model gives us a simpler and linearized system model which can then be used for many other application many other in many other situations where you want to for example design control systems and so on this small signal model is of use. So that is then the utility of the small signal model so we have seen how the DC machine has been handled so let us take a step back and see what all we have done so far. So we started with the induction machine really the three phase induction machine in the natural reference frame of description and this three phase induction machine we then took it through a three phase to two phase transformation and we arrived at the so called two phase induction machine remember that the two phase induction machine really consists of two phases plus zero sequence description and only under situations where the excitation is balanced the two the zero sequence part can be neglected otherwise you will have to consider the zero sequence also. This two phase induction machine also had a rotating rotor and a stationary stator of course and then we went from this to the stationary reference frame in which the rotor was also transformed or the rotor was looked at from the stationary frame and the description here in the stationary reference frame we found that it could be used to describe a variety of machines one of the cases is the induction machine as seen from the stator everything appears to be in the stationary reference frame we saw that the flow in the rotor currents also looks as if it is of supply frequency the stator currents are of course at supply frequency so everything all the input variables excitations look like supply frequency effects and we found that the same description can be used even to model DC machines which is what we have been seeing all along so this description on the one hand can be used to model induction machines we saw that it can be used to model DC machines in its various forms DC machines are separately excited series excited shunt excited and then with an extra field as well all those can be represented and it can also model alternators that is synchronous machines in the case of synchronous machines one can you it would be then transforming the rotor on to the stator because on the stator you really have a field that is rotating the field is excited by DC in the synchronous machine but if you look at the stator and see what is happening to the field you really see a varying field a varying field happens because in this case the rotor is rotating physically and therefore you see a varying field in whichever manner it is what as the stationary observer sees is a field varying with respect to time and such a field can also be produced by excitations from the stator which are varying with respect to time and therefore one can also look at the behavior of the alternator using this description. So in a sense the stationary reference frame description is a generalized description of these three varieties of machine but however this description also has its own limitations because still we find that the excitations that are given for example if you want to describe the induction machine behavior you find that the stator voltage that is applied is of supply frequency stator currents are supply frequency so if one wants to do induction motor control for example you will have to deal with variables that are of supply frequency and that used to be a difficult thing because we are used to dealing with closed loop systems which have this well known PI controllers, PI controllers work the way they do only if the closed loop has DC signals that means under steady state the signals must settle down to some DC value if you have time varying signals under steady state in the PI controller is not expected to give 0 error. So in order to simplify the machine descriptions and indeed this kind of description started with the alternator analysis but has been adapted to the induction machine analysis for ease of control loop formulation in order to facilitate all that the stationary reference frame description is further transformed into another reference frame which in general could then be an arbitrary reference frame the arbitrariness of this arbitrary reference frame refers to the fact that the speed at which this reference frame rotates could be anything for example if you are able to formulate a set of equations where the speed of the reference frame is some let us say omega x then these equations that we have obtained so far which are the stationary frames equations should be able to get them by setting the speed equal to 0. We can then get speed equations in some other reference frame where the speed is equal to may be say synchronous speed or may be equal to the rotor speed or may be equal to some other speed so reference frame itself rotating at some speed which is not 0 has certain advantages with respect to handling the equations and therefore this is what we are going to see in the next few lectures how to transform the machine variables or the system description to the so-called arbitrary reference frame and why is that description useful for us so we shall see that in the next lecture and we shall stop here with this lecture.