Add swap command #104

Closed
atse wants to merge 2 commits from atse:swap_tec_polarity into master
Contributor

For use with Zotino, since the Zotino header on the Thermostat has the current pins reversed.

For use with Zotino, since the Zotino header on the Thermostat has the current pins reversed.
atse added 2 commits 2024-04-26 17:44:37 +08:00
Per-channel current swapping, for use with Zotino in the meantime on
HWRevs < 3.0 as the Zotino headers are swapped on the Thermostat.
Signed-off-by: Egor Savkin <es@m-labs.hk>
esavkin reviewed 2024-04-29 10:41:52 +08:00
@ -414,1 +414,4 @@
fn swap_tec_polarity (socket: &mut TcpSocket, channels: &mut Channels, channel: Option<usize>) -> Result<Handler, Error> {
for c in 0..CHANNELS {
if channel.is_none() || channel == Some(c) {
Owner

Isn't there a way to set it directly into channel_state?

Isn't there a way to set it directly into channel_state?
sb10q reviewed 2024-04-29 13:22:46 +08:00
@ -122,0 +122,4 @@
-i_set
} else {
i_set
}
Owner

Can't it be handled just at the DAC and current readout, instead of having to invert it all over the place?

Can't it be handled just at the DAC and current readout, instead of having to invert it all over the place?
sb10q reviewed 2024-04-29 13:26:20 +08:00
@ -415,0 +415,4 @@
fn swap_tec_polarity (socket: &mut TcpSocket, channels: &mut Channels, channel: Option<usize>) -> Result<Handler, Error> {
for c in 0..CHANNELS {
if channel.is_none() || channel == Some(c) {
channels.channel_state(c).swap_tec_polarity = !channels.channel_state(c).swap_tec_polarity;
Owner

That's a terrible API. Simply add a way to set swapped to true/false (with the reference being the front panel polarity) instead of only something that toggles the property without any way to know what its value is.

That's a terrible API. Simply add a way to set swapped to true/false (with the reference being the front panel polarity) instead of only something that toggles the property without any way to know what its value is.
Author
Contributor

Yeah... to tell the truth this was a bodged API intended to get temperature regulation on the Zotino DAC working quickly; This is sketchy for production.

I've been planning an output mode command that could switch between TEC and resistive heater modes, and think adding a Zotino mode to that would be a good fit, since all 3 modes are about the current direction to the load. That's most certainly better than just a swap command API-wise, so I think we should opt for that instead.

Yeah... to tell the truth this was a bodged API intended to get temperature regulation on the Zotino DAC working quickly; This is sketchy for production. I've been planning an output mode command that could switch between TEC and resistive heater modes, and think adding a Zotino mode to that would be a good fit, since all 3 modes are about the current direction to the load. That's most certainly better than just a swap command API-wise, so I think we should opt for that instead.
Author
Contributor

Closing this PR in favour of a mode switching command instead.

Closing this PR in favour of a mode switching command instead.
atse closed this pull request 2024-07-05 16:52:01 +08:00
Owner

Please don't call it a Zotino mode. It's a terrible name that gives no indication about what it does and can be misleading in many ways (e.g. does it set PID parameters for Zotino?).

Please don't call it a Zotino mode. It's a terrible name that gives no indication about what it does and can be misleading in many ways (e.g. does it set PID parameters for Zotino?).

Pull request closed

Sign in to join this conversation.
No reviewers
No Label
No Milestone
No Assignees
3 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#104
No description provided.