Skip to content

Commit

Permalink
MPAE-17086 : small modifications on readme files
Browse files Browse the repository at this point in the history
  • Loading branch information
TeodorLina committed Jan 11, 2024
1 parent 8186733 commit 9769456
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions BEMF_Acquisition_Demo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ The AVR16EB32 Curiosity Nano Development Board is used along with the MPPB, AVR-

<br> The peripheral clock, output port pins, TCE, WEX and AC are initialized and configured using the MPLAB X Code Configurator. At run-time, the driving sinewave signals are generated using a Lookup Table (LUT). The LUT is scrolled using three 16-bit counters, one for each phase. The drive is updated at every PWM cycle, once every 50 µs. The counters start from different values to ensure the 120 electrical degrees phase shift for the three phases. The BEMF is read once per PWM cycle as well. The counters increment is the actual motor's speed (LUT scrolling speed). The frequency of the sinewave signals is modified by increasing or decreasing the LUT scrolling speed. The amplitude of the sinewave signals is modified using TCE's hardware scaling accelerator.

<br> At run-time the ```BEMF_Read()``` function is called in an Interrupt Service Routine (ISR). The ```BEMF_Read()``` function is registered as a callback on the TCE's CMP3 vector ISR. This function gets the output from the AC and sets an IO to high `1` logic if the value is one. If the value from the AC output is zero the IO is set to `0`, low logic. Every phase of the motor has an IO to show the sampled BEMF for the respective phase. PF1, PF2 and PF3 pins are used to show the sampled BEMF for the three phases of the motor. PF4 pin is used to mark the sampling moment of the BEMF during the long dead time. The AC has on the negative input the hardware reconstructed neutral phase of the motor. The AC has on the positive input the three phases of the motor, each one at a time, using a Multiplexor (MUX). The AC MUX is switched at every PWM cycle (whenever a new ISR occurs) to monitor a different phase. This means that each phase of the motor is monitored every 150 µs. The AC monitors phase A for 50 µs, then switches to phase B for another 50 µs, then switches to phase C for another 50 µs. After that the process repeats itself over and over again.
<br> At run-time the ```BEMF_Read()``` function is called in an Interrupt Service Routine (ISR). The ```BEMF_Read()``` function is registered as a callback on the TCE's CMP3 vector ISR. This function gets the output from the AC and sets an IO to high `1` logic if the value is one. If the value from the AC output is zero the IO is set to `0`, low logic. Every phase of the motor has an IO to show the sampled BEMF for the respective phase. PF1, PF2 and PF3 pins are used to show the sampled BEMF for the three phases of the motor. PF4 pin is used to mark the sampling moment of the BEMF during the long dead time. The AC has on the negative input the hardware reconstructed neutral phase of the motor. The AC has on the positive input the three phases of the motor, each one at a time, using a Multiplexor (MUX). The AC MUX is switched at every PWM cycle (whenever a new ISR occurs) to monitor a different phase. This means that each phase of the motor is monitored every 150 µs. The AC monitors phase A for 50 µs, switches to phase B for another 50 µs, and then to phase C for another 50 µs. After that, the process repeats itself over and over again. Another approach is to monitor one phase until a Zero-Cross of BEMF is detected, then switch to monitor another phase and so on. The second approach reduces the Zero-Cross Detection delay.

## Function Called in Interrupt Service Routine

Expand Down Expand Up @@ -342,4 +342,4 @@ Below are some logic analyzer captures, to help understand how the six PWM signa

## Summary

This project shows how to use the TCE and WEX to generate PWM signals in Single-Ramp mode to drive a 3-phase BLDC or PMSM motor, and use the AC to measure BEMF during the dead time period.
This project demonstrates how to use the TCE and WEX to generate PWM signals in Single-Ramp mode to drive a 3-phase BLDC or PMSM motor. Additionally, it shows how to measure BEMF during the dead-time period using the AC. This BEMF detection method cannot be used for applications with high dynamic load changes because the response is not fast enough. For this method to detect BEMF as clean as possible, the motor must spin at a minimum RPM speed of usually around 10-20% of the nominal speed of the motor.

0 comments on commit 9769456

Please sign in to comment.