 Děkuju, že se závodující káření. Takže když všichni všichni káření závodující káření výzvodovat. Takže... Máme díky, které je mětní výzvodovat. Takže je to závodovat závodovat. Tři šantopoloji a závodovat závodovat. insulitivní hodinclaysky to je hodinclayské hodinclayska, ale hodinclayská je městá, které je kvážná. Hodinclaysky hodinclaysky potom kanálem v mojiní motorkontrolních vlávách. V nevým hodinclase tohle kodinclayský hodinclayské hodinclayská. V této vlastní hodinclaysky potom kanálem vlávách. Motor control workbench je komputová netvora, protože jsme musíme vytvědětnit signal z resistou a resolutu ADC. Takže tady můžete vidět signal z resistou a jsme musíme vytvědětnit resolutu ADC. Takže jsme musíme vytvědětnit offset z resistou a vytvědětnit signal do větnice. Takže jsem měl, že motor control workbench je komputová vytvědětnita, takže je to velice, aby jsi přijít na výstavě svoje netvory do resolutu ADC. Jsi můžete vytvědětnit v stavě z koncentzí a tady je to klikná vytvědětnit. Jsi můžete vytvědětnit výstavě svoje netvory a to komputová vytvědětnit. The first topology is free shunt current sensing. Each phase has own resistor and the current is active when the low size switches is open. So it means that current have to go through the resistors. Signals of the resistors seems like this. So in the free shunt topology we are able to sample all currents in the same time. It is advantage of free shunt topology. So there can be problem with t-rise and t-noise. So as you can see if the transistor is opened, there is a glitch on the signals. We have to manage the measurements of these phase and also t-noise. It means that if for example transistor 1 is opened and the noise is propagated to resistors on transistor 2. So we have to manage this time and it can be done in motor control war bench. In the power stage current sensing you can set the t-rise and t-noise. So it means that we shift the measurements after the middle of the PWM. So we measure signal after the t-rise glitch. Because if we would measure the signal in t-rise glitch we will have wrong values of the measurement. And here you can see it is... Uticycle is slow so we have to measure it before the switching and compute the circuit current. Single shunt topology we have only one shunt for three phases. So we have to have lookup table of your system and compute the third current manually. So we measure two currents in one PWM duty cycle. So here you can see measurement here and here. And on the single shunt we have also t-rise glitch. So we have to manage it in power stage configuration. And t-noise is not visible in single shunt configuration. There could be problem with this space. So if the vector space is too short. So we cannot measure current here or is the same situation here. So ST developed the solution. So add delay here and here. So ratio of PWM is the same. But we are able to measure the current of the system. Because we need two values with one PWM cycle. Next solution is insulated current sensing. Insulated current sensor is used to measure directly two phases of the motor. So it is integrated solution. So it is basic and you can set it in power stage configuration. And it is important to choose proper sensor according to the range of current. So here you can see the diagram. So we have two currents in the same time. And third currents can be computed by this equation. And I think that's all about currents. I will jump to the sensor at speed and position feedback. We already know that we use for that some timers. But we have some additional slides about this feedback. And we use for that some Hall sensors. Which has two topologies of the placement 63 and 120 degree. And quadrator encoder or sensor less. If we go deeply in our library. We have found that we have some formats. Two formats for speed variables. And it is described in zero point hertz. That's the internal implementation. And you have to find that we have to recalculate from this unit to some common unit. But the common unit it's not the same in all. If you have a look for some drivers you can find the hertz. In some cases you have find the RPM. In our case from my side I use RPM. It's more close variable unit for me. And if you want to recalculate to RPM. Then you have to use in account that internal frequency is in zero point hertz. And second implementation it's in some digit per PWM. That's the speed how fast the angle changes. I'm not sure if I found the function. Which use this part. That's really inside the library. And most common functions use zero point hertz. Then in the standard implementation of our library. You will use the first one. Second one it's somehow hidden inside the library. But it's good to know that you can find DPP unit. Both units it's in signet 16 bit integer. Now we are thinking that we will extend this zero point hertz or something else. And we extend the precision of the range. But it will be in some future release. OK, first sensor it's a HAL sensor. Again review how it's look like. The topology 120 degree placement of HAL sensor. Really 120 degree. And signal it's quite not nice. The second one with placement of 60 degree. It's quite nicer that one face go up, second go up. Last one go up and then vice versa go down. You see that the precision it's not 120 degree but 60. Because we have rising and falling edge that doubled the precision. But 60 degree it's not enough. It's enough for the start, you can start. But for the standard spinning with FOC. Which can have a benefit with precise control. It's not enough. And we have two technique for the implementation. And you can select from it. And you see from additional slides. Back to the topology you see different in the signals. And you can find that our zero point zero angle. It's taken from the HAL sensor one and rising edge. That's our alignment. Again review that our timer contains some XOR function. We provide all changes on the input to the output. And we trigger second one as the commutation signal. For the sixth step but for the field oriented. We will use some somehow else. There is some technique how to extend the range or precision of the speed measurement. And that's simply that we define it as some threshold. And we count between edge captures. Which is coming from the holes combined through the XOR to the one event. And we have this capture events. Which reset the timer. And if we add the position of the capture. We generate some interrupt service routine. And inside we decide that the value is less than some threshold. It's mean that the precision is not good. We want to improve it. For that we change the prescaler. We put faster impulses and the slope it's faster. And there is some part with the shadow registers. That at this time we change the prescaler to the 29. And it's taken account in the next cycle. That's one cycle it's some temporary. And after that we will have a nice slope. With the better precision than before. Quite similar it's when we go slow down. And capture poses it's far away. It's a longer time. And through that, through the fast slope. We can reach some overflow of the timer. And we can calculate this overflow. And ask the reaction that it's running too fast. We increase the prescaler. It's mean that next cycle again after the temporary one. Slope will be smaller. And counter counter a bit slower. And through that technique we adapt dynamically. Speed measurement and increase the precision. There is some chart how it's work with two handles. If it from the overflow we increase the overflow counter. If it over some threshold then we said that nothing speed is zero. It's over. If not we take it account and correct only the prescaler. And second part it's for the capture. And we have to decide if it overflows. Then we have to increase the prescaler. If it underflow it's lower than the limit. We decrease the prescaler and correct the calculation. Electrical angle reconstruction. That's also the same sensor. But it is angle not speed. We have to align the faces with the hull sensors. We a bit touch or yesterday we a bit touch that in the sixth step we can correct this shift through the some capture register. But today we haven't any timer for that. And we have to place to our library different. We already know that for the hull signals zero angle it's on the rising edge on the first hull. And in the face we know that the zero angle it's on the maximum of the back EMF in the face A. And we have to find this angle and put it inside our library. Our library will take account about that and correct the position. Again the same. This different topology again zero angle it's top of back EMF in face A. And the rising edge in the both topologies of first hull signal hull sensor. Then some tips we put this slide from our experiences. And I want to highlight some problematic about the hull sensors. First it's that we usually use this kind of connection. That inside our boards are some jumpers for switching some pull ups for the hull signals. But with some quite weak pull up resistors. Please to be sure that hull sensors can generate some milliamps. And with 10K it's not a strong pull up. And you can see if you use only 10K pull ups. That it's not pull up with stronger value and oscillate about some signals. Through some injected noise. And for that we have to implement quite strong pull ups. Please take in account that. And second that our GPIOs it's in the two configuration one it's 5V tolerant. And there is some jumper to some pull up voltage. And you have to take care about this value that you cannot inject 5V to the not 5V tolerant pin. Please take care about that to protect your micro. Second slide it's about placement. We usually use the possibility that we have two main sensor and auxiliary. I usually play with start with the sensor less. And then I put auxiliary sensor as the hull sensor. And it's possible put both to duck output or debug output. And on the oscilloscope we can have a look at the position of the zero angle that is changing. And through that we can feel proper value to the workbench. Also you can measure back EMF where is the top and put the placement. But from my side it's more easy to start with sensor less. And then add auxiliary hull sensor. And then switch to the hull sensor. In real life it's that the spinning it's not continuous. We can decelerate or accelerate. And you can see that the edges from the hull can be in different timing. And through the one technique we have calculation between first two edges. We calculate the slope and interpolate the angle with this known slope. But the second step it could be different because we slow down or slow up. Through that we see some jumping in the reconstruction. Because after that we know the angle. We will correct it jumping to the up or down to the proper angle. And again calculate some slope. But with the slope we reach the position with different time. And first case it's that we correct immediately the angle. But what we see that some not stable reconstruction of the angle. And the result some disadvantage from that. It's that in this time we apply some angle for example 90°. But after short time it's switched and correct to the different angle. And I will jump to another. Not smoothly change the angle. Continuously we generate some not continuous sinusoidal signal. While we jumping from some not precise calculated value to the precise measure. And it's not smooth regulation. And some motor can jumping. The regulation is not smooth. For that we have second possibility. Which correct the slope. That we know that we are in the bad position. But we want to be in the right position. That we take account that our position. And we change the slope to be after predicted time to the proper position. If it bad decision we correct it again. But the reconstruction of the angle it's smooth. And in most cases it's better with some error at this moment. But with smooth reconstruction of the angle. And it's possible inside the library change to do some definition. I am not sure why it's naming MTPA. But it's decision of the development team. It's strange because we have additional algorithm. Which is not correlated to AH health sensors. Which is maximum torque per ampere. It's the same naming. But in this case it's some different naming. We can continue with encoder which is relative. We have some signals which is 90 degrees shifted. We can recive calculate all edges. And from yesterday you know this picture. We use calculation about all edges. We have to take care about the absolute position. How we handle absolute position. That's the implementation of that angle. It's depend on the timer size. Then 4 times pulses per round from the encoder. And also we have to take account number of pole pairs. Which is define the ratio between mechanical and electrical speed. That's the implementation inside the library. And we have to take about alignment. What is alignment? We can define some position. And put some current to the wind ink. To the stable current not rotating field. And through that we believe. We have to define the proper current for that. Proper force. To some angle. Rotor move to this position. And after some time we can decide. Rotor is in this position. And we mark this angle. It's known. And we know that this is 90 degree. And put some correction to the calculation of the angle. How it's define at alignment? Alignment is simply defined by the final current of the alignment and time. And you have to take in account that in all cases. If it loaded, unloaded. If it in the minus degree or all possibility. You have to define the current. Which can move the rotor to the proper position. And also through the time. In some cases you cannot increase the current. Because it's the maximal current. And then you have to increase the time for the rotor. For the rotation. In some cases our customer modify this algorithm. And avoid the alignment. Use alignment only some time. Not at all before all start. In some cases known that their application contains also break. And believe that if the break it's switch activate. And also without the power. It's not possible move the rotor. And in this case it's also good to store the value of the last position. Inside some EEPROM. And after power up read it back. And avoid this movement. And start from known position. It's also possibility. Ok, in the encoder we have some additional. Or use that speed measurement. And in this time we have some sampling time. And sampling the timer value. And through that we can calculate the speed. And in this time we can also calculate number of overflow. And react on that. You see that the precision of the measurement from the encoder. It's not so high. We have only 2 millisecond period. And the precision it's about one and a half percent. Which is enough for our control. About all inputs. Also Hall sensor and encoder. It's good to know that in our boards we have some headers usually. For the connection. Which contains ground. Some usually five volt power supply. Or voltage for the power supply encoder. Or heart sensors. And three lines. For the hall you can use all. And for the encoder only two. And you have to take care. That you have to connect it. And as I already said. Take care about the pull ups. If it's necessary. Or if it's push pull. Take care about the overvoltage. Through the five volt or 3.3 volt pin.