Sunday, August 11, 2013

New PC Controller

March 2013

After deciding to ditch the Rutex hardware for Mesa, I did a lot of reading and research and asked a bunch of questions on the LinuxCNC Forums. Ultimately I bought a Mesa 5i20 PCI FPGA card, two 7i29 DC Brushed servo drives, a 7i37TA optoisolated I/O card and a couple of 50-pin ribbon cables to connect the works.

I had also previously been using a free Dell Dimension desktop sitting on a chemical drum to push signals to the Lagun, but it was more test rig than a long-term solution.

I had hoped to find an enclosed, fanless solution but it seemed that almost everything with a case had either no PCI slot or not enough room to fit a full height PCI card inside. After weighing my options and not liking any off-the-shelf solutions, I decided to piece together a system around a mini-ITX main board.

I took a risk since there was no data on the LinuxCNC wiki about this particular board, and bought a WTM-D28 main board powered by an Intel Atom 1.8 and 2g of ram. Internet is handled with a Mini-PCIE wifi card. Onboard video, USB, ethernet and audio, and easy power interfacing with a barrel plug.

I also bought a 120Vac 160 Watt power supply, because I was concerned that once rectified, the low voltage output from my servo power supply would be too high for the mainboard to handle.

The DTM mobo also has a DC-DC converter on board to supply +5V and +12V for the hard drive, although its a 4-pin Molex and the wrong orientation (male). I remedied this by clipping part off a power split wye I had lying around and since I had a SATA drive I intended on using, coupled the Molex-SATA adapter to the former wye and plugged it into the mainboard and hard disk.

About this time I also got myself a display enclosure with a keyboard and trackball from ebay, and mounted it to the top of the mill. For now there's a Dell LCD I pulled the stand off sitting in the enclosure and no shield to protect it from flying chips.DSCF3149

It's starting to look like a real machine!




Testing and installing LinuxCNC on the WTM mobo before my power supply showed up DSCF3150

Monday, May 13, 2013

Rutex drives, and why I don't use them anymore.

November 2012-March 2013

Since the Lagun mill didn't have any drives when I brought it home, I originally thought I'd be using Geckodrives to power my mill project, because a lot of other people have had success using them. They're cheap, effective, well supported and have a lot of dedicated followers on CNCZone and elsewhere. I had been using ebay to scope out my options as far as servo drives go and stumbled across a set of 3 Rutex 2010 drives really cheap ($60/ea) and that upset my initial plans, because I thought I could save some money and time in getting my mill from its unfinished state to making chips. Unfortunately it didn't work out, and I have written up some praise and criticism of the Rutex R2010's for the sake of anyone who is considering them. When I was searching out the pros and cons of using them there was not any such information out there for me to use and I hope that by sharing what I've found that I'll save someone else some hassle.

On paper, the Rutex drives are great - for a comparable price the R2010s handle more voltage than the Geckos, offer software based tuning that doesn't require an oscilloscope, and offer a modular main board and differential line drivers that interconnect simply.

Before I completely tear into Rutex for their products, I will give them a few praises for things they did right. On their software, the whole auto-reverse to tune works great, and now that I'm tuning with HALScope on LinuxCNC, I have a better appreciation for how good it does work.

I also like that the R2XTuneVB6 software had up/down buttons on the variables for P, I, D, etc and that the changes to variables was "live" and didn't require a keystroke or mouse-click to download the changes to the drive.

That said, I'll bullet a few points that I think Rutex needs to address in order to make their drives a viable option for the DIY CNC crowd:

- Ditch the SPI protocol. Rutex uses SPI to tune, and as far as I can tell its as buggy as can be. The R2XTuneVB6 software apparently can't properly calculate overshoot if there's a serial interruption or error, so instead of displaying a correct overshoot number it automatically jumps to a number over 32000.

- The R2XTuneVB6 software can't really deal with communication outages, and this wouldn't be so frustrating if it didn't reset all the variable values to zero when that happens.

I tried to brainstorm a number of things that could be causing the problem (for whatever reason it was worst on my Z-axis) and tried the following to make the tuning communication problem go away:
Swap differential line drivers
swap cat5 cables
swap encoders
swap PC's
swap motors
check grounds on PC, power supply, mainboard
change shielded cable on motor
change cat5 cable with another brand
swap a custom made tune cable for an R2110 mainboard

Needless to say none of these things worked, and I had to endure nonstop resets and infuriating loss of variables in order to even get close to a tuned axis.

- Fix your broken documentation. One of my motors had a CUI capacitive encoder on it, and after trying for many hours to figure out why it wouldn't play nice with the drive I called and talked to Rutex USA, who told me that CUI capacitive encoders have known problems with their drives. Yet the rutextest.doc document I downloaded from their website mere days before the phone call showed an identical encoder mounted on a Keling motor. Their tech docs and phone support have conflicting information spread across several documents. Additionally their documents are in several formats (!) and there is not a single document that shows how their "system" is supposed to work or integrate.

As of writing there's no explanation on the website or support documentation as to what the difference is between the different polarized and non-polarized motherboards that Rutex USA sells.

I also ran into problems early on getting bidirectional communication to work at all, and it was a bios setting problem but none of the suggestions in the R2000setup document fixed it. I suspect this may be a difference inherent to Dell bios but as many people are repurposing Dell machines as CNC controllers its probably worth mentioning.

- Sell breakout & interconnection hardware, don't force people to hunt thru digikey and ebay to get things like DB-25 and DB-15 cables and IDC connectors.

- Sell breakout boards, or put screw-type headers on your main boards for limit switch and estop connections. I don't believe that very many CNC retrofit projects work without changing things up from their original "plan" and screw terminals make changing plans much easier than re-soldering a DB style connector.

- Get rid of the cat5 encoder interconnects. Originally I though that this was a great idea and so much simpler than stringing wires, until I realized that TCP/IP comm over cat5 is designed around resilience to packet loss and signal degradation, and an RS-422 line driver has no such safeties against lost signals. Additionally most cat5 cable isn't designed to be flexible and without additional punchdown tools and extra ends, isn't easily run thru a strain relief to keep from damaging the drives or line drivers.

In conclusion, I eventually did what I should've in the first place and dumped the Rutex drives, main board, breakout hardware, encoder line drivers and cables on ebay to someone else with more patience than I have. I then called Mesa and did what I should have done in the first place - bought a 5i20 FPGA card, 2x 7i29 H-bridge drives, 2 interconnection flat cables, mounting hardware and a 7i37TA interface daughterboard.

Tuesday, April 2, 2013

A short tirade about cables and smart design

So I won't, and haven't attempted to disguise that I went into this whole CNC-retrofit business not knowing what the hell I was doing.

But I can't help but feel like there's a number of things that some manufacturers are doing to make things *harder* for people who are trying to make stuff, and make stuff work with other stuff. And one of those stupid things, that I think ought to be ridiculed until it is changed, is how attached so many hardware makers are to a DB-25 connector on their output/breakout board.

This could have been averted with some better planning - my original plan was to use a UIRobot breakout board with geckodrives, then my plan changed when I found some Rutex drives dirt cheap, and I've since scrapped that whole step/direction drive business for reasons I'll discuss in a future entry. Had I made a straight path from no-drives to a completed setup, I would have only needed one connection cable and maybe avoided some frustration.

But back to my original point, why the DB-25? I'm not sure that a printer sold in this country since I was born has actually had a DB-25 connector on the printer side. Everything, and I mean EVERYTHING printer/scanner/all in one on the PC side has a Centronics connector on the printer side, at least until USB peripherals started replacing everything that was previously connected via PS/2, parallel or serial ports.

Complicating this further, is that there doesn't seem to be some sort of standard as to whether the breakout board should have a male or female plug on it, so upgrading or changing breakout boards could mean changing cables as well. I wouldn't harp on this so much, had I not backburnered my own project for 4 days by not paying enough attention to that little detail.

So, hardware manufacturers, take this as my plea to do something that makes some sense.

I know it might complicate things from a wiring diagram standpoint, but I don't think its too much to ask to give the end user a simple chart documenting which pins on the PC side translate to which output pins on the breakout board. As an end-user, I don't really care how the signal gets from point A to point B, just that it gets there intact and that I've properly configured my software to mesh with it.

Monday, March 25, 2013

Power Supply Pt. 5: Putting it in a cabinet, then another

October 2012 - Feb 2013

After assembling my power supply into the nema box that came with the mill, I realized just how short on space I was for the second set of caps I wanted to run for my 12-24 volt supply. I found a bigger nema box with a disconnect on the outside for $50 from a local surplus shop, and started swapping everything over. I bent up some fence hardware from Ace to hold the caps flat against the backplane and used some of my additional free space to glue a fan to circulate air around the rectifiers.




For the time being I still have a temporary (un-conduited) set of wires running from where power comes in the back of the mill and have set the new power box on top of the original box with a cable running to a pin header in the original box.


Monday, February 18, 2013

Power Supply Pt. 4: Putting it all together

September-October 2012:

Since dewinding the transformer took me a bit to get finished, all my other components had shown up and I found a huge heatsink to mount everything on. So I started moving things around on the backplane and figuring out how I wanted to lay things out:


In case you are wondering, the black box is an inrush current limiter. I'm told it uses a resistor to slowly bring the transformer core up to saturation and prevent downstream voltage spikes. Another ebay find for $20 + SH, and cheap insurance if it does what it is advertised to.

I mounted the rectifiers to the heatsink using self-tapping screws which walked and that was (in retrospect) a mistake without doing some proper layout and pre-drilling first.


Ugly though it may be, it will still work so I moved on to soldering connectors onto the secondaries of the transformer:


Since I knew that I was going to try and make this look pretty, I took the old nema box off and had it blasted and powder coated, while it was off I used a judicious amount of carb cleaner to get all the oxidized coolant and metal chips off the side of the mill:


Powdercoater did the outside of the nema box but not the inside (facepalm!):


I guess its ok, nobody will see much of it once electronics are mounted anyways right? Grumble grumble…

Now at least I can mount the backplane to the inside of the box, when I discover that my capacitors are too tall to mount up straight out the backplane without touching the inside of the lid and shorting out. So for now they get to stand up inside the cabinet:


With the filter caps disconnected from the rectifiers and my new OTC portable scope hooked to the rectifier output, I can see the peaks and valleys where the AC voltage is rectified into DC:


With filter caps connected and no load, I have slightly lower voltage than I anticipated but very smooth power:


I didn't take any photos, but did hook up a mechanically disconnected servo just to hear it take off and spin at speed. And it was good to hear!

Power Supply Pt. 3: Assembly!

September 2012:

Ok so after going on an ebay buying spree my transformer and glass tape arrived and I had some ideas about dewinding the transformer to get my required ~57 VAC. The more complex and time consuming idea was to dewind and re-space the secondaries, but after consulting a couple of friends who are or are becoming EE's I decided to just remove enough turns to get my desired voltage.

I was excited to get things torn apart and didn't take my first picture until I already started removing the original glass tape and a few windings:



It should go without saying I did so with the power OFF but after removing a few turns I would hook power and my DMM up so that I could monitor change in voltage. During this time I removed no more of the original glass tape or insulator than absolutely necessary. Once I had gotten between 57 and 58 volts AC I cut my secondary output wires short, sanded the ends clean,, and promptly discovered as I was all ready to start re-insulating my transformer that my roll of 3M 27 Glass tape was too wide to fit through the center of my toroid. Crap!


So, noting how large the cardboard center of the glass tape roll was, I used a small impact driver to wrap the tape around a small bolt instead. Success! (forgive the mess)


Now I was able to start re-wrapping, careful to keep the loose wires tight and the coils tight as well. I started from where the original tape was still tight and wound near the most complex part (where the most wires meet up near the primary entrance) first, then moved towards the other side of the disturbed sections of transformer:



I then re-soldered on my secondary stranded wires and heatshrinked them, before re-wrapping the connections with insulator and glass taping over that too:


Completed Transformer:


Power Supply Pt. 2: Buying stuff!

August-2012 to near-present day and beyond…

In my last posting I reviewed some of the math involved to get our power supply components. 1500VA @ 58 VDC for the transformer, at least 26,666 uF for the capacitor bank, and 6 bridge rectifiers capable of handling the output from the transformer.

I can't stress enough that if you want to just go out and buy these things, there are a few different manufacturers making questionable grades of products, and few if any descent, objective and comparative reviews. I may write an article in the future on confirmation bias and compulsive forum posters, but it should go without saying that there are very few people who aren't in this professionally that will buy more than one version of essentially the same piece of hardware and the hardware to test it in order to review it for free for a limited audience. I am no different and just as cheap.

I originally decided I wanted to wind my own, and after deciding that was too much work, I settled on the idea of buying an Antek AN-15458, a 1500 VA @ 58 VAC toroid, with two 12v additional secondaries and split primaries allowing the use of 120 or 240V input voltage. That plan went away when I found a new Antek AN-15468 on eBay for less than half the cost of a new one, and bought it and some glass tape with the intentions of dewinding it until I got my intended voltage.

DSCF1147 About this same time I looked all over eBay to find some decently priced DC capacitors that would make a sufficient cap bank for my CNC. After poring over what must have been thousands of listings trying to find the best deal, I stumbled upon a set of 6 NOS, 200V, 56000 (!) uF electrolytic caps with mounting brackets for $5.75 each plus shipping, on an auction that showed them listed incorrectly as 5600 uF, and made a Buy-It-Now offer of $4.50 ea, and took the whole lot home for only $27 + SH! By comparison caps of similar size and voltage were looking to cost me in the range of $40-70 + SH/ea!

With the extra change rattling around my pockets I got a little cocky and bought a lot of a dozen 50A 600V bridge rectifiers for under $30. I figured it would be good to have a couple extras on the shelf if I needed them. I don't have a ton of semiconductor experience but my considerations for purchase required them to be US or Japanese made with a metal casing for better thermal conduction to a heatsink. I'm not sure what the rate of failure is (and don't care to find out myself), but beware that eBay is absolutely flooded with cheap rectifiers, it was easiest for me to identify them by the rough castings of the metal cases and sorting the location to only show items in North America. There are still American sellers of the poorly made imports but sorting by location reduced their numbers greatly.

Next up, a power supply build!

Sunday, February 17, 2013

Power Supply Pt. 1: Planning stages

This planning/reading/thinking about buying stage took place between April and August 2012 So I'll start this entry by saying that this mill didn't have a power supply or any servo drives when I brought it home. I'll assume that most of you reading this who get a mill with intentions of retrofittting it won't have to go thru this sort of headache since you'll already have most of the power supply and drive components.

There are some excellent bits of info out there most notably a power supply basics paper on The long and short of it is that you need a significant amount of power to sling around a several hundred pound table + a heavy work holding fixture + a potentially heavy part in 2-3 axis + a spindle depth axis and (eventually) I hope to add a rotary axis too. For the sake of future expansion and the expensive heartbreak that comes from watching undersized components fail to perform or let the smoke out, I decided I want a good amount of overkill in the size of my power supply.

Many CNC machines use an "unregulated" power supply which basically means that its output can fluctuate based on the load placed on its output or the voltage fed to its input. For the size demanded of our power supply in voltage and kVA, a regulated supply would cost at least $500 and probably more, without much additional benefit since the drives I expect to use are capable of running over a wide range of voltages.

*if* and this is a big IF, I had a lot of money to throw at this machine I would probably have invested in a turn-key solution to these problems from a company like Kollmorgen, who can set you up with a power supply, drivers and motors all at once and reputation that it will all work once installed. I hope that by posting some of my concerns and how I came to a workable solution that this can be of help to other people chasing the same problems.

The first concern is going to be voltage. Since I originally planned on using Gecko servo drives I check their spec sheet and see that they top out at 80VDC with some (but not much) gimme space around that voltage. I'm told that the original servos on the Lagun operate near the same voltage so I want to use the maximum possible voltage to get the best reaction time and torque out of my servo motors, without exceeding the maximum of either the servo or drive.

Since I am going with a transformer-fed supply, my first concern is stepping down from a ~220VAC mains voltage down to 80VDC, but since there is going to be a transition from AC to DC, the desired AC voltage needs to be less than the DC voltage desired by a factor of 1.4, I.E. AC volts * 1.4 = DC volts because of how AC voltage is measured versus what we need for rectified DC volts. So if we need 80 VDC then we need to divide 80 by 1.4 to get approximately 57 volts.

Next question is going to be how big it needs to be, expressed in VA or kVA (kilo-Volt-Ampere), in a DC circuit for our example its basically the same as wattage (volts * amps). For this I read a few different papers about sizing power supplies and a lot of build logs but ultimately decided that I needed a 1500 VA or 1.5 kVA transformer to deliver the power that I expected to need and leave some room for expansion in the future.

Determining necessary VA seems harder than it needs to be because so many items are rated in "maximum capacity" and building a power supply large enough to handle the max capacity of 5 axis worth of Gecko G320 drives would be ludicrously expensive - it would have to be capable of delivering 100 Amps DC, requiring a mains input of ~40 Amps @ 220VAC for just the motion, never mind the spindle, coolant pump, lights, brake, logic step-down transformer or any other powered accessories. Nevermind the fact that such a transformer that can deliver 100% duty cycle would be as big or bigger than a decently sized welder, it would also cost a lot of money to buy, ship and consume a lot of power once plugged in!

Fortunately its unlikely that we'll be running all 5 (planning for the future) axis at full draw at the same time - the maximum draw will come from a rapid change in direction at speed and it would be unwise and unlikely to be accelerating all axis at maximum speed with maximum load at the exact same time.

With a linear unregulated supply like we're going to build around a toroidal transformer, we can briefly overload the transformer for a few seconds with no ill effects (from Antek's data sheet "In most of the cases, this transformer can be output 20% more power from its rating at 60Hz power source without any problem." In addition to this, when a servo decelerates it feeds some energy back into the capacitor bank that can be re-used, provided it doesn't decelerate so rapidly that it back feeds more power than the drives or capacitor bank can handle.

While you can calculate out the necessary wattage needs for your mill, and the power supply and servo vs. stepper papers on Gecko's site show you how to calculate that, I considered the calculation I drew from that as well as looking at a number of other similarly sized mill build logs on CNCzone and what was available at reasonable prices thru a few online distributors, Antek being a very popular and well recommended one. I decided that I wanted to buy an Antek AN-15458, rated 1500 VA @ 58 volts.

Next I needed to worry about rectifying all that current from AC into DC, and had been advised by a number of people that I should double up bridge rectifiers for redundancy and power handling on my servo voltage supply, so I knew I was going to need 4 for the 2x58V secondaries, plus two more for each of the 12 volt secondaries.

Last I was going to need some capacitors, and we calculate the minimum value by the formula (80,000 * I) / V = C, where I is amps, V is voltage and C is capacitance in uF. (80,000*25)/75 = ~26,666 uF, but more capacitance on your filter isn't necessarily a bad thing (within reason of course).

I should also mention that you should probably have some sort of plan to mount all this stuff, cords to get power to it, a switch to turn it on and off and a box to put it in too. Until next time…