 In the next chapter we will speak about hardware prerequisites for the proper application debugging and tuning. What we need from the hardware point of view is usually oscilloscope with multi-channel input. It's useful to have current probe and some voltage probes. For high voltage application it's mandatory to use insulated transformer or insulated power source. Sometimes it's good to use multimeter or LSE meter. What else? We need some schematic, DAC output from our application, debug possibility, USB to serial communication converter and that's it. Speaking about DAC outputs, these two pins that are provided from STM32 are very useful when tuning our system because they are able to show up to two runtime values of internal variables used within the FOC algorithm. The value of these DAC outputs changes in real time and allows immediate location or look at the internal processes. Maybe good question, why we don't use standard debug functionality? Okay, answer is simple. It's too slow for a runtime view. Okay, a lot we can observe with the DAC outputs. The primary values that we can show are iα and iβ that show the currents on the phases. These readings shall be clean and show sinusoidal current readings from the motor. If you can see some noise or distorted shape, please validate the current reading and topology. Then check the T noise and T raise according to the user manual. Next step it's continuous with signal flow and we can have a look to the back emfα, back emfβ. If we have small or limited noise with some value, then we can play with parameters of observer g2 and also PLL parameters. There are different options in different microcontroller families supporting the DAC output. The direct DAC which is available only if it's supported by a given STM32 family. Next option is PWM where an auxiliary timer simulates with the PWM output at the PWM value and it needs a small RC filter to filter out these values. It has got a very interesting benefit, it's very cheap but the output has some delay given by the RC time constant. Finally there exists third option, the SPI output which sends the voltage value over the SPI to the external DAC. It's very precise but it's as well the most expensive solution. Maybe good to highlight that the first option it's given through the MCU. Second it's also possible select by MCU without DAC output but last one it's necessary to go inside the code. Finally the DAC if it's available on the STM32 is always connectable on pins PA4 and PA5. You can control it with the DAC functionality block and in the monitor we can choose which variables are shown in runtime. Second setting it's inside the workbench in the control stage and you can select what will be used after the compilation. Now we can see the typical waveforms of a tuned system where we can see the phase current in yellow and pink and on the second picture we can see reconstructed back EMF alpha and beta in a perfectly sinusoidal manner. The green signal is coming from the current probe and it's a bit noisy through the implemented noise through the switching and you see that current reading is clear without this noise. Additionally if we use a UART configured on the STM32 we can use native part of the library to debug our motor control setup with a motor control workbench in monitor mode. We can change runtime parameters like PI coefficients, the G2 coefficient, required speed or torque mode and their values. We can as well observe the speed and tune the PI coefficients of the speed regulator in runtime. With the latest hardware from ST we have a nuclear board which contains also virtual comport and it's useful because we can easily connect to our applications through a nuclear virtual comport and debug with UART. When speaking about applications supplied from the mains line we need a couple of isolation transformers. Here I'd like to remind you that high voltage applications shall be operated only by certified personnel with proper education and usage of the protective equipment and isolation transformers guarantees or reduces the risk of damage of your equipment, reduces the risk of death or injury and if you additionally use the isolation of the oscilloscope further from the isolation of your main application you can benefit from removing the current leaks that may be present in the motor control application. It's also possible use an isolated ST link which is also useful to protect your PC.