Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement limit switches #33

Open
KonradMcClure opened this issue Aug 12, 2021 · 0 comments
Open

Implement limit switches #33

KonradMcClure opened this issue Aug 12, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@KonradMcClure
Copy link
Collaborator

There are parts of the code that depend on the use of limit switches on the syringe pump, namely in functions like auto_home() and subsequently interfaces.drive_step_stick()

def drive_step_stick(cycles, direction):
  ...
  temp = arduino.readline()
          if temp == b"DONE\r\n" or temp == b"":
              return 0
          else:
              return int(temp)

The return int(temp) above refers to the arduino returning the amount of steps that were left before it hit the limit switch. From there the idea is we can recalibrate if for some reason the plunger of the syringe isn't where we thought it was. Functions like auto_home() (which tells the stepper to move 10000 steps, when 9550 is the full 1mL volume) are in the code but aren't used because these limit switches haven't been implemented in hardware, and there isn't any software in place for what to do with the returned integer if we do hit the switch at an unexpected time.

To Do:

  • Add the stepper motors in hardware, into the Arduino D3 and D4 pins (See Pi-ArduinoStepStickDriver.ino)
  • Add in software handling for the returned integer, such as setting a new volume of 0 or 1 depending on the direction the stepper was moving, and telling it to pump again for the remaining volume that wasn't added to the solution yet.
@KonradMcClure KonradMcClure added the enhancement New feature or request label Aug 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant