Skip to content

fix(ownverter): sensor scaling from the v1.1 calibrations; I3_LOW is a current sensor - #171

Open
luizvilla wants to merge 1 commit into
owntech-foundation:mainfrom
luizvilla:fix/ownverter-sensor-scaling
Open

luizvilla wants to merge 1 commit into
owntech-foundation:mainfrom
luizvilla:fix/ownverter-sensor-scaling

Conversation

@luizvilla

Copy link
Copy Markdown
Member

Summary

The Ownverter overlays don't match the hardware on two points:

  • I3_LOW scaling: in every overlay, I3_LOW has the voltage sensors' scaling.
  • v1.1.0 values: ownverter_v1_1_0.overlay still has v1.0.0's values, but v1.1 changed the sensing parts.
 ownverter_v0_9_0.overlay, ownverter_v1_0_0.overlay
-  I3_LOW    gain 0.045    offset -92.2    # voltage sensors' scaling
+  I3_LOW    gain 0.005    offset -10      # same as I1_LOW / I2_LOW

 ownverter_v1_1_0.overlay
-  I1/I2_LOW gain 0.005    offset -10
-  I3_LOW    gain 0.045    offset -92.2
+  I1/I2/I3_LOW gain 0.00951 offset -19.87
-  I_HIGH    gain 0.005    offset -10
+  I_HIGH    gain 0.00938  offset -19.73    # sign kept: reads -I, as before
-  V1-3_LOW  gain 0.045    offset -92.2
+  V1-3_LOW  gain 0.03002  offset -0.02
   V_HIGH    unchanged (0.02996 / 0)

Why v1.1.0 differs from v1.0.0 (OWNVERTER KiCad repository: v1.0.0 4ff54ed, v1.1.0 29fcf13, v1.1.1 6b4b9be):

Sensing v1.0.0 v1.1.0 and v1.1.1
Leg current I1–I3 ACS730KLCTR-20AB ACS724LLCTR-50AB, new op-amp network
Leg voltage V1–V3 AMC1100 AMC1311B, new dividers

v1.1.0 → v1.1.1 changes nothing in the sensing, so one set of values covers both.

The new v1.1.0 values are the mean of the production calibrations of three v1.1.1 boards. Each calibration is a fit of DMM reading against raw ADC counts:

Sensor Board A Board B Board C Mean (new value)
I1_LOW 0.00929 / −19.42 0.00916 / −18.93 0.01011 / −21.65
I2_LOW 0.00944 / −19.61 0.00928 / −19.30 0.00940 / −19.59
I3_LOW 0.00965 / −20.08 0.00928 / −19.30 0.00999 / −20.95 0.00951 / −19.87 (I1–I3)
I_HIGH −0.00958 / +20.15 −0.00957 / +20.14 −0.00899 / +18.90 magnitude 0.00938 / 19.73
V1–V3_LOW 0.0295–0.0308, offsets −0.98 to +0.65 0.03002 / −0.02
V_HIGH 0.02981 / 0.14 0.02992 / 0.26 0.02990 / −0.03 unchanged, 0.02996 / 0

The voltage scaling matches the schematic. R616 330 kΩ / R617 5.6 kΩ give a ratio of 0.0167 into the AMC1311B; a gain-1 difference amplifier feeds the ADC. At the 2.048 V reference, 1 count is 0.5 mV, which is 0.0300 V at the leg, with 0 V at 0 counts.

I_HIGH's sign: the calibrations have a negative gain, so the current reads with its true sign. This PR keeps the old positive sign, because applications negate I_HIGH (examples, FOC_speed_hall_sensor: I_high = -meas_data). A board with a stored NVS calibration still reads the opposite sign: see #169.

Evidence

  • Before (v1.1.1 boards, overlay values):
    • I1/I2: limits of ±7 A become counts 600 and 3400, which is −13.4 to −15.6 A and +12.2 to +12.7 A of real current.
    • I3: the same ±7 A becomes counts 1893–2205, which is −1.7 to −2.0 A and +1.1 to +1.2 A. Phase 3 trips at low current.
  • After: the ±7 A limits are counts 1353 and 2825, with 0 A at 2089 (the boards measure 2066–2141).
  • Build on this branch, env USB:
    • ownverter 1_0_0 and 1_1_0 build, and zephyr.dts has the new values.
    • 0_9_0: the devicetree has the new I3_LOW value, but the build fails as it already does on main: the overlay has no min-frequency (DT_N_S_power_shield_P_min_frequency). That is not changed here.
  • On the SPOC bench (CUT Spin with the Ownverter 1.1.0 devicetree, scope on the pins): every current limit trips within 6 mV of the threshold computed from these values. This was measured on a development branch, with hardware limits that are not in main yet.

Merge Danger

Door: two-way

Values only. A revert restores the old ones.

Blast Radius: Ownverter readings

  • Readings: on Ownverter v1.1.x boards without a stored NVS calibration, I1–I3, I_HIGH and V1–V3_LOW read different values. They now match the hardware.
  • Limits: current limits act at the intended current, so they trip at about half the real current they did before.
  • Unchanged: boards with a stored calibration (NVS overrides the devicetree), and v0.9.0/v1.0.0 except for I3_LOW.

🤖 Generated with Claude Code

…a current sensor

- v0.9.0, v1.0.0, v1.1.0: I3_LOW had the voltage sensors' scaling
  (0.045 / -92.2); it is a current sensor like I1_LOW and I2_LOW.
- v1.1.0: the overlay still had v1.0.0's scaling, but v1.1 changed the
  sensing (ACS730KLCTR-20AB -> ACS724LLCTR-50AB, AMC1100 -> AMC1311B).
  New values: mean of the production calibrations of three v1.1.1 boards
  (v1.1.1 senses like v1.1.0). I_HIGH keeps its sign (reads -I).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant