PDA

View Full Version : Starting the Press Monitoring Computer for Rasberry Pi



Rcmaveric
10-24-2020, 03:58 PM
These have been around for a while. Seen them go for 450 and up. Most of the automated presses have them.

I saw on YouTube a guy made an analog system. Cool. Back ground on me I am an aviation electrician and fully understand wiring and analog. I have school and some basic experience in 3M (micro miniature maintenance) but never went that route in my feild. I drew up the schematics for it.

Well one day a project for my press called for a Rasberry Pi. Not to get into tech talk but but my laptop couldn't do it. I needed to see two webcams at once. So I can make sure primers are seated correctly and cases are charged.

Well last year I saw a random article pop up on my Google news. An older gentleman made one for less than 200 bucks. It was a makers fair. For once Google spying me paid off. So I thought, if he can do it then I can do it. Down side is I have zero experience in Python programming so this is an adventure of Newby. He never posted his code so I am working from scratch.

Since I all ready had the PI it only cost me 40 bucks in addition supplies to get

This is the flow chart to show what I am trying to achieve started.https://uploads.tapatalk-cdn.com/20201024/2fb15078ccfb82b3775812dee3be3002.jpg

This is how I have it all wired. I dont have the LCD or the Distance sensor yet.
https://uploads.tapatalk-cdn.com/20201024/5259bd7ab681cefe6e3206afa8a90c5d.jpg

This the GUI (graphical user interface) i want to create.
https://uploads.tapatalk-cdn.com/20201024/231b7944462e9d4581cc07d872254d09.jpg


This is the optional LCD I want to make. Incase a GUI isn't wanted or all one needed is a round counter and primer warning.
https://uploads.tapatalk-cdn.com/20201024/3fdc88e08f13849690b5a5cbd691edb4.jpg

Sent from my SM-N970U using Tapatalk

Rcmaveric
10-24-2020, 04:20 PM
Starting today's adventure and starting a Github repository.https://uploads.tapatalk-cdn.com/20201024/5c1ab56d878e4f41fdbcc5320f8ba3d4.jpg

Sent from my SM-N970U using Tapatalk

smithnframe
10-24-2020, 04:24 PM
Seems like a waste of time to me.......I've been handloading/casting for over 50 years. I don't see the need! Just sayin.

Brick85
10-24-2020, 04:28 PM
That seems like a really cool project! I have to imagine you could really crank out some rounds fast. What is the physical machine setup? Could you post some photos? Seems like a good way to keep the lead off your hands, or maybe do just the opposite and cast while the machine is reloading in another room?

Rcmaveric
10-24-2020, 04:31 PM
If we have any programmers here that can critique me or offer guidance. The Github is:
Www.github.com/Rcmaveric/Reloading-Press-Monitor

Lol I dont know what I am doing. I am researching and making this up as I go.

Sent from my SM-N970U using Tapatalk

Rcmaveric
10-24-2020, 04:35 PM
Seems like a waste of time to me.......I've been handloading/casting for over 50 years. I don't see the need! Just sayin.You are right. It isnt needed. But I am about to spend 6 months in the desert and need something to make and keep my sanity.

Nothing is needed that cant be done manually. But I won't be the only one who wants something or some form of simple convenience.

Sent from my SM-N970U using Tapatalk

Rcmaveric
10-24-2020, 04:37 PM
That seems like a really cool project! I have to imagine you could really crank out some rounds fast. What is the physical machine setup? Could you post some photos? Seems like a good way to keep the lead off your hands, or maybe do just the opposite and cast while the machine is reloading in another room?I am not automated. But the thought did cross my mind. If someone went full automation then if a warning is triggered it pauses the automation.

Automation is expensive and these Mark IV look sexy. Lol could you imagine of some dumb redneck open sourced that.

Sent from my SM-N970U using Tapatalk

Rcmaveric
10-24-2020, 04:48 PM
This is just the beginning https://uploads.tapatalk-cdn.com/20201024/8ec6307661ef6fd13b32dac083c3c7d5.jpg

Sent from my SM-N970U using Tapatalk

EMC45
10-24-2020, 04:53 PM
You are right. It isnt needed. But I am about to spend 6 months in the desert and need something to make and keep my sanity.

Nothing is needed that cant be done manually. But I won't be the only one who wants something or some form of simple convenience.

Sent from my SM-N970U using Tapatalk


What's your rate Sailor?

Rcmaveric
10-24-2020, 04:58 PM
AE1. Lol hence the background in electronics. Been O level maintenance the whole time.

Sent from my SM-N970U using Tapatalk

dverna
10-24-2020, 08:15 PM
You stay safe out there in the sand.

Rcmaveric
10-25-2020, 07:53 AM
Got the low primer code working and posted on my github.

Sent from my SM-N970U using Tapatalk

MrWolf
10-25-2020, 08:22 AM
Always been impressed with folks that can do electronics. One area I just don't really get. Probably because never spent time learning it but I think it is cool you are trying. Good luck and be safe over there.

mjwcaster
10-25-2020, 09:01 AM
Sounds like a great project, one that is on my dream list. Especially now that I am playing with a camera for my press.

Someday I want a fully automated ammo factory.
I just got a couple of 4-20 bottom pour pots and will hopefully get around to making a pid out of an arduino I have laying around.
I could use a handful of PIDs, casting, coating oven, smoker etc.
After that I want to play with a PI to compare the two and make a second pid.

As far as need, I don’t need my 550, I could load with a whack a mole if I had to or even buy factory ammo.
Yet I lust after an automated 1050.
Automation and process control has always fascinated me and sometimes the process is more interesting than the end result.
Like others I have been guilty of going shooting just to empty brass so I can reload more.

I will try to follow your project, I know nothing about python and my programming days are from another lifetime. It will be nice to play with code again, frustrating but nice.

Just remember KISS in your design, it is too easy to make things needlessly complex.

My favorite example is a bullet flipper, so many complex designs and JMORRIS comes around and makes a plastic roller coaster loop. Bullet falls down, up a curve then straight down, turning 180 degrees, with no moving parts.

Absolute brilliance in its simplicity.


Sent from my iPhone using Tapatalk

Rcmaveric
10-25-2020, 10:07 AM
Adding two cams to my load master is what started this. Code to see both webcams is posted on my github. Install python 3 and OpenCv and you can use the code(note: you will need two independent USB host(not ports)). If your computer has USB2 and usb3 port then it work fine. I never could find a Linux or windows app that would let me easily see two webcams.

Main difference between PI and arduino is that arduino can actually take analog readings. Pi can't do that easily. Like for my light sensor, it can't actually read the resistance of the sensor like like an arduino could. So enstead you measure the time it takes the capacitor to charge and discharge and a little math and you get a yes or no. An arduino could actually tell you how bright it was.

Thermal couples work by inducing voltage equal to temperature. They don't even get powered. Straight heat generated electricity. Dont forget google. Most things are all ready done just not for our purposes. Just copy paste, tweak and optimize.

The circuit protection will be complex. Right now my pi has none. So if I mess up too bad I will fry the whole board. I need to make a run and get the last of the parts.

Sent from my SM-N970U using Tapatalk

jmorris
10-25-2020, 07:52 PM
I used a automation direct "click" PLC for my controls.


https://www.youtube.com/watch?v=MrFhnDQ-eUU&t=6s

Rcmaveric
10-25-2020, 09:42 PM
I used a automation direct "click" PLC for my controls.


https://www.youtube.com/watch?v=MrFhnDQ-eUU&t=6sThats awesome. I didn't even think about primer counting.

Sent from my SM-N970U using Tapatalk

Rcmaveric
10-26-2020, 09:10 PM
Jmorris, updated my code with the primer counter and credited you for the idea.

Sent from my SM-N970U using Tapatalk

Rcmaveric
11-13-2020, 03:55 PM
I have gotten all sensors but the powder level sensor working. I smoked my distance sensor and it takes about a month shipping... maybe if I find EU source nearby shipping will he faster.

So if anyone wants simple code to control their bullet feeder case feeder or add alarms to their primer feeder. The code is posted. As far as the actually program. I have gotten the camera feeds and buttons working. I have gotten the form buttons working. I figured I would tackle all the easy things before I start adding the complex things where the sensors interface with the app. Lol took me a week to get those buttons working. I have feeling anyone who actually knows how to do this could have gotten it done quicker. At the rate I am going it takes me a week to get one thing working.

Sent from my SM-N970U using Tapatalk

jmorris
11-14-2020, 10:48 AM
I thought of another sensor I didn’t have in the video above as those GSI feeders feed and seat at the same station.

When I use a dropper style feeder every once in awhile a bullet will tip or even fall off moving to the seating station so added a laser sensor switch that is aimed at the very tip of the bullet, breaking the beam. So, no bullet, inverted bullet tipped in any direction and the machine stops.

Not really needed on a manual press but thought i would throw it out there.

Rcmaveric
12-06-2020, 01:40 PM
I got everything but the powder reservoir sensor and bullet there sensor. Waiting on the sonor sensor for the powder level and a LIDAR for the bullet present in cases.

I am not automated. But a powder cop die with a microswitch would sense cases not charged and another alert button can be added for that. Then to stop the automation. They make blue tooth controlled power strips or another relay could be used. A power strip would be better because if a short happens it wouldn't damage the computer. I could incorporate diodes and polly fuses though if a a relay was used to prevent damage to the computer. Raspberry PI is so cheap though so if it's smoked. You only loose 35 bucks. All the sensors and PI cost less than 200 bucks.

Its pretty cool. There a recipe book that can be pre filled. Then you select what you are reloading and it will prefill the form. Then load away. Once your done you hit export and it logs it for you with date time stamp. If you all read have a reloading log you can hit copy. Then go to your electronic log and paste it into the pre-existing log.

As of now. An alert set wil give you visual que and audible. Clicking the button resets the the alert. Using that system is easy to stop and start an automated press. Lol need to automated my Loadmaster now to try this.

I need to add an alarm silencer. So that the buzzer can be turned off while fault is cleared.

As of now my code isn't pretty but it works. After all the code is done I need to write the user manual and then design a curcuit board.

Unfortunately I am deployed so I can design 3D printable sensor mounts. This system could also be used on turret presses.

This was hard because it would take me weeks to figure out simple task. Once I figured out the right question to research the answers were simple.

Now I am curious how hard a raspberry PI Ammo Can Shot Camera would be to make. Any takers on that one lol?

Sent from my SM-N970U using Tapatalk

Rcmaveric
12-06-2020, 01:52 PM
Awe hell I Googled it. Its for a android.... but its a start.

https://stackoverflow.com/questions/40607554/how-to-detect-bullet-holes-on-the-target-using-android-opencv

I need to finnish this project before I start another. Funny no one as made an Open Source Shot Camera yet. A raspberry pi is 35 bucks, battery pack 20ish bucks, camera module 30 ish bucks.

Sent from my SM-N970U using Tapatalk

Rcmaveric
12-06-2020, 01:57 PM
The idea behind the LIDAR is it returns a distance on a focused point. If I can focus that point on the bullet tip. Then if the bullet tip is missing it trips the alert because distance would be out of range. But that would only detect a missing bullet after the fact. If that doesn't work I can try a break beam laser.

I use a Lee bullet feeder though. Wonder if an infrared or some other sensor could be rigged to trip an alarm if there isn't a bullet ready for feeding.

Sent from my SM-N970U using Tapatalk

dverna
12-06-2020, 02:22 PM
Interesting to see what smart people are capable of.

I was looking at adding a simple mechanical counter to the 1050 and then...bingo...why not just count the number of primer tubes I fill. It is not that important if I reload 900, 945 or 990 at a sitting anyway. Yes, I am that dumb!!!

jmorris
12-06-2020, 07:49 PM
I am not automated. But a powder cop die with a microswitch would sense cases not charged and another alert button can be added for that.



My powder check dies are sensitive enough to catch the small difference in internal volume of a stepped 9mm case vs a regular one.


https://www.youtube.com/watch?v=6EU9deSKm48

The laser/photoelectric switches are <$15 a set shipped.
https://www.ebay.com/itm/10-20M-Laser-Sensor-Photoelectric-Switch-Infrared-Visible-light-Sensor-M12-NPN/114212126003?_trkparms=aid%3D1110006%26algo%3DHOME SPLICE.SIM%26ao%3D1%26asc%3D20200520130048%26meid% 3D03cb7b6282224880bc72c4b63d47c29d%26pid%3D100005% 26rk%3D5%26rkt%3D12%26mehot%3Dpf%26sd%3D3021949089 93%26itm%3D114212126003%26pmt%3D1%26noa%3D0%26pg%3 D2047675%26algv%3DSimplAMLv5PairwiseWebWithDarwoV3 BBEV2b%26brand%3DUnbranded&_trksid=p2047675.c100005.m1851

What LIDAR are you using?

Rcmaveric
12-07-2020, 06:28 AM
I am looking at this LIDAR:

https://www.amazon.com/MakerFocus-Single-Point-Ranging-Pixhawk-Compatible/dp/B075V5TZRY/ref=mp_s_a_1_5?dchild=1&keywords=lidar+sensor&qid=1607335430&sr=8-5

I could also make a laser trip wire systems a few different ways for 6 to 16 bucks.

Sent from my SM-N970U using Tapatalk

jmorris
12-07-2020, 08:05 AM
With an accuracy of +/- 6cm and a minimum side length of 3.5cm, I don’t think that one is going to work very well to see if a bullet is in the right case.

Rcmaveric
12-07-2020, 09:33 AM
Owe... your righ. I didnt think of that.

Sent from my SM-N970U using Tapatalk

kayala
12-07-2020, 11:28 AM
Super cool project, Rcmaveric. Cloned your repository just to look and learn.

popper
12-07-2020, 12:34 PM
Use a camera module and AI recognition system, anything out of normal to stop machine. This is normal in automated machines as it catches all errors. If the camera is at the right location and good resolution, divide the frame (like Zoom) and process each section for errors. With shiny stuff, illumination level will change with error (like a fire detector or security system). Easy-peasy software.

Rcmaveric
12-07-2020, 02:52 PM
Super cool project, Rcmaveric. Cloned your repository just to look and learn.Thanks and have at it. I need to push an update. I just fixed the cams not releasing properly but I am tired. I still have problems wrapping my mind around certain concepts in python. Its fun though and addicting. Most often the problem is just figuring out the right question or topic to research. That alone is what takes so long.

Sent from my SM-N970U using Tapatalk

Rcmaveric
12-07-2020, 02:59 PM
Use a camera module and AI recognition system, anything out of normal to stop machine. This is normal in automated machines as it catches all errors. If the camera is at the right location and good resolution, divide the frame (like Zoom) and process each section for errors. With shiny stuff, illumination level will change with error (like a fire detector or security system). Easy-peasy software.I was actually playing with that. When I started I just wanted to find a way to count the bullets as the passed the cam. Thats what OpenCv really ment for. I spent a month though working with it but it was kicking my but. Problem is you have to train it. Thats where I get lost and started having problems following. My python skill is weak doesnt help. I was able to get it to count bullets that entered and left the frame but it was off and highly inaccurate with out being trained. It would count the bullet, a screw a head, a few ghost and my finger.

Sent from my SM-N970U using Tapatalk

jmorris
12-07-2020, 04:59 PM
Use a camera module and AI recognition system, anything out of normal to stop machine. This is normal in automated machines as it catches all errors. If the camera is at the right location and good resolution, divide the frame (like Zoom) and process each section for errors. With shiny stuff, illumination level will change with error (like a fire detector or security system). Easy-peasy software.

Think that would be great for a machine to sort by headstamp. I had a fellow interested in working on the recognition part of the project and I would do the mechanical/electrical from the output but I guess he got busy and I haven’t heard from him in some time now.

I even offered to cover the cost of materials on that end too.

Rcmaveric
12-07-2020, 11:11 PM
Once you train the AI it's creepy and accurate.

Sent from my SM-N970U using Tapatalk

popper
12-07-2020, 11:54 PM
Training is done by looking for edges or bright lines, measure size or distance between. Another trick with fuzzy logic, get several 'data points' from several samples, get average for each and set std dev. for each as limits to compare.

Rcmaveric
12-08-2020, 03:07 AM
Edges and bright lines didn't work well. Blob and edged detect is what I was using. Using a sample picture helped but still imperfect. Once this project is done I will look more into it. From my understanding of what I read for training 300 to 500 pictures should be used.

Sent from my SM-N970U using Tapatalk

jmorris
12-08-2020, 10:43 AM
Edges and bright lines didn't work well. Blob and edged detect is what I was using. Using a sample picture helped but still imperfect. Once this project is done I will look more into it. From my understanding of what I read for training 300 to 500 pictures should be used.



Training is done by looking for edges or bright lines, measure size or distance between. Another trick with fuzzy logic, get several 'data points' from several samples, get average for each and set std dev. for each as limits to compare.



Where would be the best place to learn about the software available and acquire the necessary items?

I would like to learn more about this and the software. As far as acquiring the images, the ability to ignore how a case is clocked and triggering outputs from learned inputs.

I thought something similar to my brass sorter by weight, where a case is pushed onto a load sell, weighed then off, down into that weight range container, by the next case in line.


https://www.youtube.com/watch?v=1V_Hm3oqlO4

Obviously would substitute the load cell for a clear platform with camera underneath.

Lots of folks would want the ability to sort cases by head stamp, the right software and 3D printing could make it affordable.

Rcmaveric
12-08-2020, 11:27 AM
Opencv is what the open source program is called. Easily pip installed nowadays.

https://docs.opencv.org/4.5.0/

There is the documentation.

Problem is most projects involve facial recognition. There are a few car counting and people counting ones. So it gets difficult to extrapolate atleast for me. There are some pretty neat projects though. There are some pre trained AIs that can accurately say someone's job based on uniform. So anything is possible.

Python is the coding language used. Raspberry pi isn't the strongest platform for it. But it can do it.

Sent from my SM-N970U using Tapatalk

Rcmaveric
12-26-2020, 02:43 PM
Still plugging away at it. I am happy with the code. I just need to work out the LCD and Sonar for powder level. Just recently got the LCD and started playing with it. Been waiting on the sonar for 2 weeks.

I also started working on a PCB for it. Convert my rat nest of a bread board into something official looking. I added an extra switch socket and an extra 4 channels of bidirectional 3.3v to 5v logic conversion channels. That allows addition of arduino sensors for future ideas.

Some pics of the fun:
https://uploads.tapatalk-cdn.com/20201226/61ab4cdba3db9e084869a3b9a53e03e2.jpg

Has a 3.3vdc voltage regulator and 5 vdc regulator. 12 VDC input for the bullet and case feeder. Has cuircut protections. Poly fuses for all voltage rails. Diodes to protect sensitive device's (thought about zener diodes but went with regular). Voltage kick back shorts built in for the relays, speaker, and all motors. On/Off switches for everything. Pluss mom switches to manually feed motors. Built in PWMs. It is kind of big at 3.75 inches by 6 inches. But I was worried about heat. Did added a fan plug to keep regulators cool.

Its kind of cool and a fun way to kill a few weeks designing that. Parts and manufacturing is cheap. Its actually cheap untill you get to shipping fees.... that triples the price.


https://uploads.tapatalk-cdn.com/20201226/8e5c4de732b8719464c79ab488b776d9.jpg

Wife didn't see the humor in the joke. I won't point it out. When you see it you will know. Must have been a glitch in the programming... darn squirrelly electrons and pesky 1s and 0s.

Gonna have to design a custom 3D printed in closure.

Sent from my SM-N970U using Tapatalk

Plate plinker
12-27-2020, 12:29 PM
Jmorris in regards to your last post. Would your clear platform be problematic when it becomes dirty? Always enjoy your engineering ideas.

jmorris
01-01-2021, 03:53 PM
Looking good RC!

Plinker, I don’t know. Even if I had to build a windshield wiper/cleaner into the case feed, I don’t think that would be too hard.

I have read lots of different stuff, decided to start here https://coral.ai/projects/teachable-machine/#project-summary as a first step.

tinsnips
01-03-2021, 04:50 PM
You guys are like my late brother he could hook electronics to a cookie any make it work. He was in charge of the electronics for the CA prison system. I take my hat off to you two . The only electronics I deal with are controls in furnaces,boilers,refrigeration easy stuff compared to this stuff.

Rcmaveric
02-06-2021, 07:52 AM
I normally love soldering. But surface mounted devices aren't fun. These capacitors are the size of a pin head. I am not so curtain this going to work lol.

I never noticed my hands shook before. Next time I am going with the green boards and having them solder then surface devices. It took me an hour to get them installed. No polarity markings either.https://uploads.tapatalk-cdn.com/20210206/6d03d66dbcd9be9c5ef17eee2d58228c.jpg

Sent from my SM-N970U using Tapatalk

jmorris
02-06-2021, 09:19 AM
Yep, I’d need a magnifier to mess with any of those these days.

mjwcaster
02-06-2021, 10:09 AM
Yep, I’d need a magnifier to mess with any of those these days.

Jmorris you mean you haven’t built a home grown wave soldering station yet?
I’ve burnt a bunch of solder in the past, but never much at the component level, mostly audio cabling.
I’d need great lighting and magnification before I would attempt this.
And first thing in the morning before coffee, just like if I actually want to shoot good I skip or at least limit my coffee.


Sent from my iPhone using Tapatalk

mjwcaster
02-06-2021, 10:11 AM
And rcmaveric it looks good. If you didn’t need to desolder shorted connections and didn’t melt the board or lift any traces that is a win in my book.


Sent from my iPhone using Tapatalk

perotter
02-11-2021, 09:24 PM
Very interesting project. Thanks for sharing your work.

After I get my new reloading area setup and things settle a bit, I'll have give try this out. Are you going to have board available for sale?

Rcmaveric
02-12-2021, 01:27 AM
I didn't intend to sell. I am putting a board together now to see how it works. This is my first time designing a PCB. I will have 4 extras if it all works out. Still waiting on parts.

Sent from my SM-N970U using Tapatalk

B4408
02-12-2021, 02:15 AM
Awe hell I Googled it. Its for a android.... but its a start.

https://stackoverflow.com/questions/40607554/how-to-detect-bullet-holes-on-the-target-using-android-opencv

I need to finnish this project before I start another. Funny no one as made an Open Source Shot Camera yet. A raspberry pi is 35 bucks, battery pack 20ish bucks, camera module 30 ish bucks.

Sent from my SM-N970U using Tapatalk

Remembered this aussie thread for shot camera. Is this what you are thinking, may give you some ideas.
Love to get into electronics but to many other projects already.
http://https://www.australianhunting.net/index.php?topic=199980.0 (https://www.australianhunting.net/index.php?topic=199980.0")

jmorris
02-12-2021, 10:05 AM
Jmorris you mean you haven’t built a home grown wave soldering station yet?

Nope, I have welded thousands of the board fixtures for them in the past. Still have the fixtures I made but they have either changed operations or hired a welder. The company I was doing all the welding for did all sorts of stuff for Rockwell, Fujitsu, Motorola, Halliburton and Bell Textron. The money was so good, I’d pick up the parts and prints then deliver the finished product myself.