Author Topic: Question on DC motor current measurement  (Read 1236 times)

0 Members and 1 Guest are viewing this topic.

Offline XaviPachecoTopic starter

  • Regular Contributor
  • *
  • Posts: 243
  • Country: do
Question on DC motor current measurement
« on: October 31, 2018, 12:53:53 am »
I have a previous thread about this, but I dropped the topic for a while. I'm using this current sensor TLI4970-D050T4 located at the emitter leg of a power IGBT, which is being switched at 5 kHz.
It's a low side switching configuration, i.e, motor at the collector leg. The sensor has the default parameters according to the datasheet. I'm thinking of triggering an external GPIO interrupt every rising edge of the PWM signal, and sample the current at this point. Do you think it's a good idea?
« Last Edit: October 31, 2018, 01:51:33 am by XaviPacheco »
 

Online MasterT

  • Frequent Contributor
  • **
  • Posts: 785
  • Country: ca
Re: Question on DC motor current measurement
« Reply #1 on: October 31, 2018, 01:31:49 am »
Probably not a good idea. Fastest response time is 57 usec, period of the 5 kHz PWM is 200 usec, though at the best sensor could capture 30% PWM and up. What is more problematic, current is not a linear function, and slow sigma-delta adc is no-go with exponentially rising  current. So, I'd say - no.
 

Offline XaviPachecoTopic starter

  • Regular Contributor
  • *
  • Posts: 243
  • Country: do
Re: Question on DC motor current measurement
« Reply #2 on: October 31, 2018, 01:50:43 am »
The thing is that I'm trying to sample the current only when the transistor is ON. Do you suggest a better way?
 

Online MasterT

  • Frequent Contributor
  • **
  • Posts: 785
  • Country: ca
Re: Question on DC motor current measurement
« Reply #3 on: October 31, 2018, 02:01:29 am »
Better is SAR adc. Sensor is shunt or hall, someting like acs712. What is uCPU, does it have an adc?
 

Offline XaviPachecoTopic starter

  • Regular Contributor
  • *
  • Posts: 243
  • Country: do
Re: Question on DC motor current measurement
« Reply #4 on: October 31, 2018, 02:05:03 am »
Better is SAR adc. Sensor is shunt or hall, someting like acs712. What is uCPU, does it have an adc?

I can't change the sensor for now.
 

Online MasterT

  • Frequent Contributor
  • **
  • Posts: 785
  • Country: ca
Re: Question on DC motor current measurement
« Reply #5 on: October 31, 2018, 02:25:52 am »
I'm thinking of triggering an external GPIO interrupt every rising edge of the PWM signal, and sample the current at this point. Do you think it's a good idea?
  Triggering is correct approach with SAR adc, to ensure time stamping of the measurements relatively to PWM pulse. Here is different things, sensor has internal adc (slow sigma-delta) and filter, so it does sampling all the time, there is no trigger. Request over SPI is getting already processed data, and measurements is gonna to be erroneous with PWM.
 
The following users thanked this post: XaviPacheco

Offline Siwastaja

  • Super Contributor
  • ***
  • Posts: 8180
  • Country: fi
Re: Question on DC motor current measurement
« Reply #6 on: October 31, 2018, 05:37:25 am »
There really should be an internal triggering path in your STM32 ADC & timer peripherals, but if not, using external GPIO interrupt of course works as well, as you describe.
 
The following users thanked this post: XaviPacheco

Offline XaviPachecoTopic starter

  • Regular Contributor
  • *
  • Posts: 243
  • Country: do
Re: Question on DC motor current measurement
« Reply #7 on: October 31, 2018, 02:16:09 pm »
There really should be an internal triggering path in your STM32 ADC & timer peripherals, but if not, using external GPIO interrupt of course works as well, as you describe.

To read the sensor, I should pull CS low, read SPI data, and pull CS up. So, I'm receiving a digital signal, not an analog signal. That's why I'm not using any ADC in the uC. I came up with also connecting the PWM to a GPIO and trigger an interrupt to read SPI when rising edge of the PWM signal to avoid reading when the transistor is OFF. I was not sure of this approach. I'm simply going to test it.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf