ammolytics / projects

Source code and instructions for do-it-yourself projects.
https://blog.ammolytics.com
MIT License
47 stars 20 forks source link

Add powder-drop support #21

Open erichiggins opened 5 years ago

erichiggins commented 5 years ago

Some folks have suggested adding support for an automatic powder drop, controlled by a servo. Anyone who has experience with this can chime in here with suggestions.

Since it's an optional feature, it should be treated as such in the software (controller and Mobile).

Passaita commented 4 years ago

While I can't help with the code I think code can be universal and hardware (servo) optional with the following algorithm. When scale is stabilized at zero or above and regular trickler cycle starts system could send on GPIO 17 or 27 PWM servo signal from 0 to 90 to 0 (someone help here. I don't have powder dispenser and not sure what is the lever move in degrees). Then continue to execute trickler code. Things to consider:

erichiggins commented 4 years ago

I believe @MrMr-No did something similar by calling some Python code they wrote. Perhaps they can chime in here to share their code so that it can be added to the project?

MrMr-No commented 4 years ago

steper.py.txt case (tickDelta > 1499 && this.scale.weight === 0 ) :

    console.log('*******Steper Python code******')
    console.log(`Current speed ${tickDelta} `)
   let {PythonShell} = require('python-shell')

PythonShell.run('/home/pi/projects/trickler/peripheral/lib/steper.py', null, function(err) { if (err) throw err console.log('finished stepper') })

MrMr-No commented 4 years ago

I modified tricckler.js file to execute steper.py script (attached above) when you need more then 30 grains of powder in same directory as trickler.js

MrMr-No commented 4 years ago

PiStepper03 Here u have how to connect stepmotor drv 8825 to pi

erichiggins commented 4 years ago

@MrMr-No This is excellent, thank you!

MrMr-No commented 4 years ago

in action https://rapidgator.net/file/f219cb8233dc6f66fba69269c4b7b101/IMG_0077.MOV.html

erichiggins commented 4 years ago

Embedding the Python code shared above to avoid the extra download:

from time import sleep
import RPi.GPIO as GPIO

DIR = 20   # Direction GPIO Pin
STEP = 21  # Step GPIO Pin
CW = 1     # Clockwise Rotation
CCW = 0    # Counterclockwise Rotation
SPR = 220   # Steps per Revolution (360 / 7.5) 96

GPIO.setmode(GPIO.BCM)
GPIO.setup(DIR, GPIO.OUT)
GPIO.setup(STEP, GPIO.OUT)
GPIO.output(DIR, CW)

step_count = SPR
delay = .0208 / 4

for x in range(step_count):
    GPIO.output(STEP, GPIO.HIGH)
    sleep(delay)
    GPIO.output(STEP, GPIO.LOW)
    sleep(delay)

sleep(.5)
GPIO.output(DIR, CCW)
for x in range(step_count):
    GPIO.output(STEP, GPIO.HIGH)
    sleep(delay)
    GPIO.output(STEP, GPIO.LOW)
    sleep(delay)

GPIO.cleanup()
TQBCPC commented 3 years ago

I modified tricckler.js file to execute steper.py script (attached above) when you need more then 30 grains of powder in same directory as trickler.js

Can you please share your modified trickler.js file?

boki1397 commented 3 years ago

@MrMr-No Hello, your video is impressive! and your drawing is very good. which stepmotor did you use? it is possible to make the complete modified image available here? unfortunately i have no idea about the programming or software operation in raspberry. it would certainly be of great help to many like me. many thanks for your effort.

MrMr-No commented 3 years ago

Tnx! Unfortunately, Isn’t so simple. I can post image, but I have designed completely new Hornady’s powders rotor to working with bipolar step motor like You can see on video. Perhaps is better solution to waiting on @ erichiggins new project to rewrite code to Python to see what we can do.

boki1397 commented 3 years ago

@MrMr-No Thank you for your prompt reply. i watched the video several times and i saw the 3d parts. i have a 3d printer and i think i can copy it. if you think it would be better to wait for the python programming, then i will be patient. thank you for making your knowledge and work available to the general public. I also like to help others. unfortunately that's not my area of ​​expertise.