??? 06/27/11 08:56 Read: times |
#182738 - Measuring current on PWM device |
Hi all
I am driving a DC motor with a Silabs c8051F040 the device(s) I am using are infineon BTN7960 (or 7970) which are very nice and easy to use High Current Half Bridge devices, I have them configured as an H bridge. All my motor code is running fine and I was working on integrating some overcurrent protection on the system. I am using the ADC0 (port 3.5 in particular) and I was wondering why I could not read any voltage on this port. After a long time thinking it was my code (I had nver used Port 3 ans AIN's before) I put a scope on the IS pin of the BTN7960, I had used a meter before this. and what do you know, it is giving a voltage that is switched at my PWM rate of 21kHz. Thinking about it of course it is..... So My question is..... How can I accurately calculate using the ADC on port 3.5 of the micro with no additional external filtering like a big capacitor, the voltage (which is proportional to current) over time? ie, for a quick spike, I have a voltage and then for the rest of the time it is at 0v. my process is slow so I can afford 1000mSecs to get the correct result. I was thinking that I really have to run my ADC at a multiple of my PWM rate, like 84kHz or something huge, so that I can be sure to sample the voltage spike, and then I simply accumulate that data with all the 0v reading inbetween and that should give me the average voltage over time..... This seems like a lot of work and fraught with danger, in missing the pulses, getting hung up doing the measuring that I can't do anything else and so on...... Any ideas? Regards Marshall |
Topic | Author | Date |
Measuring current on PWM device | 01/01/70 00:00 | |
Peak voltage | 01/01/70 00:00 | |
Measuring such stuff... | 01/01/70 00:00 | |
Thanks - Good Ideas | 01/01/70 00:00 |