sb0 changed the topic of #m-labs to: https://m-labs.hk :: Mattermost https://chat.m-labs.hk :: Logs http://irclog.whitequark.org/m-labs
lkcl has quit [Ping timeout: 258 seconds]
lkcl has joined #m-labs
lkcl has quit [Ping timeout: 265 seconds]
X-Scale` has joined #m-labs
X-Scale has quit [Ping timeout: 256 seconds]
X-Scale` is now known as X-Scale
airwoodix6 has joined #m-labs
airwoodix has quit [Ping timeout: 260 seconds]
airwoodix6 is now known as airwoodix
_whitelogger has joined #m-labs
rohitksingh has quit [Ping timeout: 258 seconds]
rohitksingh has joined #m-labs
rohitksingh has quit [Ping timeout: 255 seconds]
rohitksingh has joined #m-labs
rohitksingh has quit [Read error: Connection reset by peer]
rohitksingh has joined #m-labs
rohitksingh has quit [Remote host closed the connection]
rohitksingh has joined #m-labs
rohitksingh has quit [Remote host closed the connection]
rohitksingh has joined #m-labs
rohitksingh has quit [Remote host closed the connection]
rohitksingh has joined #m-labs
rohitksingh has quit [Remote host closed the connection]
rohitksingh has joined #m-labs
rohitksingh has quit [Remote host closed the connection]
rohitksingh has joined #m-labs
rohitksingh has quit [Remote host closed the connection]
rohitksingh has joined #m-labs
rohitksingh has quit [Remote host closed the connection]
rohitksingh has joined #m-labs
rohitksingh has quit [Remote host closed the connection]
rohitksingh has joined #m-labs
rohitksingh has quit [Read error: Connection reset by peer]
rohitksingh has joined #m-labs
rohitksingh has quit [Remote host closed the connection]
rohitksingh has joined #m-labs
rohitksingh has quit [Remote host closed the connection]
lkcl has joined #m-labs
rohitksingh has joined #m-labs
lkcl has quit [Ping timeout: 265 seconds]
lkcl has joined #m-labs
X-Scale has quit [Ping timeout: 258 seconds]
X-Scale` has joined #m-labs
X-Scale` is now known as X-Scale
rohitksingh has quit [Ping timeout: 256 seconds]
<mtrbot-ml> [mattermost] <hartytp> @astro comments on Thermostat
<mtrbot-ml> [mattermost] <hartytp> 1. Since there is quite a bit of overlap between Thermostat and Stabilizer on a hardware/use level, I'd really like to see as much overlap as conveniently possible between the codebase, tooling and user interfaces
<mtrbot-ml> [mattermost] <hartytp> 2. I don't mind nix (and I get why you want it for your CI system) but it's really great if the firmware can be built without nix. I assume this should be okay now that we're no longer using an old version of smoltcp?
<mtrbot-ml> [mattermost] <hartytp> 1a. For obvious reasons, the v1.0 firmware was heavily based on IonPak, but it would be good to do a little de-krufting and remove any residual ion-pak bits that aren't relevant to thermostat (unless that's already been done since last time I looked at the code)
<mtrbot-ml> [mattermost] <hartytp> I still generally prefer git hub to the m-labs gitea
<mtrbot-ml> [mattermost] <hartytp> from a user perspective, it's nicer to keep everything in one place. Also last time I checked, there were annoyances with the m-labs system like password reset not being enabled. these things can be fixed relatively easily, but I don't see the m-labs system being preferable from a user perspective. It's a weak preference and I'm not going to kick up a fuss over it, but I'd still prefer to be on GH
<mtrbot-ml> [mattermost] <hartytp> also, let's move it to a proper "thermostat" repo rather than "ionpak-thermostat" (there is no connection between those projects...)
<mtrbot-ml> [mattermost] <hartytp> 3. The way you're doing the maths for the temperature conversion right now is prone to rounding errors. That will definitely limit the overall system performance. There are two approaches to resolving this: be smarter with the maths (linearize around the operating point and take care with scale factors etc) or use f64
<mtrbot-ml> [mattermost] <hartytp> we need to do one or the other. f64 is probably easiest (that's what was in the contract)
<mtrbot-ml> [mattermost] <hartytp> how do I search within the project sources in gitea?
<mtrbot-ml> [mattermost] <hartytp> https://git.m-labs.hk/M-Labs/ionpak-thermostat/src/branch/master/firmware/src/main.rs#L262 shouldn't this be 0xFFFFFF (i.e. 24-bits, not 23 bits)? Or is this to do with the way the ADC is configured?
<mtrbot-ml> [mattermost] <hartytp> 4. The temperature conversion does not seem right
<mtrbot-ml> [mattermost] <hartytp> I don't think that's the right way of calculating the thermistor resistance
<mtrbot-ml> [mattermost] <hartytp> https://pasteboard.co/IXZ7Kef.jpg
<mtrbot-ml> [mattermost] <hartytp> (and NB that beta is just the ADC word / 0xFFFFFF )
<mtrbot-ml> [mattermost] <hartytp> you shouldn't need an r.abs() since resistance is always positive
<mtrbot-ml> [mattermost] <sb10q> @hartytp the repos is here https://git.m-labs.hk/m-labs/thermostat
<mtrbot-ml> [mattermost] <hartytp> ok I didn't notice that one as the ionpak-thermostat once has been updated more recently
lkcl has quit [Ping timeout: 256 seconds]
<mtrbot-ml> [mattermost] <hartytp> fine, well that addresses one thing :)
<mtrbot-ml> [mattermost] <sb10q> and password reset now works on gitea afaik
<mtrbot-ml> [mattermost] <hartytp> ok, that's new since last time I checked. Anyway, from a purely user perspective I can see no way that it's not less convenient that GH
<mtrbot-ml> [mattermost] <hartytp> For the Steinhart-Hart equation, the form I'm nost used to working with (and which maps best to the parameters that manufacturers tend to specify) is For the Steinhart-Hart equation, the form I'm nost used to working with (and which maps best to the parameters that manufacturers tend to specify) is :
<mtrbot-ml> [mattermost] <hartytp> I don't really mind how we do the maths in firmware since we can always add conversions to the python-side code
<mtrbot-ml> [mattermost] <hartytp> but that's just a FYI
<mtrbot-ml> [mattermost] <hartytp> Anyway, I'm pretty sure the temperature conversion doesn't work right now. The best bet would be to place a 10k resistor in place of a thermistor and check you can get T0 out of it
<mtrbot-ml> [mattermost] <sb10q> yeah, wait until GH deletes your account and the organizations you are associated with because you expressed an opinion that they dislike
<mtrbot-ml> [mattermost] <hartytp> 5. The TEC driver is now controlled by an 18-bit dac (AD5680BRJZ) rather than PWM
<mtrbot-ml> [mattermost] <sb10q> it's microsoft and they do stuff like that
<mtrbot-ml> [mattermost] <hartytp> although the current/voltage limits are still set by PWM
<mtrbot-ml> [mattermost] <hartytp> @sb10q I've never heard of GH doing that
<mtrbot-ml> [mattermost] <sb10q> I have and people I know have experienced it first hand
<mtrbot-ml> [mattermost] <hartytp> and would be happy to cross that bridge when we come to it. Right now I find GH easier to deal with and am more concerned with UX than making everything purely open source
<mtrbot-ml> [mattermost] <hartytp> well, I don't have time for this argument, I'm purely expressing my opinion as a user
<mtrbot-ml> [mattermost] <hartytp> 6. A low priority, but once everything else is working the contract calls for calibration of the zero-current point of the TEC driver.
<mtrbot-ml> [mattermost] <hartytp> This means using the microprocessor ADC to measure the TEC driver reference voltage and then figuring out which DAC word gives the same ADC reading
<mtrbot-ml> [mattermost] <hartytp> since we use the same ADC, gain, etc most systematics in the measurement should common-mode out and this should be pretty accurate
<mtrbot-ml> [mattermost] <hartytp> 7. You can read back the TEC current and voltage using the microprocess's ADC
<mtrbot-ml> [mattermost] <hartytp> I'd strongly suggest that for development/testing you hook a power resistor up in place of a TEC and use those to test functionality
<mtrbot-ml> [mattermost] <hartytp> e.g. check that the current limit functionality does actually limit the current etc etc
<mtrbot-ml> [mattermost] <hartytp> (it will take much less of everyone's time if you can test your code in place rather than relying on us to test for you and report back)
<mtrbot-ml> [mattermost] <hartytp> 8. We haven't funded software power/thermal management so it's left to the user to set current limits which won't result in over temperature/current issues
<mtrbot-ml> [mattermost] <hartytp> before this becomes a full production system, those issues will need to be addressed so worth bearing that in mind at this stage (even though we won't actually implement the features)
<mtrbot-ml> [mattermost] <hartytp> 9. Then the rest of the comments I have were about making the interface a bit tidier
<mtrbot-ml> [mattermost] <hartytp> The more I think about it, the more I'd suggest having the simplest possible remote interface, which only works in machine units
<mtrbot-ml> [mattermost] <hartytp> and then add SI conversion functions to the python driver
<mtrbot-ml> [mattermost] <hartytp> anyway, I can't remember where we are with this, so I suggest the easiest thing is if you sketch out what the python driver should look like first
<mtrbot-ml> [mattermost] <hartytp> we can then give any feedback on that
<mtrbot-ml> [mattermost] <hartytp> @pathfinder49 any other comments?
<mtrbot-ml> [mattermost] <hartytp> @astro other than that, if you have any questions about how the hw works (e.g. what voltage to apply on which pin to do what, how to configure pin straps, etc etc) just let me know
sensille has left #m-labs [#m-labs]
<mtrbot-ml> [mattermost] <hartytp> oh, if it's easy let's also expose things like the TEC driver frequency control
<mtrbot-ml> [mattermost] <hartytp> or, if you don't want to do that, please at least make sure we document what setting is used
<mtrbot-ml> [mattermost] <hartytp> same goes for the ADC filter settings etc
<mtrbot-ml> [mattermost] <hartytp> I'm happy with a methodology where we start with a minimal user interface and only expose settings as they are required by users (it's trivial to add to the UI) but it is nice to have a clear documentation of the important bits of hw configuration (sample rate, bandwidth etc)
<mtrbot-ml> [mattermost] <hartytp> Thanks! Looking forward to playing with it
<mtrbot-ml> [mattermost] <hartytp> the other thing is that we should maintain a to do list of things that aren't yet implemented (AT detection, thermal management, limiting the combined power on the two channels, etc)
<mtrbot-ml> [mattermost] <hartytp> maybe just gitea issues?
<mtrbot-ml> [mattermost] <hartytp> 10. also, adding LED control to indicate the regulation status etc
<mtrbot-ml> [mattermost] <hartytp> 11. the PID controller does "gain after integrate" so a small change in the gain will result in a spike in the output, which is nasty
<mtrbot-ml> [mattermost] <hartytp> should be integral += error*ki
<mtrbot-ml> [mattermost] <hartytp> cf the loop filter in stabilizer
<mtrbot-ml> [mattermost] <hartytp> 12. Maybe it's not an issue for these SD ADCs, but it's generally best practice not to continually poll the ADC
<mtrbot-ml> [mattermost] <hartytp> doesn't it have a pin that indicates when data is ready?
<mtrbot-ml> [mattermost] <sb10q> what is the issue with polling? the wasted CPU cycles? the EMI?
<mtrbot-ml> [mattermost] <sb10q> the power consumption?
<mtrbot-ml> [mattermost] <hartytp> https://github.com/sinara-hw/Booster/issues/325
<mtrbot-ml> [mattermost] <hartytp> things like that
<mtrbot-ml> [mattermost] <hartytp> likely not an issue with SD ADCs I guess, but it's generally better not to
<mtrbot-ml> [mattermost] <hartytp> since the ADC provides a DOUT/RDYn pin that already goes to a GPIO on the micro, it's really easy to avoid doing that
<mtrbot-ml> [mattermost] <hartytp> you can hook it up to an interrupt if you want to be fancy, but otherwise just poll that GPIO
<mtrbot-ml> [mattermost] <sb10q> hmm why would that apply to thermostat?
<mtrbot-ml> [mattermost] <sb10q> and it seems greg did not fix the underlying problem but merely applied a workaroud
<mtrbot-ml> [mattermost] <hartytp> well, 3.3V / 24 bits is a pretty small voltage
<mtrbot-ml> [mattermost] <sb10q> the ADC isn't supposed to behave like that during ADC transactions, is it?
<mtrbot-ml> [mattermost] <hartytp> it's pretty easy to get artifacts due to noise on the digital side
<mtrbot-ml> [mattermost] <sb10q> *I2C transactions
<mtrbot-ml> [mattermost] <hartytp> no, Greg fixed the underlying problem which is that it's not recommended practice to read out from those ADCs when they are mid conversion
<mtrbot-ml> [mattermost] <sb10q> recommended by whom?
<mtrbot-ml> [mattermost] <hartytp> datahseets
<mtrbot-ml> [mattermost] <hartytp> that's pretty standard
<mtrbot-ml> [mattermost] <hartytp> depends on ADC architecture, but there are windows in the cycle where they are very noise sensitive
<mtrbot-ml> [mattermost] <sb10q> and they come with a I2C bus which is potentially shared with many other devices? sounds stupid
<mtrbot-ml> [mattermost] <hartytp> anyway, this again falls into the category of things I don't have time to argue about. My point is just (1) it's generally a good idea to minimize activity on the digital lines during ADC conversions (2) polling a GPIO is as easy as polling an ADC register, is more in line with standard usage/recommendations and is quicker than arguing about ADC design
<mtrbot-ml> [mattermost] <sb10q> arguing about those things is where good design comes from :) something point-to-point like SPI would have been more appropriate than I2C, which is designed for shared communications (even supports several masters in theory), and becomes a footgun in this case
<mtrbot-ml> [mattermost] <sb10q> it probably doesn't matter at all in our case, but it's not a good decision from the chip vendor
<mtrbot-ml> [mattermost] <hartytp> sure. For booster, there are a few issues like that. However, they're not thermostat-relevant
<mtrbot-ml> [mattermost] <sb10q> and one can do point-to-point I2C of course. but a I2C bus is normally shared.
lkcl has joined #m-labs
<mtrbot-ml> [mattermost] <hartytp> actually, to be fair, in booster the problem was even worse
<mtrbot-ml> [mattermost] <hartytp> because they didn't do any synchronisation between the read out and the conversion
<mtrbot-ml> [mattermost] <hartytp> so the two data words that were read out could come from different samples, which can cause large glitches
<mtrbot-ml> [mattermost] <hartytp> IIRC the thermostat firmware currently ensures we only read out each sample once
<mtrbot-ml> [mattermost] <hartytp> but, it still feels cleaner to time everything from the DOUT line as that's what it's there for
<mtrbot-ml> [mattermost] <sb10q> you can also say that polling follows the principle of economy of mechanism since everything goes over the same interface
<mtrbot-ml> [mattermost] <sb10q> it also serializes everything whereas the DOUT line operates in parallel (though the race condition problems are moot in this case)
lkcl has quit [Ping timeout: 240 seconds]
lkcl has joined #m-labs
lkcl_ has joined #m-labs
lkcl has quit [Ping timeout: 268 seconds]
lkcl__ has joined #m-labs
lkcl_ has quit [Ping timeout: 255 seconds]
Dar1us has quit [Ping timeout: 258 seconds]
Dar1us has joined #m-labs
lkcl__ has quit [Remote host closed the connection]
lkcl__ has joined #m-labs
MikeP has joined #m-labs
MikeP has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cr1901_modern1 has joined #m-labs
cr1901_modern has quit [Ping timeout: 256 seconds]
cr1901_modern1 has quit [Quit: Leaving.]
cr1901_modern has joined #m-labs
rohitksingh has joined #m-labs
early has quit [Quit: Leaving]
early has joined #m-labs
cr1901_modern has quit [Quit: Leaving.]
cr1901_modern has joined #m-labs
early has quit [Ping timeout: 255 seconds]
early has joined #m-labs