16
\$\begingroup\$

I am developing a PCB for an analogue sensing application. It uses the internal ADC on a PSoC3. As usual, the application is very space constrained (11mm x 21mm), so I have had to make some compromises in the PCB layout which I would not have done on a larger PCB.

PSoC PCB

The board is supplied by regulated 6v, and contains two 5v linear regulators. An MCP1702 for the digital supply, and an MIC5205 for the analogue supply. The board is sensing five A1324 Hall effect sensors. Each Hall effect output signal is filtered by a 100nF + 1k RC filter. One sensor is on the PCB itself (bottom right). The other 4 plug into the right hand 6-pin connector.

The chip is acting as an SPI slave, but ADC samples are always taken between SPI transactions, so the SPI should not interfere with the analogue signals.

Sadly, I am still seeing some noise (about 1.5 LSB at 12-bits) on the analogue signals, and I wonder if there is anything I could have done differently in the layout to improve it.

PSoC Layout

Please open the image in a new tab to see it in higher resolution.


Added:

Other PCB designs I have done using the MCP3208, and the same dual 5v supplies, same sensors, and same RC filters have achieved no noticeable noise at 12 bits.

The ADC on the PSoC3 is a delta sigma type. This version of the PSoC is limited to 12 bits, but another part number has a 16-bit ADC (although with a lower sample rate).

I do care about the noise, and would really like to push it a bit further towards 12 ENOB. The reason is not accuracy, but velocity measurement. Currently this level of noise is making it impossible to do accurate position and velocity control on a robot.


Added:

Schematic. Sorry it's a bit cramped, but you can just about read the values.

PSoC Schematic

\$\endgroup\$
  • 1
    \$\begingroup\$ Also, STOP USING NET-LABELS! Your circuit is nowhere near complex enough to require them, and by not actually showing the connections, you make it much more difficult to trace connections out. Again, the purpose of the schematic is to make the intended function and functionality of the circuit visually apparent. You then let the computer translate the visual representation to the actual physical layout of the devices (which is something computers are very good at). \$\endgroup\$ – Connor Wolf Sep 15 '12 at 3:42
  • 1
    \$\begingroup\$ @Rocketmagnet - They certainly are helpful for the person drawing the circuit. They're utterly abominable for everyone else. \$\endgroup\$ – Connor Wolf Sep 16 '12 at 7:21
  • 1
    \$\begingroup\$ Also, if you are having issues with needing to route wires due to space-constraints, you desperately need to look into the pin-swapping functions in Altium. Basically, you can specify pins that are functionally-swappable in the component definition (I.E. various IO pins), and then when you are routing the PCB, you can run the traces to any of the pins that would work, rather then just the one you specified in the schematic. Then, you can synchronize the routing you chose in the PCB to the schematic. \$\endgroup\$ – Connor Wolf Sep 16 '12 at 7:25
  • 1
    \$\begingroup\$ @FakeName, while connecting with labels might make it harder to follow a circuit, redrawing every symbol to make a pure & clean schematic with nice straight lines could easily quadruple the time to do schematic entry. I'd love to see a perfect schematic, I'm not sure its realistic to demand one. \$\endgroup\$ – The Photon Sep 25 '12 at 18:45
  • 1
    \$\begingroup\$ @Rocketmagnet, Having a very small pcb area doesn't mean you can't draw your schematic on D-size paper. \$\endgroup\$ – The Photon Sep 25 '12 at 18:46
13
\$\begingroup\$

You'll always have some noise on an ADC, especially SA (Successive Approximation) types on the microcontroller die. Sigma-delta perform better for Gaussian noise, as they integrate it. Don't expect 12 ENOB from a 12-bit ADC.

The controller's noise is a reason why most microcontrollers don't give you a higher resolution than 10 bit, and the AVR offers the possibility to stop the microcontroller during the ADC's acquisition, which should confirm that at least some of the noise comes from the controller.

But the question is: do you care? 1.5 bit of noise on a 12-bit ADC still leaves you more than 10 bits, or better than 0.1 %. How accurate is your Hall sensor? Other components in the circuit?

edit
You seem to use the PSoC's internal oscillator, since I don't see any crystal on the schematic. It looks OK: you have the proper decoupling. Apart from the internal clock the only high speed part in the circuit seems to be the SPI, but you say that this will be silent during measurements. The rest of the board is DC or probably relatively low frequent like the Hall effect sensors. And it's a Damn Small™, which also helps: shorter traces will pick up less noise. Sure I could nitpick about the MCP1702, which I would rotate 90° CCW so that the output capacitor can be placed even closer to the pins, but that won't solve the problems.

I only see one change in the layout which might improve your S/N ratio:

enter image description here

In the datasheet split analog and digital ground planes are suggested for "Optimal Analog Performance" (page 10).

For the rest: it's a small board like I said, that means short traces and decoupling within a few mm. So I would like to have another look at the noise's source. Prime suspect is the PSoC's clock. The PSoC can run a very low supply voltage, and that would reduce its noise. Of course it would help much if VDDA has to be lowered as well, but I didn't read anywhere in the datasheet that VDDA shouldn't be higher than VDDD.

Next, the ADC. On page 55 of the datasheet it says 66 dB SINAD, that's 11 bits, close to what you get now. The A1324 datasheet gives us 7 mVpp noise on a quiescent voltage of 2.5 V. That's also far less than the 72 dB S/N ratio which 12-bit could give you. You may improve this a little bit with extra filtering.

You mention the better performance of the MCP3208, but that's an ADC away from the microcontroller, and that may explain how an SA ADC can do better than a sigma-delta with the same resolution.

So, the options I see: lower the digital power supply voltage and split analog and digital grounds.

\$\endgroup\$
  • \$\begingroup\$ That is a very interesting idea about lowering the PSoC's digital supply voltage. VDDA certainly can be higher than VDDD. \$\endgroup\$ – Rocketmagnet Sep 14 '12 at 19:21
  • \$\begingroup\$ So, do you think I should disconnect VSSA from the thermal pad? I have actually posted this as a whole new question. \$\endgroup\$ – Rocketmagnet Sep 14 '12 at 19:41
2
\$\begingroup\$

I agree with the above. 1.5LSB of noise is pretty reasonable. http://www.cypress.com/?docID=39346 shows a minimum SINAD of 66 dB in 12 bit mode, suggesting ENOB = 10.7.

I know this isn't a direct answer to your question, but I'm going to interpret the question as "how do I fix my problems with velocity control?" and not "How do I get more than 10.5 ENOB?".

How are you differentiating? Do you have enough spare clock ticks to do something a hair smoother than a two-point central difference? Maybe work out something 5 samples wide, optimized in Matlab?

Also, this might sound a bit funny, but velocity noise gets worse as you sample faster

$$\frac{1LSB}{\Delta t}$$ gets bigger as delta t gets smaller). Try sampling only as fast as you need to, not as fast as you can.

Not to be insulting, but also take a quick glance to make sure nothing silly is going on in your velocity control, like issues with conversions between signed and unsigned integers, and make sure that your integers are wide enough to avoid overflow errors when you differentiate. My own control equations often get complicated enough that I sometimes explicitly cast each operation.

Lastly, though perhaps most likely, are you losing effective bits off the top by not amplifying to near full scale? If so, you can amplify or perhaps provide a smaller Vref.

\$\endgroup\$
  • \$\begingroup\$ We are calculating position and velocity using an Alpha Beta Filter. I understand that velocity noise increases as sample rate increases if done naively. I am sure that velocity noise is not due to a sign error. And we are already almost at full scale, so there is no more amplification I can do without risking hitting the top or bottom of the range. \$\endgroup\$ – Rocketmagnet Sep 13 '12 at 8:06
  • \$\begingroup\$ Would you say that there are no improvements I can make to the layout? \$\endgroup\$ – Rocketmagnet Sep 13 '12 at 8:07
  • \$\begingroup\$ Can't see anything yet. How are you amplifying the hall sensors? Have you actually looked at the output of the A-B filters and control eqns as a reality check? Peeked at noise on your regulator outs? It might be illuminating to do a formal noise budget for the whole system \$\endgroup\$ – Scott Seidman Sep 13 '12 at 11:14
  • 1
    \$\begingroup\$ But! The other advantage of differential mode is that it lets me bump up the sample rate 4x, so I can do oversampling. This should bring the noise down a little. \$\endgroup\$ – Rocketmagnet Sep 13 '12 at 20:49
  • 1
    \$\begingroup\$ Maybe a bypass cap on Vref (not sure how to do that, its in the datasheet). Other than that, I think you're extremely close to, if not at, the ideal ENOB for the PSOC 3 ADC at 12 bits, so you've done about as good as you could! \$\endgroup\$ – Scott Seidman Sep 13 '12 at 21:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.