AnsweredAssumed Answered

Any ideas with regard to spurious ADC values

Question asked by Lorne Vaasjo on Feb 27, 2017
Latest reply on Feb 28, 2017 by AvaTar

I am using the ADC+DMA to collect samples for AC power calculations.  The voltage and current are well buffered (low impedance sources) sampled at about 7kHz.

The data acquisition will work properly for many seconds (between 10 and 40) but then I will get a series of ADC readings in the raw data that are completely incorrect.

To try to figure this out I am collecting the raw ADC values in a buffer that collects one second of data and gets re-written until a spurious value arrives.

The following is a part of the raw ADC buffer showing spurious data in samples 58 through 70.

I have experimented with different sample rates, buffer sizes and adc settling times but haven't found anything that gets rid of the problem.

The processor used is an STM32F030CCT6 using a 28MHz external crystal.

The 'raw values' below are relative to the prevous 1 second average value for each reading (thus the negative values) and the sample rate is lowered from the 7kHz.

 

sample#, rawVolts, rawCurrent, v*i/100

26,78,-1,0
27,171,-1,-1
28,269,-1,-2
29,358,0,0
30,544,2,10
31,537,-1,-5
32,494,-2,-9
33,429,-1,-4
34,353,-1,-3
35,277,0,0
36,180,-1,-1
37,68,0,0
38,-35,0,0
39,-125,0,0
40,-223,-1,2
41,-317,-2,6
42,-396,-2,7
43,-453,-2,9
44,-500,-1,5
45,-529,-1,5
46,-541,-2,10
47,-541,0,0
48,-521,-1,5
49,-463,-1,4
50,-391,-1,3
51,-316,-2,6
52,-231,-1,2
53,-123,-1,1
54,-14,0,0
55,80,0,0
56,174,1,1
57,272,-1,-2
58,360,1990,7164
59,-1488,1991,-29626
60,-1991,1939,-38605
61,-1991,1991,-39640
62,-455,-960,4368
63,-1133,-1986,22501
64,-1987,637,-12657
65,461,1931,8901
66,-1931,11,-212
67,859,-1990,-17094
68,-1991,295,-5873
69,-545,5,-27
70,-1931,-1,19
71,-33,-1,0
72,-124,0,0
73,-222,-1,2
74,-317,0,0
75,-396,-2,7
76,-451,-1,4
77,-499,-1,4
78,-529,-1,5
79,-541,-1,5
80,-542,-1,5
81,-519,0,0
82,-464,-1,4
83,-392,-1,3
84,-316,-1,3
85,-232,-2,4
86,-124,-1,1
87,-15,0,0
88,80,-1,0
89,173,0,0
90,270,-1,-2
91,360,-1,-3
92,439,2,8
93,477,-1,-4
94,518,-2,-10
95,536,-1,-5
96,544,-1,-5
97,536,0,0
98,498,0,0
99,430,0,0
100,355,-1,-3
101,278,0,0
102,179,-1,-1
103,67,-1,0
104,-31,-1,0
105,-124,-1,1
106,-222,-1,2
107,-316,0,0
108,-396,-1,3
109,-451,0,0
110,-499,-2,9
111,-529,-1,5
112,-542,-1,5
113,-541,0,0
114,-521,-1,5
115,-464,-1,4
116,-392,-1,3
117,-318,0,0
118,-232,-1,2
119,-124,-1,1
120,-16,-1,0
121,79,0,0
122,171,0,0
123,270,-1,-2
124,359,-1,-3
125,427,-1,-4
126,475,-1,-4
127,517,-1,-5
128,536,-1,-5
129,544,0,0
130,536,-1,-5
131,498,0,0
132,432,0,0
133,354,0,0
134,280,-2,-5
135,181,-1,-1
136,69,-1,0
137,-33,-1,0
138,-124,-1,1
139,-220,-1,2
140,-315,0,0
141,-395,-1,3
142,-451,-1,4
143,-498,-1,4
144,-528,-1,5
145,-541,-1,5
146,-541,-1,5
147,-524,-1,5
148,-466,0,0
149,-391,0,0
150,-318,1,-3
151,-232,-1,2
152,-125,-1,1
153,-16,-1,0
154,78,-1,0
155,171,-1,-1

Outcomes