SimLeek / silverpak-syringe-pump

Python library for controlling a Silverpak motor
2 stars 0 forks source link

improve pysilverpak #17

Closed iroll closed 9 years ago

iroll commented 10 years ago

1) During a very long (e.g. 28 day) pumping program, we want to be able to query the motor and get:

a) an indication that the motor is still alive b) information about the status of the current program (in order of difficulty: stopped, running, loop count) c) ability to pause a program and continue it

2) figure out whatever interactivity we can get from the motor so that we can propose new features based on that

SimLeek commented 10 years ago

I checked the commands and none of the query commands work with other commands, so I can't tell what part of a loop I'm in, or send constant updates.

However, I can query the position and velocity of the motor to check that it's sending data and moving at correctly. That will also tell if it's stopped or running.

Pausing and continuing the program is impossible, but I can add an offset and starting direction to pumping

Interactivity is below minimum standards. Example functions in the documentation like "/1P1000p66R" do not work at all. I don't know if this is a problem with the pysilverpak library or with the motor.

iroll commented 10 years ago

It could be pysilverpak--try working interactively with the pump and see if it works better. Remember how we've seen in the past that pysilverpak made commands seem to take longer than they should have?

On Mon, Aug 18, 2014 at 2:19 PM, SimLeek notifications@github.com wrote:

I checked the commands and none of the query commands work with other commands, so I can't tell what part of a loop I'm in, or send constant updates.

However, I can query the position and velocity of the motor to check that it's sending data and moving at correctly. That will also tell if it's stopped or running.

Pausing and continuing the program is impossible, but I can add an offset and starting direction to pumping

Interactivity is below minimum standards. Example functions in the documentation like "/1P1000p66R" do not work at all. I don't know if this is a problem with the pysilverpak library, or with the motor.

— Reply to this email directly or view it on GitHub https://github.com/SimLeek/silverpak-syringe-pump/issues/17#issuecomment-52556860 .

SimLeek commented 10 years ago

Going straight through the terminal, I can get immediate responses and I can get data from the Q command, which has almost everything to do with the status stuff you're talking about. Trying the p command by itself gives the bad command code, and same with adding it to anything. The query commands don't report bad command, but they completely override any command they're added to.

The motor status seems to work though. That and the added speed makes it worth tearing apart the original pysilverpak code, but that will take a while, so before I finish that, I'll use the & command to get the motor type, then upload that to the git, then I'll only commit to won't push to git until I have fully working code.

SimLeek commented 10 years ago

I added the two status commands and pushed them to the repository. Now I'll be working on rewriting the serial connection library for speed and more commands.

iroll commented 10 years ago

Let's change the scope of this one to the following:

Remove legacy pysilverpak and write its functionality directly into syringe_pump_controller

SimLeek commented 9 years ago

Done. I could improve things a lot by having the serial class run with its own thread, its own queue of commands, and adding callbacks in the UI file instead of immediately sending back, but I'll add that as another issue.