code review #38
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
in particular:
review code that sets limitsto code reviewHow good does the zero-current calibration needs to be? Currently the thermostat zero current is off by 40mA max after boot when measured externally. Now sure how much this can be improved, as the thermostat current read back is very noisy at >100mA p-p, and the current set point to current output relationship does not seem linear in the zero-current region. Also I can see the output current has drifted by 20mA as I type this message, with 0A current set point.
Edit: Ok it might not have been drifting, but some hysteresis from me moving the current setpoint around. Either way, don't think there's much room to improve the zero-current cal.
This number is a bit surprising. Is that what you would expect from the schematics and component datasheets? If not, can you open an issue in the hardware project at https://github.com/sinara-hw/thermostat?
Not sure if the output current is actually that noisy, or if it is just the adc readback. Also not sure if it is a hardware issue or software.
Anyway, I think the inconsistent current output problem I just found out is more problematic. Entering
pwm 1 i_set 1
repeatedly would have the thermostat generate anywhere from 0.88A to 1.1698A at the output.Edit: Well actually when I come to think about it, some of the current noise could be from the inconsistent current output issue.
Bug found. So the thermostat can have the MAX chip vref be set to a constant number with
center 1 1.5
or have it be measured at every cycle withcenter 1 vref
, which the thermostat defaults to. If the vref measurement is a bit noisy (which it is), this noise will be transfered to the DAC, which controls the output current.Pinning the center voltage to 1.5v with
center 1 1.5
solves the inconsistent output current issue.Think I'll change the vref behavior by only have it sampled and averaged once at boot, and not have it update every cycle.