Author Topic: Errors in PIC24F ADC reading: What's causing it?  (Read 10716 times)

0 Members and 1 Guest are viewing this topic.

Offline dreaquilTopic starter

  • Regular Contributor
  • *
  • Posts: 103
  • Country: mt
Re: Errors in PIC24F ADC reading: What's causing it?
« Reply #25 on: April 17, 2016, 05:32:47 pm »
Yep it's coming through CON7 from the external SMPS 36V. I put an inductor/capacitor filter on the input with Fc=36Hz for this reason :/
 

Offline dreaquilTopic starter

  • Regular Contributor
  • *
  • Posts: 103
  • Country: mt
Re: Errors in PIC24F ADC reading: What's causing it?
« Reply #26 on: April 17, 2016, 05:41:28 pm »
Just powered the board using my regulated bench top supply and it has the exact same oscillations. So it must be created on the board. What I find strange is that the 3.3V is clean as a whistle but the 24V and 12V are not.
 

Offline Niklas

  • Frequent Contributor
  • **
  • Posts: 414
  • Country: se
Re: Errors in PIC24F ADC reading: What's causing it?
« Reply #27 on: April 17, 2016, 07:57:36 pm »
Just powered the board using my regulated bench top supply and it has the exact same oscillations. So it must be created on the board. What I find strange is that the 3.3V is clean as a whistle but the 24V and 12V are not.
All linear regulators are not created equal. A lot of the older ones, often named 78*XX, usually attenuates 50/60/100/120 Hz ripple but higher frequencies will pass through. LC-filters before and in between the regulators might help. Another thing you can try is to swap the ceramic capacitors on the outputs of the 78** to something with a little bit more ESR, for instance tantalum or ceramic cap with a 1ohm series resistor. I found no info the datasheet for the 78** from OnSemi, but it might be sensitive to too low ESR on the output.

You also asked about increasing the sampling time in a previous post. Give it a try and see if it gives any improvement. If you have an oscilloscope, try to set the sampling time longer than the dip on the ADC input.
 

Offline Kalvin

  • Super Contributor
  • ***
  • Posts: 2145
  • Country: fi
  • Embedded SW/HW.
Re: Errors in PIC24F ADC reading: What's causing it?
« Reply #28 on: April 17, 2016, 08:02:17 pm »
You also asked about increasing the sampling time in a previous post. Give it a try and see if it gives any improvement. If you have an oscilloscope, try to set the sampling time longer than the dip on the ADC input.

Your suggestion reminds me of another trick which might be useful too. If the MCU can be synchronized to the noise, the MCU can trigger the ADC measurement between the noise spikes effectively cancelling the noise completely.
 

Offline dreaquilTopic starter

  • Regular Contributor
  • *
  • Posts: 103
  • Country: mt
Re: Errors in PIC24F ADC reading: What's causing it?
« Reply #29 on: April 17, 2016, 10:57:13 pm »
I'll be trying these things tomorrow if I find the right parts. There is one thing that's puzzling me though- it's where the oscillations are coming from... if theyre not coming from the switch mode. I know how theyre coupling onto the output of the opamp because the supply of the opamp has the exact same oscillations ... so where are they being created.
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: Errors in PIC24F ADC reading: What's causing it?
« Reply #30 on: April 18, 2016, 01:25:40 am »
Quote
where the oscillations are coming from

High performance parts + poor layout are usually to blame. High speed opamps are especially evil and should be avoided as much as possible. My philosophy is to use as slow of a part as possible.
================================
https://dannyelectronics.wordpress.com/
 

Offline dreaquilTopic starter

  • Regular Contributor
  • *
  • Posts: 103
  • Country: mt
Re: Errors in PIC24F ADC reading: What's causing it?
« Reply #31 on: April 18, 2016, 06:40:33 am »
That's the thing though... The parts I used are pretty slow.  I don't know about my layout but I did give it a lot of thought... Clearly not enough
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: Errors in PIC24F ADC reading: What's causing it?
« Reply #32 on: April 18, 2016, 10:49:09 am »
Then maybe the opamp is driving a capacitive load, is in too much feedback, or too high impedance, .....

================================
https://dannyelectronics.wordpress.com/
 

Offline dreaquilTopic starter

  • Regular Contributor
  • *
  • Posts: 103
  • Country: mt
Re: Errors in PIC24F ADC reading: What's causing it?
« Reply #33 on: April 18, 2016, 05:59:41 pm »
Thanks to everyone for the help. Found the issue, had an opamp with a large capacitive load which was amplifying my reference by 2. This was in turn supplied by a 12V supply. It was going unstable and causing the supply rails to go unstable with it. Really appreciate all your suggestions- wouldve taken me much longer than it did to solve it. :-+
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: Errors in PIC24F ADC reading: What's causing it?
« Reply #34 on: April 18, 2016, 10:23:58 pm »
In those cases, out an isolation resistor before the capacitor and pick up the feedback on the capacitor but after the isolation resistor.

It prevents oscillation.
================================
https://dannyelectronics.wordpress.com/
 

Offline dreaquilTopic starter

  • Regular Contributor
  • *
  • Posts: 103
  • Country: mt
Re: Errors in PIC24F ADC reading: What's causing it?
« Reply #35 on: April 19, 2016, 05:34:44 am »
Yeah, will have to keep it in mind for next time but wasn't even aware of the possibility while designing this time. I guess its all experience and knowing what to look for.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf