cancel
Showing results for 
Search instead for 
Did you mean: 

Best ADC conversion method and clamping?

stefanskos9
Associate II
Posted on June 14, 2012 at 03:33

Hi Guys,

I'm designing a 3-phase DTC induction motor control which needs the 3-phase voltages and 2 of the currents. I am using the STM32F4 Discovery board.

The control will have a small sample time (5uS). The controller may issue a new switch state every 5uS, and therefore the 5 ADC must take place every 5uS. Assuming due to the inductance of the motor the voltages/currents will need, lets say, 2.5uS to settle. Therefore i have only 2.5uS to do these 5 ADC's.

The control loop is highly sensitive to these 5 parameters, therefore the more accurate the readings the better. Also, it is best to do these readings as close (in time) to each other as possible. I see this STM32 chip has many ADC setups, so what is the best method to go about this? Ideally it would be good to have a synchronized trigger just before my main control loop to read all the ADC values into DMA, then I can just read the values without interrupting the flow of the code.

Is this going to be too hard to get them sampled within a reasonable time? Another alternative is to just use the DC bus voltage and switch states to estimate the 3-phase voltages. Although this is mathematically less accurate, perhaps just having 3 ADC conversions (DC bus voltage, and 2 currents) will end up a more accurate solution?

Also, my UVW phase voltages will be 0~400V . I was thinking of scaling the voltages 130:1 (max 468V) and clamping using the following schematic. Thoughts? Im not sure what value i should use for R_o.

0690X00000602l8QAA.jpg

Thanks for your help in advance!

Stefan

#clamping #dtc #adc-stm32-discovery #mcu #adc
15 REPLIES 15
stefanskos9
Associate II
Posted on June 15, 2012 at 08:35

Hi thanks for your replies

As far as i know all MCUs in this world have single Sample-Hold circuit per ADC

 

As I said, shame :p Not that it would knock off that much time.

However do the ADC convert the value independent of the main process? i.e. Does my main loop run concurrently with only an interrupt to start the conversion and sample process?

 

 

If you just need to know if the voltage (or voltage drop for current measurement) exceeds a certain level

 

Unfortunately I need an exact voltage reading. I know already from my previous switching states if it's going to be high or low, I need to know the magnitude.

But thanks for the idea of the DAC threshold, might come in handy down the track 🙂

frankmeyer9
Associate II
Posted on June 15, 2012 at 10:32

However do the ADC convert the value independent of the main process? i.e. Does my main loop run concurrently with only an interrupt to start the conversion and sample process?

 

Yes, it does.

More so, you are required to use DMA, because each ADC has only one DR register. If you use more than one channel, you will need DMA.

Another idea: You can connect more than one channel of each ADC to each of the 3 inputs, and configure them to convert sequencially. With DMA, you get the results as list in the order you configured it, coincidently a sequence in time.

As I might add, I used only the f10x ADC, and did not yet much with the F4xx ADC peripheral, which is substantially advanced.

And I need to agree to the tenor of the others - multiplexing several channels into one ADC

is the standard in the uC world. Separate ADCs are costly, and used where absolutely required for performance reasons.

stefanskos9
Associate II
Posted on June 15, 2012 at 10:51

Yes, it does.

 

Excellent 🙂

 

More so, you are required to use DMA, because each ADC has only one DR register. If you use more than one channel, you will need DMA.

 

As per one of my previous posts though, RM0090 (page208) shows there are 5 data registers, 4 for injected data and one for regular.

 

 

Another idea: You can connect more than one channel of each ADC to each of the 3 inputs, and configure them to convert sequencially. With DMA, you get the results as list in the order you configured it, coincidently a sequence in time.

 

Wouldn't it be faster to use an ADC each? It seems all the ADC pins are capable of either going to ADC1 or 2 (labeled ADC12), with some pins able to goto ADC1,2,or3 (labeled ADC123). If i use the ADC123 inputs then to use this method do i still need to connect to multiple mux inputs?

 

 

And I need to agree to the tenor of the others - multiplexing several channels into one ADC

 

is the standard in the uC world. Separate ADCs are costly, and used where absolutely required for performance reasons.

Yeh I understand there are only 3 ADCs, but I hoped each mux input might have its own hold cap, but ahwel.

stefanskos9
Associate II
Posted on June 15, 2012 at 11:00

repeat

stefanskos9
Associate II
Posted on June 15, 2012 at 11:01

BTW - Here is my updated schematic. I have added the buffer opamps and moved the clamp to the input of the opamp rather than Vout.

I am running the opamp at 5V now to stop it going into overload if signal ever peaks above 3.6V (has a 3.3ms overload recovery time).

Also because the input is a square waveform, I've added in a filter cap C_filter to filter out some noise on the otherwise DC (once settled) signal.

Having some difficulties sizing it though, because I'm confused of its time constant due to the resistor in parallel. I want it as large as possible with maintaining a 5*RC < 2.25uS (slew time of the opamp)

0690X00000602lIQAQ.jpg

frankmeyer9
Associate II
Posted on June 15, 2012 at 11:11

Wouldn't it be faster to use an ADC each?

Sure. I meant, in addition to that.

Use one ADC for each input, and of each ADC, several channels.

From my non-perfect understanding of injected channels, this is a sequence of channels that gets converted upon some invent, injected into the regular sequence.

As you need equidistant samples, I can't see any advantage in injected channels.

As per one of my previous posts though, RM0090 (page208) shows there are 5 data registers, 4 for injected data and one for regular.

 

 

... and one for regular. This is shared by all channels, therefore you will probably need DMA.