sinara-hw / Stabilizer

2-channel microcontroller servo with EEM and Ethernet based on STM32 CPU
Other
21 stars 5 forks source link

v1.0 rc1 design review #2

Closed hartytp closed 5 years ago

hartytp commented 5 years ago

Schematic at https://github.com/sinara-hw/Stabilizer/files/2592309/Stabilizer.PDF

Review of the main analog outputs (DAC):

Some context here:

hartytp commented 5 years ago

NB I'm not reviewing the power supplies section very carefully since this is copied from other projects which have already been through several design reviews. From a brief look, it looks good though!

hartytp commented 5 years ago

Nit pick on the PSU page: in the sequencing annotation, it should be "reference" or "ref" not "adc ref" since it's used for the adc and dac.

hartytp commented 5 years ago
hartytp commented 5 years ago
hartytp commented 5 years ago

@gkasprow I'm not going to check over the microprocessor/ethernet/USB parts of the schematic. I'm not the right person to review that.

gkasprow commented 5 years ago

We can use another edge hang (in-line) type of USB connector and fit in under Ethernet jack. obraz obraz

hartytp commented 5 years ago

ADC:

hartytp commented 5 years ago

Also, note that the ADCs draw quite a high reference current, but there is no buffer to isolate them. That could lead to some channel to channel and ADC to DAC cross-talk. Not sure if that's an issue, but worth a bit of thought.

gkasprow commented 5 years ago

The LVCMOS buffers are mainly to cut the noise that is propagated from CPU over the digital lines and couple with analog signals. If you want true 16bit performance it's a must. Level conversion is another story.

hartytp commented 5 years ago
hartytp commented 5 years ago

The LVCMOS buffers are mainly to cut the noise that is propagated from CPU over the digital lines and couple with analog signals. If you want true 16bit performance it's a must. Level conversion is another story.

Aah, good point.

hartytp commented 5 years ago
hartytp commented 5 years ago

We can use another edge hang (in-line) type of USB connector and fit in under Ethernet jack.

If you think that will be okay mechanically then it's fine by me. i.e. will that be okay with the FP? will it be reasonably mechanically robust? will it be a real pain to insert the USB and ethernet at the same time? If all that's okay then it seems like a very good solution.

hartytp commented 5 years ago

@gkasprow that's my review complete. Thanks for a really good initial version.

The only big-is thing here is deciding what we want to do about the reference buffer. Other than that it's just a few small things...

hartytp commented 5 years ago

The LVCMOS buffers are mainly to cut the noise that is propagated from CPU over the digital lines and couple with analog signals. If you want true 16bit performance it's a must.

If they're essential for the ADC, why aren't they essential for the DACs?

gkasprow commented 5 years ago

ADC is more sensitive to noise due to SAR architecture. Small interference can take a few LSBs easily. DACs are just current sources or resistor arrays so the noise does not cause such conversion errors. The input noise can only propagate to the output. I had such issues only with ADCs so far. It is caused by ground bouncing of the silicon chip.

hartytp commented 5 years ago

ok, makes sense. I didn't know that.

hartytp commented 5 years ago

One other thing:

gkasprow commented 5 years ago

Roughly 15 years ago I built scientific grade CCD camera for my master thesis. I used 16bit 10MS/s ADC. First prototype that used DRAM chips was working fine, but had higher noise (~40e-). Second one (with SDRAM, PCI and GB Ethernet) was much better with readout noise below 10e-. And to my frustration, every image had same pattern applied. It was roughly 10LSB pattern, same on every image. I tried many things - separated ADC from FPGA board, supplied with batteries, placed in metal cage. After hours of fight I noticed that only digital lines and GND are connecting the two. So I placed HCT244 buffer. The pattern disappeared and overall noise was greatly reduced to just 2 LSBs RMS including front end. It was even smaller than in datasheet. Their reference design did not use such buffering :D AFAIR I used AD9826 chip. The pattern was caused by SDRAM controller that went through exactly same sequence during every image acquisition that caused power supply bouncing. This signal went through digital lines to the ADC and coupled with analogue lines via internal capacitances and also impedance of ground bondings.

gkasprow commented 5 years ago

Since that time I always place buffer between ADC and readout IC :)

hartytp commented 5 years ago

ouch.

hartytp commented 5 years ago

One other question: does one have to place a jumper to flash new firmware? If so, please can we add an annotation about that. Is there any way around that to make loading new firmware remotely (without having to add then remove a jumper) possible?

gkasprow commented 5 years ago

Firmware update can be triggered by software command.

hartytp commented 5 years ago

okay, good.

hartytp commented 5 years ago

One other slight nit pick:

hartytp commented 5 years ago

@gkasprow so, the plan for the GPIO/DIO header is that we have 16 single-ended signals. If this is used with the IDC to BNC board to break them out then we must set 8 of those signals to LOW in firmware, and use the other 8 as GPIO. Are you happy that this plan will work okay?

gkasprow commented 5 years ago

@hartytp I' not sure if grounding BNC with CPU pin is good idea. It will damage CPU quickly with first serious EMI from i.e. nearby thunderstorm.

hartytp commented 5 years ago

@gkasprow ack. That's why I asked.

So, with the current arrangement the digital header is not compatible with the IDC BNC board, because that assumes that there are 8 differential signals on each header.

I can see a few options options (if you have a better solution let me know!):

  1. Create a new revision of IDC_BNC that has jumpers that allow one to switch the BNC grounding between circuit ground and the _N half of the differential pair
  2. Split the GPIO across two digital headers, each of which only has 8 signals.
  3. If there are enough pins, then we can have two digital headers. One header has 8 single-ended signals and is designed to be compatible with the IDC_BNC board. No need for SPI/I2C or anything fancy here. Stick with GPIO and maybe a timer output. The second header has more digital signals with a mixture of GPIO/SPI/I2C etc. The second header is designed for connecting to custom AFE modules and is not compatible with the IDC_BNC board (it should use a different header so they cannot be mixed up by mistake). We should have clear annotations on the schematic labelling which headers are intended to be used with IDC_BNC.

If there is room then 3 sounds like the best option to me. What do you think?

hartytp commented 5 years ago
hartytp commented 5 years ago

@gkasprow what do you think we should do about the reference buffers?

Looking at the LTC6655 data sheet, the voltage reference regulation starts to degrade after 1mA. Each DAC draws up to 0.55mA, and the two ADCs draw something comparable. By 2mA, the error due to the reference alone is something like 20ppm, so we will see a slight degradation of INL/DNL and cross-talk.

For Fastino with >=8 DACs per board, we definitely cannot drive the DACs directly from the reference. So, finding a good way of doing the reference buffering is going to be important. What's your preferred solution to this? Do we need to pick an OpAmp and design an RC compensation network to ensure both stability and low output impedance at all frequencies? The latter is doable, but will take some time in spice (unless you already have a working design for this?)

hartytp commented 5 years ago

@gkasprow what do you think we should do about the reference buffers?

Looking at the LTC6655 data sheet, the voltage reference regulation starts to degrade after 1mA. Each DAC draws up to 0.55mA, and the two ADCs draw something comparable. By 2mA, the error due to the reference alone is something like 20ppm, so we will see a slight degradation of INL/DNL and cross-talk.

For Fastino with >=8 DACs per board, we definitely cannot drive the DACs directly from the reference. So, finding a good way of doing the reference buffering is going to be important. What's your preferred solution to this? Do we need to pick an OpAmp and design an RC compensation network to ensure both stability and low output impedance at all frequencies? The latter is doable, but will take some time in spice (unless you already have a working design for this?)

dtcallcock commented 5 years ago

finding a good way of doing the reference buffering is going to be important.

What about the circuit examples in the datasheet?

hartytp commented 5 years ago

The LT3042 is a lovely LDO, which I've used as a ref buffer before. Load regulation is 0.5mV (max) for a change in load between 1mA and 200mA. Assume that's roughly linear (no idea how valid that is) and it gives approx 2.5mOhm output impedance.

Assume peak-peak change in ref current is 500uA*num_comverters. This gives 1uV/converter. For 4.096V reference, 1LSB=62uV, so that should allow us to drive up to 62 converters from a single reference buffer while still keeping the worst-case cross-talk below 1LSB pk-pk.

However, that's only at DC. Once we start adding 10uF per converter, what happens to the ref buffer BW? The concern would be if a frequency band appears where the reference is running out of bandwidth (and hence its output impedance rises), but the decoupling capacitors aren't low enough impedance yet (the DACs require something like 50mOhm max). That's not something that can be guaranteed from the specifications, and would need testing. That's if the thing is even stable with that much output capacitance, which isn't clear to me from the data sheet. For a few DACs and ADCs it's probably fine, but it would need testing. This path doesn't seem crazy to me and might be the best option for this design.

We could obviously use one LT3042 per converter, but that would be very expensive and bulky.

As to the other circuits on the LTC6655 data sheet (essentially just an emitter-follower), they're less likely to work. One would need a noise filter to reduce the 40nV/rtHz reference noise, while still maintaining enough BW to keep the output impedance low at higher frequencies. That would probably require an OpAmp circuit to drive the BJT, which would require careful design.

The other option is to pick a cheap OpAmp in a small package and design a compensation network to make it work. Make it cheap, compact and low enough power that we can use a separate buffer per channel. That has the advantage of providing excellent isolation between the channels.

hartytp commented 5 years ago

My guess is that @gkasprow has done this many times before and already has a preferred solution.

hartytp commented 5 years ago

Thinking about this more, I wonder whether we should use a different header for the main analog inputs/outputs. There isn't really any point making this compatible with the Zotino/Sampler header since:

Let's use a different header with fewer pins to avoid confusion

dtcallcock commented 5 years ago

How about using MMCX?

hartytp commented 5 years ago

How about using MMCX?

If you're going to use coax then might as well just use the FP SMAs IMO. The internal MMCXs are okay, but can be a bit of a pain to route with all those IDCs.

My primary use-case for the "main analog" header is for plugging directly into custom AFEs like a current stabilization circuit, which screw directly to stabilizer and use the headers for board to board connections. That seems much nicer than using coax for board to board stuff.

dtcallcock commented 5 years ago

My primary use-case for the "main analog" header is for plugging directly into custom AFEs like a current stabilization circuit, which screw directly to stabilizer and use the headers for board to board connections.

Ah, I had forgot that you wanted to do that.

hartytp commented 5 years ago

@gkasprow NB when you do the routing: if we connect more than one converter to the same ref buffer then we must make sure to use a start layout for the reference connections to minimise the cross-talk due to trace impedance.

gkasprow commented 5 years ago

The original circuit that converts unipolar to bipolar output relies on internal DAC resistors. We can combine gain stage with shifter circuit but have to connect external reference voltage to not include precise resistors in each channel. So we can generate 3.413V reference and use the circuit below:

obraz

gkasprow commented 5 years ago

edit: reference value

gkasprow commented 5 years ago

3.413V is 4.096 * 5/6

gkasprow commented 5 years ago

This can be achieved using 5 + 5 + 10 + 10 resistor, resistor ratio of 5:25 gives 1/6 and 5/6 which does the job.

gkasprow commented 5 years ago

Buffering references is challenging. I can drive 10uF with 30Ohm series resistor and still maintain DC accuracy, but it requires additional feedback loop (1 resistor + 1 capacitor). Another idea is to use op-amp with external compensation that can drive indefinite capacitance, but I don't know any with very low offset (they typically have a few mV of offset) Yet another idea is to use precise opamp in every DAC channel as we do for Stabilizer. For Fastino it would increase the cost too much. We can also try to isolate the opamp with LC filter, but it is tricky.

gkasprow commented 5 years ago

The question is how big the isolation resistor can be. AD5542 defines in fig 17 that current changes between 100uA up to nearly 200uA. So our buffer must keep ref stability below 1 LSB, in this case 62uV 4.096/2^16). Iref change is 100uA, so maximal Rs = 0.62Ohm. This is also the maximum value of reference buffer. If we want to drive 32 channels from same reference, our buffer must withstand max and min load for all buffers. So its output resistance must be lower than 0.62Ohm/32 = 19mOhm. Since the DACs change the reference current rapidly, the buffer must react quickly and not oscillate. The LT3042 you proposed could work, but with tantalum capacitors which have much higher ESR. Analog Devices in CN0079 note presents idea of using individual AD8628 with feedback taken via REFS. Such solution would increase the channel cost by roughly 2 EUR. On the other hand, cost of AD5542 (10EUR), AD8620 (11EUR) and AORN2-1AT3 (2.7EUR) is already 24EUR so additional reference buffer is less than 10%. AD8628 is available in TSOT so we can fit them easily and use it for distribution of other references due to very low offset (1uV)

gkasprow commented 5 years ago

AD8628 in SOT-23 costs 1.5EUR@100pcs

gkasprow commented 5 years ago

DAC channel would then look like this obraz

gkasprow commented 5 years ago

Another issue can be with delivery of 3.413V reference. But here situation is easier. Every channel consumes +68uA / -340uA of current, but the impedance is always 10k. Even with 32 channels we still have 312Ohm. The reference buffer must maintain -2.1mA / +10.88mA but every opamp can do that. Of course at high frequency its performance will degrade and the crosstalk may get worse. We must make sure that its BW is much higher than amplifier BW.

hartytp commented 5 years ago

Thanks Greg! Looking at this AFE: https://github.com/sinara-hw/Stabilizer/issues/2#issuecomment-441392659

My concern here is that we now need a reference buffer for the 3.413V reference. That goes into a summing junction with relatively low impedance, so there is a lot of potential for cross-talk/loss of INL/etc unless we add a buffer. The impedance of the summing junction is about the same as the impedance of the DAC's reference input, so the problem of buffering this new reference is as hard as the original DAC reference problem.

This is why I spent some time thinking about buffer topologies in Sampler and chose a topology where the references all drive high-impedance nodes. Can we do the same in Stabilizer? Let's try to choose a topology where the reference drives a high-impedance node. If we have to add a new OpAmp for a reference buffer then this is no better than the previous configuration.

Is it possible to combine the gain with the filtering stage, instead of combining the gain with the unipolar->bipolar stage? Or, are you worried about issues that arise with combining active filters and gain?

If we have to stick with three OpAmps then it's not the end of the world. We can use a slower OpAmp for the initial unipolar->bipolar stage and find one in a small package like SOT23-5.

hartytp commented 5 years ago

Regarding the reference buffer, I can see a few options:

  1. LT3042. Maybe limit to max 8 converters per reference buffer to limit cross-talk. For Fastino we'd need quite a few reference buffers. The DC output impedance of this buffer is extremely low, and it has a wide bandwidth when loaded with 4.7uF, allowing it to keep a low impedance across a broad frequency range. The biggest issue I see here is how well the reference buffer performs at high frequency when we load it with a lot of capacitance. However, since the buffer is quite fast, the best bet might be to place it physically near the converters, connecting it with short wide traces to keep the trace impedance low. We can then use something like 1uF capacitors on each reference, so the total capacitance on the LT3042 output is not too high.
  2. Add 1 OpAmp buffer per converter. Pick a fast OpAmp with good current drive so that no capacitor is needed on the reference pin (i.e. we rely on feedback to keep the reference impedance low at all frequencies, rather than the standard approach of using capacitance). The big concern here is that while this will work well at DC, if the OpAmp isn't fast enough, this might lead to worse DAC glitches/AC non-linearity since the reference source impedance can rise at higher frequencies.
  3. Use 1 OpAmp buffer per converter. Add the usual 10uF||100nF capacitors, add an isolation resistor + RC compensation network to the OpAmp to stabilize it. This would need careful simulation.

The challenge with any of these approaches is ensuring that the reference pins have see a low impedance across all frequencies.

@gkasprow which solution do you think we should go for. I'm tempted by (1). It's definitely the cheapest and should work well so long as we watch the load capacitance on the LT3042 as well as the trace impedances. What do you think?