numat / alicat

Python driver and command line tool for Alicat mass flow controllers.
GNU General Public License v2.0
21 stars 27 forks source link

Enhancement Request: Set ramp rate #127

Open patr1ck opened 2 weeks ago

patr1ck commented 2 weeks ago

Alicat MFCs allow you to set a ramp rate on device – it would be great if we could set that through the python API as well.

Thanks!

alexrudd2 commented 1 week ago

See also #108

alexrudd2 commented 1 week ago

Relevant commands from the Alicat serial primer: image image

image image

alexrudd2 commented 1 week ago

@patr1ck Thanks for the enhancement suggestion. PR is welcome of course. I may be able to add some functionality here, but no longer work with Alicats regularly.

Regarding your use case:

patr1ck commented 1 week ago

Hey Alex, Thanks so much for the response! I super appreciate the all work done and shared on this module so far – it's extremely helpful.

To answer your questions:

We've worked around this API not existing by adding simple ramping in our automation, but it would be awesome to rely on the device to do it instead of our own code. I probably don't have time to dig into the serial connection code and add it myself, but would be happy to test if it becomes available in the future.

alexrudd2 commented 4 days ago

After a bit of testing I realized that I do not have access to a device with firmware new enough for ramping (!). So I'll have to work a bit 'blind'

For the time being I have a small fix for #108 in https://github.com/alexrudd2/alicat/tree/ramp Would you mind testing that branch?

To know how this is being used (and for my own curiosity), do you mind sharing your organization and use case?

patr1ck commented 3 days ago

Wow, awesome, thank you Alex! I'll test this on Monday when our system is available.

I work for Ammobia and we use various Alicat devices in our experimental systems. We use Pyopticon instead of LabView to do a lot of our automation of those systems, and have written some Alicat widgets for Pyopticon which leverage this library. There's nothing proprietary about them, so we plan to publish them as soon as I can clean them up into a neat package. (They are mostly just glue between this library and Pyopticon anyways.)

patr1ck commented 21 hours ago

I've tested the branch and set_ramp_config seems to work just fine on device! I'm not able to call get_ramp_config (as seen in the tests) because it looks like that doesn't exist in the branch, but maybe I'm not looking in the right place?

alexrudd2 commented 19 hours ago

I've tested the branch and set_ramp_config seems to work just fine on device! I'm not able to call get_ramp_config (as seen in the tests) because it looks like that doesn't exist in the branch, but maybe I'm not looking in the right place?

That's good news! I didn't write get_ramp_config yet. :)

I work for Ammobia and we use various Alicat devices in our experimental systems

Cool tech! Don't forget to get the upgraded seals for pure NH3 streams. If you need a Python programmer with experience with laboratory and SCADA systems (in Central timezone), please contact me at alex <*AT> ruddick.tech.

alexrudd2 commented 3 minutes ago

Can you try get_ramp_config now?

Also can you let me know if the tests run against a real device? Just change the lines below.

https://github.com/numat/alicat/blob/d25d91d2612db0ab03c7724cdff26840a063cedc/tests/test_driver.py#L9-L12

from alicat.driver import FlowController

ADDRESS = '{YOUR SERIAL PORT}`