Giter VIP home page Giter VIP logo

syringe_pump's Introduction

syringe pump CAD model and control code

source files to build and run a syringe pump

syringe pump model is built in freecad

Alt text

Designed to use a Nema 17 stepper motor with an A4988 microstepping driver

Python code communicates with an arduino via USB serial using the PyFirmata package. Arduino controls the stepper driver with digital outputs.

Arduino should have StandardFirmata code uploaded (from the arduino IDE: File > Examples > Firmata > StandardFirmata)

Arduino wiring and microstepping logic follow the conventions described here: https://howtomechatronics.com/tutorials/arduino/how-to-control-stepper-motor-with-a4988-driver-and-arduino/

For remote operation

Pyro4 is used for remote communication

Usage:

On raspberry pi, both a Pyro4 nameserver and the stepper_server must be running

To run nameserver

$ conda activate syringe_pump
$ python -m Pyro4.naming -n <IP OF PI>

To run stepper_server:

$ conda activate syringe_pump
$ python stepper_server.py

On remote computer:

$ conda activate syringe_pump

Then, at a python prompt:

>> import Pyro4
>> s = Pyro4.Proxy("PYRONAME:stepper.server")
>> s.calibrate('1ml') #or '5ml'

To test remote connection:

>> s._pyroBind() # should return True
>> s.toggle_builtin_led() # should toggle the builtin arduino LED

To dispense 10 uL:

>> s.dispense(10)

To retract 100 uL

>> s.retract(100)

Pyro also allows connections through html. On raspberry pi:

$ python -m Pyro4.utils.httpgateway -H <IP OF PI> -e stepper.server

From a browser:

to deliver a 10 ul reward:

http://<IP OF PI>:8080/pyro/stepper.server/deliver_reward?volume=10

to check the step count:

http://<IP OF PI>:8080/pyro/stepper.server/step_count

syringe_pump's People

Contributors

dougollerenshaw avatar

Watchers

James Cloos avatar  avatar

syringe_pump's Issues

mc1,2,3 with ArduinoMega

also, i used
self.arduino = ArduinoMega(port)
at line 46, since i apparently bought ArduinoMega (and of course imported ArduinoMega from pyfirmata).
are the mc1, mc2,and mc3 values in the config likely to be different?

self.delay for arduino mode

hi Doug! finally got around to setting this up in the lab.
mostly working in one afternoon. motor isn't stepping but maybe the controller is bad or my power supply the motor is bad.
one bug, line 62 of stepper.py
self.delay = 0.00025 # delay between ttl pulses when stepping
should move one indent up, so that it can be used in both arduino and rpi mode.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.