Reloading Counter Rev 4 - now with PLC

Status
Not open for further replies.

alfsauve

Member
Joined
Jan 30, 2008
Messages
1,514
Location
N. GA
I've wanted for some time to explore the world of Programmable Logic Controllers, microprocessors on a board. I've have a background in everything from mainframes (Univac VS & IBM 360) to PC/MACs and everything in-between. With languages from Assembler at the OS level to SQL, Algol, Pacal. Even throw in a lot of Cobol, ForTran, and RPG in there. My reloading counter project just seemed like an ideal one to jump in with PLCs.

/* This post is in two parts. The first a summary of the project, the counter and how it works, and the second part is the gory details of the h/w and s/w. Read what you want. I know there are those readers who have never missed priming a case, whose press never jams, who never have to stop and deal with dented case mouths or split cases, and who never been interrupted by phone calls, children or a puppy peeing on their shoe. BUT, for the rest of us please don't waste our time telling us so. Just move on to the next post. Quite frankly I'm only interested in confirmation bias and hearing/seeing what others have done along this line. */

THE COUNTER:

If you've seen my hardware (h/w) version you know that by putting a couple of switches on my press, I can signal when I've done a priming motion, count the number of times and warn when the primer tray is locked back (primers out).

https://www.thehighroad.org/index.php?threads/primer-counter-rev-3.874949/

But there was more I wanted to accomplish and doing it in h/w would have been a pain. Maybe in 1970 using TTL chips sure I'd have tackled it. But we're in 2021 and small processor boards complete with memory and i/o are the rage.

There are two boards commonly used by hobbyist these days, Raspberry Pi and Arduino. The Arduino caught my attention and that's what I based my project on. The basic Uno board is available for under $20 and the even smaller Nano for around $5. Still using the same three switches on my press from the h/w version I came up with a plan. Here's what I wanted the s/w to do. ( * new features)

1) Detect when a full press prime action is accomplished
a) Turn on a visual indicator
b)* Sound an audible alarm (single beep)
c)* Provide a double beep every 10 primers
d) Increment an internal counter
e) Prevent further counting until reset
2) Detect when the press is near the top of it's stroke
a) Reset the "primed" light
b) Allow counting to be incremented on the next cycle
c)* Sound an alarm if the "primed" light was not first lit.
3)* Detect when the primer counter is >97 and begin flashing a visual indicator
4) Detect when the primer tray is locked back indicating out of primers
a) Change the flashing visual indicator from flashing to solid
b) Prevent further incrementation of the counter
5) System reset switch to reset counter and start program over again

For the time being I'm doing away with an actual counter display. I may add that later.

Here's what the Uno board and my breadboard for testing looked like.



20201228_103947.jpg

I made a custom interface board and put it all in an enclosure.


20201230_071622.jpg

And here are up close pictures of the warning LEDs and the 3 switches used on the press. I had wanted to use model railroad block signals, but not sure I can adapt the tall ones, so I used the smaller "dwarf" signals. They're glued on the press at an odd angle so they shine directly at me when I'm reloading.

20201230_071738.jpg


20201230_071644.jpg


THUS ENDS THE BASIC SUMMARY

No sooner than I got this assembled and working and the end user, me, requested revisions and updates from the systems programmer, still me. Plus, I discovered all sorts of things about Arduinos including the smaller Nano, the shield, or piggyback-like a daughter board with the connectors. This project will never end.

First I built a custom interface board. Here it is hooked up but without the final LEDs or the enclosure. Problem is when I need to update the S/W I have to unplug those 8 header cables and that was a pain.

20201213_114202.jpg

Then I discovered the shield board w/ connectors, so If the Arudino board can be unplugged easily. And that's how it is installed at the moment. Of course the resistors had to be soldered in-line and the beeper is just rattling around in the enclosure.

20201225_142834Small.jpg

Wait, there's the Nano. Oh so cute. Here's the Nano on the breadboard.
20201228_104937.jpg

I've currently built a small circuit board with headers for the Nano. Now it does mean that all the connections are soldered in, but it's a much smaller package and the Nano unplugs so easily for updates. At $5ea I've got 3 of them to play with. I'll add a final picture when I get it mounted in the enclosure. That frees up my UNO board and the shield connectors for the lab bench and other projects.

Software-wise, the C++ style language was easy to learn. The compiler assumes you'll have at a minimum 2 functions, "startup" which will run once and "loop" which will loop ad-nauseum. I had intended to do this as an interrupt driven project anyway so this was ideal. Read the switches, check all the conditions, repeat forever.

This is all open source stuff and is headed up out of Italy. Some manual and references suffer a little in translation but it's been fun. I'm working on using actual Interrupt Service Routines and utilizing an optical position encoder for a future version of this.
 
Last edited:
Cool. I’ve considered getting an Arduino to play with. I did a lot of lab automation programming back in the day using the C language, so doing something to automate a reloading process might be right up my alley. Will be following this thread.
 
Re-did it with the cute little Nano board. Of course my feed through grommet is too small to run the USB cable. (I could have if I'd have thought of it BEFORE I soldered in all the wires. This will only stay this way for a month or two while I work on an external display for the counter. Then we'll have a new enclosure. Also getting a larger breadboard so I have room for the screw terminals and the resistors. But this is so much handier for updates. Just unplug and swap the Nano board for one with updated software. The Nano does the I2C communication pins, so we'll have to see which numerical display I want to use. I've ordered both a plain, numbers only that uses to digital output pins and I've ordered the fancier 14segment display (full alphabet) that requires the I2C pins. Reports on reloading with the new setup next weekend.


20210102_145256.jpg
 
A good way to learn, because it combines several aspects you are interested in.

I like to do similar projects!
 
Just for you nerds, like me.

Upgrade the interface board to a longer one to allow for wire terminals. I'm done, for now. I need to evaluate the buzzer. It's a little weak. And I may add a digital counter display. Modules are on order to play with.

First I made a new interface board for the Nano.

CW20210115_075250small.jpg

I've allowed for connections to a possible counter display and for an extra/option/external buzzer. With this setup, all I have to do is unplug the USB cable from the Nano, which is like a daughter board to the main PCB. Then I unplug the Nano and can take it to my office for any software upgrades. Simple

I got a new enclosure.

CW20210114_120434small.jpg

You can see me marking it off by using another printed circuit board. Then the box drilled out. I decided that for strain relief I'd just go with a pop-in plastic ring. This isn't going to get moved around a lot so strain relief isn't a big issue. I also cut away all the tie wraps and used a nylon cloth sheath to make the wire look professional.

CW20210114_123005small.jpg

I carefully painted the box (Hornday red, of course) and heat cured it (140f for an hour).

CW20210115_075241small.jpg


A picture of everything installed in the box.

CW20210115_082216small.jpg

Finally a picture of the whole setup with the LEDs in the reset mode.

CW20210115_082330small.jpg


I've loaded 500 rounds with this setup and latest s/w. It worked really great and has provided me with the warning of missing primer that I've been wanting for some time. I'm at the bottom of my bucket of brass and some of this brass is in bad shape or has severely crimped primer pockets, so I get distracted sometimes. My counter/warning system has worked like a champ.


[I lied, one more picture.]

This is the PCB layout. I use VISO for drawings like this. (I was using Visio when it first came on the market before Microsoft bought it.) Once I had the basic elements designed, layouts are pretty simple to do.

PrimerCounterReloadingArduinoAdvanced.jpg


ps More 9mm brass on order from Brass Exchange. I'm shooting semi-auto for the winter so I seem to be going through a lot of it.
 
I get the tinkering part…believe me, but one thing I could never get wrapped around my mind is the wanting to know how many rounds are loaded. I shoot shotgun (skeet and 5-Stand) more than anything else. When the shells get low I start loading until I run out of components, be it powder, primers, wads or shot, then repeat the process as needed…same thing with metallic; matter of fact all my loads drop into a 50cal ammo can or bucket (shot shells), only thing that gets put into ammo boxes are the 6.5 and 30 cal rounds. It’s awesome what you put together, but something I don’t understand…round counting.
 
I get the tinkering part…believe me, but one thing I could never get wrapped around my mind is the wanting to know how many rounds are loaded.

I did a countdown on mine, so I would know how how many were left before I had to top it back off. I also did total because it was easy once I was done with the other programming in the PLC and had the display room left but I agree it’s pretty easy to count how many empty primer boxes are in the trash.



If I am roll sizing or sizing/trimming I can’t use the empty primer box math though so I do use counters, either a simple mechanical one.

CCD88F28-F2C1-4349-9177-8F11FBCD76B6.jpeg

Or an old step counter that I wired into and use a magnet and reed switch to trigger.

A7F205F3-D9D5-4523-9CD2-1DF776E0FF61.jpeg


This is another one that’s expanded from just counting using a rasberry pi.

http://castboolits.gunloads.com/sho...the-Press-Monitoring-Computer-for-Rasberry-Pi
 
Last edited:
Looking good JM. Read the thread over at castboolits. You guys are so way ahead of me.

I was looking at optical position encoder for detecting ram position and laser trip wire for missing bullets and such. The optical AI looks very interesting. All this may more trouble than it was worth for a simple LnLAP press without bullet or case feeder and for someone who only does ~1,000 a month.
 
Like you, if I didn’t enjoy building “a better mouse trap”, I wouldn’t mess with any of it. When built that first automated progressive, there was nothing like it one could buy even idiot wanted to.
 
Delays due construction and new puppies. Finally mounted the counter. At first I was going to put it in a model BillBoard from a model railroad. Just couldn't find the right one and size. Then I saw the light. A target on a target stand. Haven't dressed the wires just yet.

Voila

20210427_061448Cropped.jpg
 
Since you first started this thread, I picked up an Arduino Uno complete kit. I’m already thinking of ways to hook it up to my Dillon 550.
 
Especially for us old programmers, playing around with Arduino is fun. Like the good old days of programming in Assembler with no OpSys to get in the way.

So far I've done the obligatory clock program with and without GPS. Want to build it into a Stargate model. I've done a DMX lighting interface controller program, but have no use for it being retired from lighting. I've ordered a BlueTooth+WiFi Nano (33 IoT) and will play around with that for a while. Both NNTP and in net reporting. I had always wanted to build a real Internet Toaster and give it to Vint Cerf. Maybe I'll finally get around to it.
 
No sooner than I got this assembled and working and the end user, me, requested revisions and updates from the systems programmer, still me.
:rofl:
We all know the more end users you have the more fun it becomes.
Good idea to limit it to 1;)
 
Surely you could have found some use for Bluetooth on that LNL???
Interesting read, although I must say I’m retired after 37 years in the business, I bought the LNL control panel that has a counter built in.
I could look for my copy of Stroustrup and PIF if you’d like?
 
Really like your display! Just picked up my first Arduino UNO kit and a shell counter for my single stage press was the first project. It works and I like it, but so many more possibilities...
 
And I thought I'd be the only one around here that knew what a Raspberry PI and Arduino was :)

Nice work ! I tend to want to walk away from IT and technology after my workday is done. If it is also a hobby good for you.

-Jeff
 
And I thought I'd be the only one around here that knew what a Raspberry PI and Arduino was :)

Nice work ! I tend to want to walk away from IT and technology after my workday is done. If it is also a hobby good for you.

-Jeff
After I had been the the electronics field for several years, I slowly moved away from doing much electronics hobby work. The Arduino has gotten me interested in doing projects again.
 
Status
Not open for further replies.
Back
Top