SparkFun Forums 

Where electronics enthusiasts find answers.

General project discussion / help
Did you make a robotic coffee pot which implements HTCPCP and decafs unauthorized users? Show it off here!
User avatar
By TrollHammer
#194026
Years ago I picked up a D&M4s mill like this one:
https://www.govdeals.com/?fa=Main.Item& ... cctid=4702
and I'm finally getting around to switching it over to modern electronics.

The current plan:
Gut it and replace with an Arduino/CNC Shield package running GRBL.

So far I have taken the entire thing apart, cleaned up the threads and ways on the Sherline mill, checked the steppers for shorts, and cleaned the thing up. It was in rough shape.

I have decided to keep the spindle motor and speed controller. I'm contemplating whether I should keep the power supply, as it does not seem to have any usable voltage taps. The torroid transformer has two 110v inputs (presumably so you can run it 110 or 220), a 2.3v AC output, a 14.6v tap that doesn't look like it has very heavy wire, and a 46v tap that was originally used to power the steppers.

I dumped all of the electronics aside from the spindle control. I know something went out on the motherboard, probably a cmos clock battery or electrolytic cap, but I lack the desire to muddle around with 30+ year old electronics. I'm keeping the electronics around in case I need to use them for something else or if the steppers are wonky, but the CNC is a clean slate, just a metal box with a Sherline mill in it and some magnetic switches.

The kick in the pants that got me going was finding the CNC shield for so cheap: https://www.amazon.com/Gowoops-Engraver ... 01IGI21D6/ I'm running on nearly a budget of zero funds, zero time, and zero desire to reinvent any wheels, so this seemed like a nice, tidy solution (though I wish I had researched it more. That same page had the board with better drivers and an Uno for a few bucks more)

I have the board mounted, the stepper wiring connectors converted over, the end stops wired up, and have been scratching my head over the lack of documentation for the board and how it's powered. Even the originator of the CNCShield is not clear on a few points that are probably obvious to most who have worked with standard arduinos on a regular basis. I, apparently, am not one of them.

So, the current road blocks I'm running into are:

*On the stepper motor output headers, which pins are which? I'm assuming it's something like
A1
A2
B1
B2
but I want to be sure. 3 days of various searches has not produced a high confidence level that it follows a standard.

*I think I have power figured out a little more this afternoon than I did, but I'm still not positive I understand Arduinos correctly. There are +5v and ground pins on the Uno, and I believe they are regulated input only (and not really all that accessible with the CNC shield on top). There's a coax connector that I have run off of battery packs for a different project a couple of years ago, but I can't remember what the range is, specifically, can it be run at 5v, or does it need to be higher so on-board regulation has wiggle room? How high can it be? My experience with arduino is primarily on a custom board that is no longer in production that was well documented and designed to run at 7.2-12v, and I don't know what they changed between it and the Uno (it connected to the IDE as an Uno, but it was no Uno.)

*I also don't know if the CNC Shield will regulate power for the Uno, or if the Uno powers the shield's 5v circuits.

I figure I will run the shield's power at about 12v initially, or so my original thought was. I'm confused about proper voltages for steppers. The motor itself states 12v and around 1.5a operating (I think), which checks out with a measured resistance running from 8-10 ohms, but the original boards were powered at 46vdc, with no sign of a step-down between power and the driver. I assume it's all PWM limited somehow, but I don't know what parameters are needed or where they go. The new board's input says 12-36v and most steppers seem to be rated well below this, but I don't know what I need to to figure out what to get when and if I finally do replace the original steppers at this time.

Anyway, trying to work on a very low budget, I'm trying to reuse a lot of what I have laying around. I have some nice 24v power supplies, but until I can figure out the motor voltage issue I can't figure on using one of them. I don't think I have a 12v supply better than a 2amp wall wart. I have no idea what I'm going to use for 5v(or whatever I need to feed the Uno) unless I can find a healthy wall wart floating around and be sure of what voltage is needed.

The old control panel was almost completely useless. There is no key for the E-stop button, and it's locked. It was also received loose and spun, twisting wires internally. I have no idea what happened to the LCD display, as there are two and a half holes in the plastic cover with dings in the LCD glass for the two, and a nice rainbow for the half hole. The stall override switch was perhaps serviceable, but had been damaged. I cannot remove the old e-stop without a key or destroying it, and there is an otherwise radical difference in controls, so I ended up making a new panel out of Lexan. As soon as I can be sure what the complete control set will be, I'll lay it out and start installing switches. I need to order a new E-stop button as well. As there isn't anything really holding the doors shut I'm thinking of adding magnetic catches, but I'm also thinking of adding a 'door fault override' switch so I can open the doors without it killing the workpiece if needed.

Other things I'm wondering:

*The spindle control uses a switch closure for inhibit. I'm thinking of using the 'enable' output from the shield to control this, and I'm wondering if there is an 'Arduino output to relay closure' board somewhere. I don't really want to make boards. That used to be fun 20 years ago, but I'll never get it done if I have to design and make a bunch of adapter boards.

*The spindle control uses a potentimeter as a speed control. To be honest, I do not believe I will need to have it digitally controlled, but I am curious if there is an arduino controlled variable resistor (solid state, not like a servo running a pot).

*Where are the settings for the axis? I seem to remember having seen other blocks of code with parameters for steps/revolution, lead-screw turns per inch, length of axis travel, things like that, but following some of the GRBL step by step procedures, I don't see where this information is inputted. I don't see where G code supplies it either.

*The board initially states it is GRBL 0.9 compatible, but I see in the comments it needs modified as there is some discrepancy with pin 11. The modification is not clear, and it is suggested that 0.8 should be used, but as there was a major difference in things like baud rate between the two versions, I'd like clarification as to what I'm actually looking at.

Anyway, I'd appreciate any input if anyone has any ideas or experience with this type of CNC retrofit (which I have faced the fact it's just a Sherline manual mill being run by steppers on a Uno/Shield in a metal box, so it's basically the same as just building from scratch vs a retrofit). I'll keep plodding along and post progress when there is progress to post.
User avatar
By DanV
#194050
The stepper motor voltage rating is irrelevant. I have worked with systems that use Oriental Motor steppers rated at around 5 VDC but the power supply is 48 VDC. Current limiting is performed by the driver chip (A4988 or DRV8825). Higher voltage just provides the ability to 'punch' the motor harder to overcome the motor winding inductance.

I lieu of finding a manual, you could glean some information from Pololu's site (driver chips and steppers) and / or protoneer's site (that also sells a CNC shield). Lots of instructions on those sites. They will have NO info on your particular shield.

As far as a variable resistor, I would think the PWM output would suffice for spindle control.
User avatar
By TrollHammer
#194062
Thank you for the reply and the insight to the stepper voltage situation. I had a post started on the laptop, ordering parts from my phone at the moment.

I was able to find that the motor controller requires a 0-9v analog input for speed control if the pot is not used. As the Uno is 5v output for pwm, do you think this might work, or would the possible distortion mess it up? https://www.amazon.com/gp/aw/d/B01FDD3FYQ/ (its a 5-12v 200x gain audio amp).


As to progress today, I was able to look up more info and find a combination of power supplies to try,including an 8v for the Uno, and a 13v for the steppers for now. I verified my cnc shield had the proper 50v capacitors, so I should be able to run the 24v supply later when I feel more comfortable with the machine running. I have most of the wiring done in the back panel, with a pigtail routed for the A axis when I get it going. I have most of the control panel laid out and am just trying to select a layout that gets everything I need up there. Wires are routed. I still need to figure out about the GRBL/board version matchup.
By lyndon
#194072
You got quite a deal there!

If you head over to the Home Shop Machinist BBS you may find someone who has the same machine and maybe they've retrofitted it with new electronics. Otherwise, there's always CNCZone...
User avatar
By TrollHammer
#194133
I will head over there presently @lyndon. Thank you.

I found a off the self level shift module that was pretty cheap, but when I looked at where it needed to hook in I'd lose my 4th axis (planning on doing some rotary milling and see if I can run an extruder for 3d printing (not at the same time, of course), both need a full 4th stepper output). Since I have to manually change tools anyway, I'll just set cutting speed when I change tools. I'll shelve it under upgrades later (besides, I haven't gotten familiar with gcode enough to know if there's a spindle speed setting in GRBL.

I'm having some trouble with downloading GRBL 0.8, in that all my browsers open a page with what I'm assuming is the text version of the hex file. I'm not seeing how to get source for 0.8. I was hoping to get push through all this without having to tinker (want to spend my tinker time on the projects requiring the mill).

Got the E stop button apart finally. It required a key to unlock an actuation, and I either didn't get the key or lost it in the last decade it's been bouncing around. I have omitted the key entirely but the whole button is held together by the tumbler. I was able to find a key blank at the hardware store, got some funny looks when I said I'd grind it myself, and will have an E stop button by the end of the day. Due the novelty of having a key blank as the key I'm tempted to just grind the tumbler to match the blank. Sad thing Im realizing is the key cost half as much as a new button...

Anyway, logging my progress... Went to get some velcro to mount the power supplies and fix the zip tie pads that are popping off... the double back tape would have cost $5 and the velcro another $12. Hot glue gun was $3 and a 60" roll of glue was another $3, so I went that route. Started wiring the control panel, mounted the USB cable (both using lexan as it's what I have laying around), and I believe the last part I will need is a TTL relay board. 4th axis can wait for now, I don't have a rotary table made yet anyway. Probably one of my first CNC projects I'll try.

Its great working with stuff like this now. Enough time has passed with Arduino (and other boards) that there is a large amount of boards generated by the community. Kinda wish I was 10 years younger and had my old creativity, but there is a lot less head/wall beating now.
User avatar
By DanV
#194136
Sadly, I am pretty sure GRBL doesn't support a 4th axis and all the boards I've seen allow you to clone a motor off of one of the first three so if you need 2 motors to drive an axis (like X or Y) you can have a driver to do that since paralleling motors is not doable.
That is not to say that you couldn't build some setup that took an output from your 1st GRBL system and send it to another stepper controller to do something like take a 1 degree step or whatever. It just wouldn't be driven by values in your G-Code.
User avatar
By TrollHammer
#194163
Hmm... looks like that's a problem. One of the main purposes I was going to use the machine for was lightsaber hilts, having a combination of XY faces and axial rotation. I"m running through machining processes in my head and wondering if I could somehow set the Y axis to align to center, turn off the mill, plug the axial rotation into the Y axis (unplugging the Y axis in the process), and turn the machine back on, let it re-home with the Y immobile... but this still makes it difficult to do the inverse, such as putting a hex face on the tube, as it would require cycling the power up to 12 times to index the part and mill a face 6 times, plugging and unplugging the Y and A axis in... Hmmm...

For faces I could use a manual indexer, but Id also want to have some scroll work, such as helices and other complex shapes. These lay out like a flat plane wrapped around a cylinder, but mixing these with faces presents challenges in planning if I'm limited to 3 axis by software.