I coiled both flipper solenoids last night. Making this machine has been really eye-opening. First and foremost, I have to decide to either let the machine coil the wire the way it wants to and take my damn, dirty hands off it or I should make it more interactive with a way to pause and restart. My problem is I want a beautiful coil with wires stacked perfectly and it’s just not happening. Still, I’m way further than I ever was with my old machine. Here are some pictures from last night. As you can see, the main problem is at the ends of the spool.
Nit-picking issues aside, I’m really happy with the way these came out. And shy of doing it painstakingly by hand it’s the best I think I can manage.
My next step is to finalize how the flippers rotate, how to control where they should stop and start, and then get the new solenoid mount worked out and installed. I sense a new project in the near future: learning to make springs on the lathe!
I made two new spools last night, setup/etc from start to finish took about an hour. As I make more I’m sure that time will come down. Just making the second one was much faster than the first. I am not super fast on zeroing my tools though. And well I probably shouldn’t be since I’m no professional. I take my time and try to get it all right the first time.
So here’s a picture of the new flipper spools I hope to coil tonight. I got a new shipment of black delrin rods 1.375 and 1.5 inches in diameter. These are 2.25″ long, 1.25″ diameter at the flanges. Center hole is 0.376″, the flanges are 0.100″ thick, and the spool walls are 0.112″. The tool in the picture is a reamer, .376″ diameter. I drill the center holes out with a 23/64″ bit, then use the reamer to open up the last 17 thousandths of an inch. It’s more accurate that way.
Working with the digital readout on the lathe has been real interesting. The Y axis (diameter) is set to the full size you are working with, not half of the diameter as I would have thought.
Last night I did some final tests and then connected my spool of magnet wire up and started a trial run of 10 turns. Everything went smooth, so I bumped the turns up to 890 and let ‘er rip. About 100 turns in, the carriage stopped moving 😦
After several more 100-turn tests, probing with the multimeter, and serial-debug from the Arduino, I determined that the DRV8825 was the culprit. I replaced it with a spare and was able to finish the last 200 turns without any trouble. Unfortunately, the winding wasn’t as pretty as I had hoped. That being said, it’s still better than the coils I made by hand on my old winding machine.
I also noticed that while I was moving the carriage exactly the diameter of the wire for every turn, sometimes the wire didn’t lie down that way, so I bumped the ratio down (from 60:1 to 55:1 coil-steps:carriage-steps) and that looked smoother.
The limit switches worked great, and you don’t have to be exact with them, which is nice. The wire seems to find its own way at the end of the spool.
Also, clamping the beginning of the wire between the spool and the neoprene washer was a great idea, it held that wire perfectly.
In the code, I used the name Coilatron 9000 for the machine, which is sticking so far.
Watch the video of my solenoid winding machine before it got all jacked up.
I started out thinking I’d have to make a new driver board, then thought I’d try to hack the broken one and fix it. So I filed off a few copper traces and soldered in a hack to make it behave. The results speak for themselves. The motors are up and running! I had to reverse the directions in my code because they rotated the other way, but that was simple.
Once I had the motors (and the code running them) tested and working, I revisited by 5-8mm coupler. I don’t know what I was thinking back then but I made the 5mm side too big, and the winding mechanism had an eccentric wobble because of it. So I made a new one on the lathe. Then I put it all together and found out my spool of magnet wire was dragging on the base plate, adding a whole bunch of friction that I don’t want the motor to attempt to overcome. So I modified the CAD for the magnet wire holder to be taller, and added a locking plate underneath so I don’t have to glue it down. We’ll see how well that works. It still seems a bit loose.
I was really hoping to make a new solenoid tonight, but my progress today was stellar and I’m happy.
Oh yeah, side note. I had to re-drill and tap the set screw holes on the coupler. Some well-intentioned but slightly retarded person put a 3mm drill bit in with the 3mm tap set (we have 2, 2.5, 3, 4, 5mm taps with the corresponding drills together for easy use). Since the 3mm screws have a 0.5mm pitch you’re supposed to only drill a 2.5mm hole, then use the 3mm tap to get it to the right size. So shame on me for not checking first, but that’s why the sets are separate..
Carriage limit switch test
More progress, more setbacks to report. First, I realized when I booted up my laptop that I never saved the Arduino code that I wrote the other day. That was dumb. Fortunately it wasn’t much, so I rewrote it. Then I did an optimization pass through my code and changed things that ended up cutting my memory footprint down by 10%. Most of that was F()-wrapping static strings, changing return values to boolean when possible, and using char instead of int when I needed small numbers. (Pro Tip: on the Arduino, boolean and char are the same size!)
As I rewrote the display code, I also added the function that updates the display based on coiling progress, and temporarily hooked it up to the left (home) limit switch to increment the coil number.
I also did more reading up on the DRV8825 driver that I’m using, and traced out where the +5v logic should be connected to the RESET and SLEEP pins and found the point on the board to tap in and hook that up. I also found a ground that wasn’t connected and made a jumper for that, too. More crimping of tiny connector pins, yay!
So after I got it all wired back together, I found it still didn’t energize. Then Marty (who designed the board years ago) dug up the original files for the board and realized that the one he gave me was an early version that didn’t work anyway (the voltage to the Mode0, Mode1, and Mode2 pins was VMOT, 12v in my case, and not VCC, 5v). He’s going to find the newer version of the board and bring one in for me to switch over to. It may have burned out the DRV8825s but I have spares.
Below are pictures of the coiling progress display screen, my crimping “workspace” for the evening, the expanded Arduino connector with the enable pin connected, the driver board after adding VCC connections and ground jumper, and everything hooked up.
Last night I spent a good deal of time fighting to get my code onto the Arduino I installed on my coiling machine, only to find out it’s got a bad bootloader. You see, the Arduino I attached was the same one I used a few weeks back when I was testing an Adafruit stepper controller shield. It caught on fire. Apparently as it did so, it also fried the Arduino (I call it Deaduino now). So I pulled it, and replaced it with the (only) spare I had and things started looking better.
That debugging process took up a lot of my time. But I managed to start talking to the OLED display with the replacement Arduino. Once I had that working, I found that my switches were really random. They were floating as I didn’t use pull-down resistors. So I reversed the logic in the code, because the Arduino has built-in pull-up resistors. Now the switches are reliable.
Then I tried to get the motors working, but it turns out I hadn’t calibrated the voltage yet (fixed that), and I didn’t supply the 5v logic to the board that I need to enable the DRV8825 chips (to be fair, I thought it was all tied to 12v—the board was a freebie and came with no documentation). So I had to do some digging on the DRV8825 motor driver, which took up the rest of my time.
Oh, and since nobody is really reading this right now, there was a BIG announcement today that directly impacts my chosen pinball game theme. Good times are ahead…
I completed the wiring last night, which required a lot of hunting down specs, cutting a slightly larger hole for the OLED connection, and a few other things. I installed the OLED with the M2 screws I received in the mail yesterday (check out Bolt Depot, they’ve been a great source of bulk bolts for me).
I wired the Arduino UNO into the 12v power supply, and soldered some pins onto the custom stepper controller board to use its extra grounds. I simplified the wiring with larger connectors where it made sense.
I started working on the code for this the other day, and am pretty close to complete and ready to do some serious testing. I hope it doesn’t blow up when I plug it in.
I also reversed the bolt/nut direction on the idler pulley. Originally the bolt came up through from the bottom with a washer and nut on top of the pulley. When glued in place, it made it nearly impossible to loosen, so I changed it.
The few things left on my TODO list are to set the reference voltage on the DRV8825 drivers (for my 2A stepper motors, that should be 1.0v according to the documentation I found), and to possibly redo the coil stepper’s coupler (again) so it’s sturdier this time. It’s also possible I’ll have to tweak the stepper control board and change from full step mode to microstepping (it supports up to 1:32 microstepping) to handle moving the carriage the small distances the wire diameters require.
I’d also like to redesign the assemblies to have a locking piece under the base that would hold them in place instead of gluing them down, so I could take it back apart. Ah, hindsight…