Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qualification tests for revC2: post INA233 #221

Closed
13 tasks done
electroniceel opened this issue Oct 24, 2020 · 11 comments
Closed
13 tasks done

Qualification tests for revC2: post INA233 #221

electroniceel opened this issue Oct 24, 2020 · 11 comments
Assignees
Labels
hardware Component: hardware qualification Lifecycle stage: qualification revC Hardware revision: C

Comments

@electroniceel
Copy link
Member

electroniceel commented Oct 24, 2020

This issue is a task list of things to test for qualification of revC2.

This issue lists the tests that need firmware support for the new INA233 ADC (post issue #219).
There is issue #220 for tests that don't need support for the INA233 in firmware.

Voltage measurement

  • Measure different Vsense voltages, check accuracy
  • Vsense to 36V, measure current drawn by Vsense, check measured voltage
  • Slowly rise Vsense to 40V, measure current drawn by Vsense, check when the TVS diode begins to conduct
  • Do we need a filter (R60 + C91)? Couple some hi freq noise (e.g. 1 MHz) onto a otherwise constant voltage, measure results over a time, aliasing present?

Current measurement

  • Measure idle current at different voltages. Does it correspond to our load resistor values? What kind of offset calibration do we need?
  • Measure different currents, compare to multimeter
  • Connect a 100µF cap on Vio, program a overcurrent limit. what limit do you need to reliably not trigger the overcurrent off?
  • Draw a fast-pulsed current (FET+R controlled by function gen), is the filtering on the INA233 good enough?
  • Measure (worst case) reaction speed of the overcurrent protection. Is it fast enough to prevent damage on a DUT?

Hardware Vio-off via IRQ

  • Program overvoltage/undervoltage limits into the INA233, activate the IRQ, is Vio turned off without intervention of the FX2?
  • Do the Vio-LEDs stay on in this case? They should by design.

Port differences

  • Repeat the tests above on both ports. Are there significant differences between the two ports?

SMBus Alert Response Address

  • Change the conflicting DAC I2C address, adapt firmware, test how the INA233 reacts to the Alert Response Address and when ~ALERT is released
@electroniceel electroniceel added revC Hardware revision: C hardware Component: hardware labels Oct 24, 2020
@whitequark whitequark added the qualification Lifecycle stage: qualification label Nov 23, 2020
@electroniceel
Copy link
Member Author

Voltages set with 30 V calibrator (Advantest R6144) and read out in parallel with Keithley 2001 multimeter.

On both ports the measured voltages swing by +- 2 LSB. The median is within 0.02% of the voltage measured with the multimeter.

Matches the spec of the INA233, much better than what is required for Glasgow.

@electroniceel
Copy link
Member Author

I coupled hi freq noise into the Vsense pins. While on most frequencies no aliasing was measurable, on some frequencies (e.g. 370 kHz, 680 kHz) I could measure aliasing up to 50 mV with my (very improvised) setup. Will have to improve my test setup to better quantify the results.

@electroniceel
Copy link
Member Author

Today I improved my noise injection setup. I used this coupling network, derived from similar setups used for various EMI measurements:

coupler

The noise was a triangle signal, tuned with the oscilloscope to result in 200 mVpp noise on the output, overlayed over the reference voltage that was set with my calibrator. The LC network shields the noise from the calibrator to not affect it's feedback loop. A 200 mVpp ripple/noise figure is a realistic value for an unfiltered switching PSU. A triangle noise shape is also very common for switcher ripple.

With most frequencies the noise was completely filtered by the INA233. But with some select frequencies the results were significantly affected:

Frequency Std. deviation Max. deviation
338 kHz 0.018 V 0.034 V
677 kHz 0.020 V 0.038 V
683 kHz 0.021 V 0.040 V
694 kHz 0.015 V 0.030 V
1.014 MHz 0.063 V 0.110 V
1.353 MHz 0.025 V 0.043 V

I tested the frequencies by letting the freq generator sweep in 1 kHz steps up while watching the results that were read out in a loop. So I could have missed some peaks. Unfortunately I don't have the software tooling ready to create a proper graph with smaller steps.

These frequencies are something that can very well be created by a common switching PSU. Even PSUs switching at a much lower frequency will create harmonics that easily go in these regions.

Increasing the built-in averaging in the INA233 only partially helped, 0.026 V std. dev and 0.050 V max at 1.014 MHz with 64 averages.

I tested several RC combinations with R and C values that are already on the Glasgow BOM. Unfortunately 100 nF doesn't work as they usually aren't specced to the 40 V we need in 0402. Even if they were, the capacitance would be gone at that voltage. Also 2k2 as resistor is too high, the INA233 begins to read low by about 1% with this, even without noise.

A RC filter with 470 Ohms and 1 nF gives good results though:
0.016 V std. dev. and 0.026 V max dev at 1.014 MHz with just 4 averages. I couldn't see any noise at all the other frequencies listed above.

1 nF is available in 0402 as C0G up to 50 V.

So the question is: do we want to increase the BOM by 2 parts for making the ADC immune to noise at specific frequencies?

@electroniceel electroniceel self-assigned this Jan 6, 2021
@electroniceel
Copy link
Member Author

Idle current:

The idle current varied by 0.2 mA from the theoretical value given by the load resistors (2 resistors of 2k2 in parallel). For example I measured 4.5 mA at 4.78 V instead of the expected 4.3 mA. Or 2.4 mA measured at 2.55 V instead of the expected 2.3 mA. The difference percentage was constant across the set voltages, so it could be caused by load resistor values being out a bit.

Another reason could be idle current draw by devices connected to the Vio rail, e.g. the level shifters or the IO-expanders for the pull resistors.

Calibrating out this offset requires knowing the Vio voltage and the measured load resistor value. Using the set Vio voltage (instead of the measured actual voltage) should be enough for the precision expectations of Glasgow. This is realistic to be done in firmware.

@electroniceel
Copy link
Member Author

Current measurement accuracy:

I used a electronic load set to CC mode in series to my Keithley 2001 multimeter. I dialed in the currents on the e-load and compared the measurement on the multimeter with the values read out from Glasgow.

The idle voltage of Glasgow was measured first with disconnected load and subtracted from the following measurements.

I measured currents in 50 mA steps from 50 mA to 400 mA. The measured values were higher by between 1.3% and 1.5% than the values expected by ideal shunt resistors with 0.15 Ohms. This difference was constant between both ports. It could be both shunts being out a bit.

This difference could be calibrated out by firmware.

With calibration the measured error would be 0.1%, which is totally acceptable for Glasgow.

@electroniceel
Copy link
Member Author

Aliasing/Filtering of current measurements:

I connected a 47 Ohm base load resistor between Vio and GND. In parallel I connected a 470 Ohm pulse resistor in series with a N-MOSFET. The gate connected to my function generator. I set Vio to 3.3 V, yielding in about 70 mA with just the base load and 77 mA with the FET conducting.

I swept the frequency of the function gen in 1 kHz steps between 400 and 600 kHz and 900 and 1100 kHz, as these are the ranges the ADC is most sensitive to noise in.

I could not find any frequency that caused the measurement results to produce aliasing. So the implemented filtering seems to be adequate.

@electroniceel
Copy link
Member Author

Overcurrent with capacitor:

Tested with Vio = 3.3V, 100 µF polymer capacitor (ESR in the 0.01 Ohms region)

When first activating the Vio, then connecting the capacitor, a current limit of 130 mA was enough to not trigger.
When first connecting the capacitor, then activating the Vio, it needs a 300 mA limit to reliably not trigger.

This means the current in the first scenario is such a fast spike that the filtering and ADC timing doesn't let it register the current well.

100 µF polymer is quite a lot for something that is not expected to draw more than about 300 mA total, so this testing the limits. If cap charging leads to too many false OCP triggers, we could add a firmware option to slowly step up the Vio. This would also prevent shorts or bigger caps on the output from resetting Glasgow.

When testing with Vio set to 5V and then connecting the 100 µF I experienced some resets of Glasgow due to the 5 V rail dropping down too much. This isn't unexpected when comparing the 150 µF bulk cap on Glasgow with the 100 µF load cap. So a slow start option would be good.

@electroniceel
Copy link
Member Author

I tested the overcurrent protection reaction speed:

Current limit set to 50 mA, ADC speed to max. (140 µs interleaved, 280 µs current sampling speed).
The results varied a lot, so the following is the slowest reaction from 20 tries:

Current drawn 70 mA (3.3V, 47 Ohm):
DS4_QuickPrint14

Current drawn 330 mA (3.3V, 10 Ohm):
DS4_QuickPrint15

Yellow is Vio, magenta the gate of the FET that switches the current.

Since the worst time is just a bit above two sample times (560 µs), this means that unless there is a dead short on the rail, at least two samples are needed before the OCP triggers. If the drawn current is just a bit over the programmed limit, it takes about 5 samples. This indicates that the filtering is the reason for this.

In the 330 mA case I would have preferred a faster reaction time, since for example the integrated protection diodes of a DUT with the power pins reversed could already be damaged by then.

@electroniceel
Copy link
Member Author

Further experimentation showed that most likely the datasheet of the INA233 isn't detailed enough regarding when/how the limits are compared:

Figure 23 reads "Current Limit Detect Following Every Shunt Voltage Conversion". I understood this as that the actually read last is compared to the limit. This is most likely wrong.

The above measurements were taken with averaging set to 4. Once I switched down to 1 number of averages, the reaction times improved to a bit more than 280 µs. Since 4 averages would take 1120 µs, what most likely happens is that the INA233 calculates a moving average and that is compared against the limit value.

So for a fast reaction, any averaging in the INA233 itself has to be switched off. For less noise the firmware in the FX2 could take care of averaging.

@electroniceel
Copy link
Member Author

Vsense overvoltage test:

INA233 equipped with the filter from #221 (comment)
(a sample IC on a protoboard, no Glasgows were endangered in this test)

3v3 supply applied, Vbus voltage slowly increased, current into Vbus measured

  • until 42 V: nothing happens
  • at 42 V: current begins to increase slowly, most probably the TVS that begins to conduct
  • 56 V: about 50 mA flows through the TVS
  • 60 V: the TVS fails short

Desoldered the TVS, inspected the INA233:

  • No increased supply current drawn
  • No reduced impedance on Vbus (the voltage measurement pin)
  • I2C comms works
  • Voltage sense accuracy not reduced

-> protection circuitry performs as planned

@electroniceel
Copy link
Member Author

SMBus Alert Response Address:

I changed the i2c address of the port A dac with a bodge wire, just like I plan to change it for revC3.

Accessing the DAC on port A, port B and ports AB simultaneously worked (i2c address changed in firmware of course).
Also querying the Alert Response Address cleared the ~ALERT line of the INA233s as planned.

So there are no negative consequences to be expected when changing the dac address in revC3 and the wanted outcome of being able to query the ARA is achieved.

But after being more familiar with the state mechanisms and requirements of the firmware, I think the current solution of using a state cache and reset for the INA233 is the better solution than using the ARA, at least until we get muxed i2c busses as planned for revD and maybe later revC.

Consider the following case:

  • There is an alert on port B
  • The INA233 of port B pulls low it's ~ALERT line, thus disabling the voltage regulator on port B through the diode logic
  • The firmware sees the alert and begins to handle it
  • The INA233s on both ports are queried for alerts, it is found out that port B triggered the alert
  • Firmware switches off the enable line for Vio B, so the diode logic isn't required anymore to keep Vio B off
  • There is now an alert on port A too
  • The INA233 of port A pulls low it's ~ALERT line, thus disabling the voltage regulator on port A through the diode logic
  • Firmware continues to handle the previous alert on port B. The next thing to do would be to disable the ~ALERT line for port B
  • The Alert Response Protocol is not directed at a special device. If multiple devices have an alert situation, the device with the lowest i2c address will win the request and thus disable their ~ALERT line. The other devices with alert situations will respond to subsequent Alert Response queries.
  • The INA233 with the lowest i2c address is the one on port A. When it disables it's ~ALERT line, the voltage regulator on port A will now be re-enabled, because firmware hasn't gotten around to disable it's enable line yet

The cache and reset logic used now is better in that regard, because it only affects the one INA233 that is addressed through it's i2c address. So there is no risk of accidently reenabling a already disabled Vio.

I still think it makes sense to fix the i2c address clash for revC3, but keep the cache & reset logic from revC2 firmware.

electroniceel added a commit that referenced this issue Jan 10, 2021
Without this filter, Vsense is sensitive to substantial aliasing on specific frequencies.

Detailed measurements and reasoning in
#221 (comment)
esden pushed a commit that referenced this issue Jul 31, 2023
Without this filter, Vsense is sensitive to substantial aliasing on specific frequencies.

Detailed measurements and reasoning in
#221 (comment)
whitequark pushed a commit that referenced this issue Oct 6, 2023
Without this filter, Vsense is sensitive to substantial aliasing on specific frequencies.

Detailed measurements and reasoning in
#221 (comment)
github-merge-queue bot pushed a commit that referenced this issue Oct 6, 2023
Without this filter, Vsense is sensitive to substantial aliasing on specific frequencies.

Detailed measurements and reasoning in
#221 (comment)
nanographs pushed a commit to nanographs/Scan-Gen-Glasgow-Testing that referenced this issue Dec 14, 2023
Without this filter, Vsense is sensitive to substantial aliasing on specific frequencies.

Detailed measurements and reasoning in
GlasgowEmbedded/glasgow#221 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hardware Component: hardware qualification Lifecycle stage: qualification revC Hardware revision: C
Projects
None yet
Development

No branches or pull requests

2 participants