Member Section > Reloading

Primer Counter - PLC Arduino

(1/5) > >>

alfsauve:
I decided to take the plunge.  Had been wanting to learn about PLCs (programmable logic controllers) for a while.  They're basically very simple uProcessors with built-in memory and I/O.  Raspberry PI is probably one of the well known versions.   I selected Arduino.  It's very simple, well established, open source, and lots of parts and kits are available.  Got my first one (yes first one) on 12/7 and have completed (except for enclosure) my "intelligent" reloading counter.

A 1/3 of my career was spent as a systems analyst and I programmed from machine level on IBM mainframes down to microprocessors in languages from Assembler to COBOL, with things in between like RPG, Pascal, ForTran and SQL in between, so this wasn't hard to figure out.

Four inputs.  A "primed" switch when the primer is fully seated, a "primer reset" switch to undo the 1st switch so you don't have multiple counts.  A "primers out" switch for when the tray is locked back.  And finally a system/counter reset switch.   Initially I was going to utilize my external counter, but decided I didn't really need it.  What I need was for the module to flash the "primer out" light when the counter got to 98.  That warns me I'm almost out.  I also added a buzzer along with the green LED for each time a primer is seated.  This is on a separate output and is pulsed so it's just a short beep.

Below are the Arduino board, a close up of the header interface with the buzzer on board and the two boards hooked up.   Not shown yet, are the two LEDs which are going to be mounted in an model railroad block signal.  Thought that would be cuter than having the LEDs on the enclosure.  I've also include a video link showing me testing it with a breadboard.  No audio as James Earl was busy this week.


https://vimeo.com/489870522/



 

alfsauve:
Just did my first 300 rounds using the new PLC.  everything went smoothly.   The low primer warning worked great.  And I love the audio  affirmation.

BUT,  and this is why software is so much better than hardware solution, I nee-e-e-e-d two "enhancements".   (Dang I'm the end user and the software provider.  Best of times, worst of times.)

When I began this with a hardware solution 10 years ago, the objective was to warn me whenever I forgot to prime a case.   The "primed" light does help a bunch, now with s/w all I have to do at every upstroke reset is ask whether the "primed" light is on.  If not then a little warning, maybe flutter the green LED.

Second, having a  counter helps you mark progress.  I have painted rings on my primer follower at 25, 50 and 75 primers so I can just glance at it to know about how many I've done.   But my attention is on the cases to check for powder and seat bullets.  Without interfacing a readout, I could do a double beep every 10 primers to act as a motivator though. 

First however, ExKev just told me I have to get the TPS reports completed or I'll have to work on Saturday.

alfsauve:
Not finished yet, but here's an update.

After building an interface board, I found the cutest little pre-made board.   It piggybacks on the Arduino using the header pins.  Makes it easy to remove the Arduino and take it to my office for s/w upgrades.

Everything else is working... EXCEPT.  You know that magnetic security switch I was using for the reset switch (picture below).  Turns out it has too much "bounce" in the contacts.  This is a problem because the first contact resets the primed indicator and then the bounce tells the uP that I've on an upstroke without a primer.  Now I can de-bounce it in software, but then I'd always know that switch was a kluge.  So I've ordered a some microswitches and will see about mounting one for the reset function.

Rastus:
You kinda lost me on the "contact" portion is the bounce in the actual contact portion of the switch or internal to it's relay contacts (if it has an internal relay)? 

alfsauve:
When switches make contact it's not always as we picture.  Some switches are less perfect than other sand they create a lot of "noise" as the transition from open to close (and visa-versa).    Below you can see a picture from my o-scope of a snap-action switch.  Pretty perfect wave form, at least for low frequency applications.

But then there's the picture from the magnetic reed switch (security type switch) that I was using for my "reset" function.   This doesn't happen every time, but enough to be annoying.  The magnetic field doesn't reliably interact with the switch and the switch (the reed inside) doesn't know whether to close or not.  This "noise" or "bounce" causes my little uProcessor to do funny things.   In my application it performs a "reset" then it thinks I've lower the ram and raised it again without priming. 

I've done two things.  a)  Ditched the magnetic switch as not really suitable for this app.   I could have done a work around, but why fight it.
b) I've inserted a 100ms delay in reading this switch.  This will insure positive contact for this function regardless of the switch in use. 

CLEAR AS MUD?

More pictures and final description of the project soon.  Just painted the switch mounting plate Hornady red.

Sponsor:

Navigation

[0] Message Index

[#] Next page

Go to full version
Powered by SMFPacks Likes Pro Mod
Powered by SMFPacks Reactions Mod
Powered by SMFPacks Menu Editor Mod
Powered by SMFPacks Ads Manager Mod