code review #38

Closed
opened 2020-12-28 17:47:12 +08:00 by sb10q · 4 comments

in particular:

  • limits setting
  • zero-current calibration
in particular: * limits setting * zero-current calibration
topquark12 was assigned by sb10q 2020-12-28 17:47:18 +08:00
sb10q changed title from review code that sets limits to code review 2020-12-28 17:52:25 +08:00

How 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.

How 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.
Poster
Owner

the thermostat current read back is very noisy at >100mA p-p

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?

> the thermostat current read back is very noisy at >100mA p-p 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.

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 with center 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.

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 with ```center 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.
sb10q closed this issue 2021-01-25 19:55:22 +08:00
Sign in to join this conversation.
No Label
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: M-Labs/thermostat#38
There is no content yet.