onsdag den 15. august 2018

PNC-3000 Part 9 Electronics

I promised in one of the first posts, that I would get back to the electronics.

The time has come..

Besides an design goof I made, that caused both set of 4503N to be active at the same time, the only thing I have changed from the initial design is to add a jumper that makes it possible to short IO-SELECT and Powerdown, forcing the stepper drivers out of power save, when LinuxCNC is controlling the mill.
I did this because I couldn't find a way to have LinuxCNC control when the drivers should be powered down, this is a bit of a dirty hack, but it gets the job done. There are two drawbacks to this hack, 1. you are wasting power and wearing on the electronics for no reason, and 2. you have an annoying fizzeling noise from the mill. With some input from the LinuxCNC forum I have managed to fix this.

The circuit is as simple as it is ugly..

The pinout in the connector is this:
Pin Function
1 Z-Dir
2 Power Down
3 Y-Dir
4 X-Dir
5 X-Clock
6 AUX1
7 AUX2 (NC)
8 Y-Clock
9 Motor
10 Z-Clock
11 GND
12 IO-Select

Most pins are self explanatory, but a few of them needs special mentioning.
Pin 12 controls whether the mill should run native or being controlled externally, alternatively shorting the IOSELECT jumper, switches control to external. This pin should be connected to "Servo Enable" in your HAL configuration, this way LinuxCNC is controlling the mill, when it's "powered on" (F2) in the Axis GUI.
Pin 2 controls if the stepper drivers should be in power down or not, if the AUTO-PD jumper is closed, activating IOSELECT will also bring the stepper drivers out of power save.

For a more intelligent use of the powerdown function, add the following to your custom.hal file:
setp parport.0.pin-08-out-invert TRUE

loadrt near
addf near.0 servo-thread
setp near.0.in2 0
setp near.0.difference 0.0000001
net velocity motion.current-vel => near.0.in1

loadrt not
addf not.0 servo-thread
net moving not.0.in <= near.0.out

loadrt oneshot
addf oneshot.0 servo-thread
setp oneshot.0.width 1
setp oneshot.0.rising TRUE
setp oneshot.0.falling TRUE
setp oneshot.0.retriggerable TRUE
net moving oneshot.0.in <= near.0.out

loadrt or2
addf or2.0 servo-thread
net moving-inv or2.0.in0 <= not.0.out
net powerdown-2 or2.0.in1 <= oneshot.0.out

net powerdown parport.0.pin-08-out <= or2.0.out

This disables powerdown, when the mill is moving, and the oneshot function keeps the pin active for 1 second, after movement has stopped. for the time being, it's only bench tested, but it seem to work just fine. I found that if I only monitored motion.current-vel the pin would flicker, when the mill was at constant speed.. ?!? If there are stability issues, oneshot.0.width can just be bumped to a higher value.

Pin 6 and 9 are connected to the two jumpers with the same names, and can be used to intercept signals. So if you wanted to control the motor you could cut the connection between IC41 pin 16 and IC39 pin 2 and lead the connection through the jumper.
Pin 7 is a extra possibility for intercepting signals, but it wasn't practical to populate a jumper on the board.

To add touch probe feedback to LinuxCNC, just connect the collector of TR10 to a pin on your parallel port.

The eagle files for the project can be found here: https://github.com/DerSchultze/PNC-3000_Connector

torsdag den 26. juli 2018

PNC-3000 part 8

I wrote earlier that Roland usually doesn't produce junk, this is also still my belief.. But someone had a really bad day in the workshop, the day the table for my mill was line bored.

I had decided that I wanted a vacuum fixture for engraving, so after some manual workshop-time I only needed some cutouts for a O-ring and fixpoints, problem was I couldn't get the fixture clamped down without the dial indicator showed over 0.02mm height difference across 50mm, which is a bit too much for my likening. No amount of cleaning the vice and table could fix this.
Then it stuck me that I had not yet indicated the table, and so I did.. This was a saddening experience..  approx 0.08mm across the 180mm X travel.. this had to be fixed or at least investigated, before anything useful work could be made on the mill.
Removing the table was surprisingly simple, remove the X motor, remove the nut and the thrust bearings for the leadscrew, losen the grubscrews for the rods, move the table all the way to the left, tab out the rods with a brass rods, until there is enough room to slide the table out of the bearings. Be careful not to hit the bearing seals with the rod, it should not be necessary to tab through the bearings, if the table is moved all the way to the left.
With the table off I could mike the rod distance relatively to the table top,  and this matched beautiful with my observations when the table was on the mill, meaning that there is no doubt that the problem is that the table top isn't lined up with the linear rods the table is sliding on, which should be a relatively simple fix.

The difference in height on the worst rod was a chocking 0.19mm!
With the table off I also discovered an adjustment grubscrew for the leadscrew.. Win.. :D

In the garage I learned that though the theory behind fix may be simple, the execution was tricky. After having spent 2 evenings in the garage trying to mount the table without any success, partly because my mill is quite worn, and partly because there is very few places where you can clamp down the table, I decided on another strategy.
My mill has a detachable vertical head, that when removed turns the mill into a horizontal mill. This eliminate the effect of the worn table ways, and gives plenty of options to clamp down the table, relatively speaking, though it was still tricky to line up things.


I choose my 25mm carbide insert mill, instead of a fly cutter this was more work, but easier to control and I didn't had enough travel in my mill to get all the way past both ends of the table. After the first attempt I wasn't really satisfied, the finish was fine, but I still had 0.06mm in difference, and a bit of a popeller shape.

So I gave it another go, and after having buffed it up with 1200 grit and brasso, I was within 0.035mm end to end on the rods. I's possible that another turn measuring and milling would have gotten me closer, but in practice this has no noticeable effect.

When the table was mounted in the mill, the total difference over the full working area was about 0.01mm. This is good enough for me.

In the meanwhile I have also got a new drive belt, which has quiet down things considerable, and almost removed all vibration and resonance.

søndag den 15. juli 2018

PNC-3000 part 7

I revisited my edge finder plans and concluded that I needed something else, at least for now.
Instead of the electro mechanical approach, I decided to use a camera instead.
This was also a fine opportunity to do some actual milling on the mill.. :)


The concept is dead simple, and by no means new, you mount a camera to the mill, measure out the offset, and you're good.
The camera I used was a old Creative NX Pro 2, this happened to be the first camera that worked out of the box with the Linux distro I'm using on my CNC computer, and had a 12mm lens mount, so that I could swap the lens for a 6mm.

It was a bit of a challenge to get the camera aligned along the z-axis, because I put a o-ring in the lens mount, to make it more flexible, this probably isn't needed, so the next iteration of the 3D printed parts will be without the o-ring.
Also focus can be an issue, even though I have chosen a "Pro" webcam, the lens assembly, isn't designed for this kind of use, so if focus is adjusted, the camera will need to be realigned

I decided to just skip version 1 and jump directly onto version 2, and when something is Super, it must also be better. 😁

lørdag den 14. juli 2018

PNC-3000 part 6

My 4jaw chuck is up and running, I had to grind off a few 0.01mm's of the jaws, and it is now running true.
In the meanwhile I had done a lot of speculations on how to make a new collet, problem is  that I need to slit it, but this can't really be done before it is drilled, and when it's cut off, I can't clamp it down to do the slitting. And if I don't cut it off the base stock, I won't be able to test the thread, and when it's cut off, it's difficult to correct the thread, hence my previous post..

I ended up taking a chance with the thread, which worked..

It ended up quite nice, but when I tested it for runout, it had the exact same as the original collet, and it was synchronous with the original collet. I guess this must have something to do with the way the thread is pulling.
I concluded that given the very similar properties of the two collets, attempting to make another one, would just be a waste of time.




The spindle itself has a runout of 0.01mm, which isn't impressive, just ok..

Despite having a ER11 chuck in the mail from China, I decided to make one myself instead, this way I could turn the internal taper, while the chuck was mounted in the spindle assembly all mounted in the Late, which in theory  sohould give me zero runout..


The two triangles I put on the drawing, helped me to indicate the angle of the top slide, to get the two tapers spot on.

In the lathe it all looked like this.

The steel used for the collet is 34CrNiMo6.. No I didn't come up with this particular choice myself, but I have a good friend, who knows something about steel. It's 35-38HRC, and has a bit of tendency to work harden, this gave me some challenges especially when drilling, since I only has HSS-G drillbits at hand, my guess is that HSS-Co would have been better, but the end result was pretty ok.

The taper was turned using a 6mm carbide end mill, and touched up with 600 grid sand paper.

So now the mill takes ER11, but somehow the 0.01mm runout still exists despite that I haven't had the chuck removed from the spindle..

But it's still ~5 times better than the original collet.

søndag den 8. juli 2018

PNC-3000 part 5

Next on the list is tooling.
There is only one collet for the mill, which only accepts things with a 6mm shaft, and it comes with a 0.05mm runout.
It is possible to get an adapter to ER16, but this sticks out quite a lot, taking away some of the 150mm Z travel, and it's also it's a bit pricy. I did order a loose ER11 chuck, so I intend to try out the concept in a DIY fashion, but I't probably won't be the future strategy.
The initial plan was to make something like a weldon style collet, and make a bunch of them, this would make swapping tools relatively easy, but since I don't have a CNC lathe this is a relatively time consuming task, so instead I have tested tool sleves.

Both works relatively well, the runout is obviously better in the bottom one, both sleves is made so that the tool bottoms out. This gives a repeatability of ~0.05mm in length, which is fine for most of what I do.
I'll still need to make a new collet, and this needs to be relatively precise. At least better than the old one that came with the mill, or else the it would be a waste of time to make a new one.. The collet isn't overly complex, but it still has a number of features, I did try to make one in stainless, that turned out really nice, apart from the thread, where I got the major diameter 0.5mm wrong.
I failed epicly in trying to correct the error.


This was the final argument in the process of deciding to get a 4 jaw for my lathe, I managed to find a really nice Burned chuck at a good price relatively close to the property. Only problem was that it was for a Boxford lathe (I think), so I needed a backplate for it. So most of the weekend was spend in the garage, making an adapter plate.


This opens up a whole new world of possibilities, for special tooling and fixtures, remounting stuff in the chuck without runout, and maybe even taking over the world..

It's not all joy though, as I seem to have an issue with the jaws not being perfectly squared to the chuck.

The mill has a toolsetter, but I also need an edge finder, which is a bit of a problem since almost all edge finders comes with a 10mm or 20mm shaft which won't fit in the mill. So I'll attempt to make one myself. The concept is pretty simple, a diode lights up, when the probe makes contact with the stock, or anything else which is grounded to the mill.
The probe end needs to be isolated from the rest of the machine, to facilitate that I have epoxied  a brass tube around a iron shaft.

 Initially I planed to turn down the end of the probe in the mill, to make sure that it would have zero runout, but since the mill has quite a bit of runout, and I'm now in possession of a 4 jaw chuck, it will be finished up there, when I have got the runout under control.

tirsdag den 3. juli 2018

PNC-3000 Part 4

The weekend was used designing and fabricating the PCB for the LinuxCNC interface.

The 4503 buffers to finish off the board wasn't yet in the mail, so it wasn't until Monday that I could do the final assembly and test of the board. It had the pleasant side effect that I also got a chance to enjoy the nice weather. The PCB was milled on my old 3D printer.


When everything was assembled the final result looked like this.


I had to do a bit hardware debugging before things was running smoothly, that's why there is an extra transistor and resistor on the board.. Sometimes things cannot be fixed in software..! :D

I can not take credit for the initial idea of pulling the 8255 chip and intercepting the control signals inside the mill, this was first done by this guy: https://www.youtube.com/watch?v=KTfs9lgCk1w
But he's design deals with SMD, which is a bit of a challenge when milling PCB's, and I thought that designing it myself, it would be a fun little project to activate the dormant brain cells.
When I'm done debugging, I'll post the design somewhere.. probably GitHub.

I had a bit of an issue, with the counter logic build into the mill.

The display has a resolution of 0.01mm, but the mill is specified to have 0.005mm, resolution both specifications is true, the last one being a modified truth. But I noted that when jogging the mill around, or if I ran some gcode, the display would get out of sync with the controller (LinuxCNC). Also the mill had a different sound, when running from LinuxCNC than with the build in controller.

The reason for this might be a bug/flaw in the counter logic, where the counter is incremented on the first pulse of the clock, which is actually ok, since 0.5 should be rounded to 1, but if the direction is changed when the position is at x.xx5mm the counter looses a count, and things gets out of sync.

Roland seem to have circumvented this issue in the firmware, by making sure to pulse the steppers an even count of pulses on every move, this is clearly visible on a osciloscope, where pulses can be seen paired, spaced with a few mS, you never see just one pulse..

This fix limits the resolution to 0.01mm with the build in controller, and explains the difference in sound, between running of LinuxCNC.

The issue is only cosmetic when the mill is controlled from LinuxCNC of Mach3, but never the less annoying..

Tonight I could take the first chips....



fredag den 29. juni 2018

PNC-3000 part 3

The bearings has arrived.. :)



To install them I needed a a couple of different pressing tools.


Once installed vibrations was mostly gone, I still get some resonance at specific RPM's but I hope this will be better when I get a new belt.


So now most of the mechanics is done, and it is starting to look good again.


During cleanup I noticed a tiny bit of backlash in the X-Axis, for a start I won't do anything about it, but I'll probably need a new ball screw later.
 I haven't made any progress with the electronics, apart from ordering a hand full of buffer chips.

onsdag den 27. juni 2018

PNC-3000 Part 2

While waiting for the bearings for the spindle and motor, I might as well start looking at the electronics. The back of the mill looks like this:


It might look a bit complex, but really it isn't.. Looking at the schematics was a trip down memory lane, the design is a classic microprocessor construction with everything you'd expect to find in such a design. RAM, ROM, address decoder addressable IO chips, external serial driver etc.

The plan is to hook into the clock, step, and power down signals for the three axis, which comes from a 82C55 IP chip, so first step was to remove this.

I must admit that it does hurt a bit doing this to vintage electronics like this, but in the end it should end up being a much more versatile mill, while still being almost original.

Preserving the original electronics means that the coordinate display will still be working, but it will only be possible to display the machine coordinates, not your work coordinate system, since there is no way of feeding offsets into the machine.




Since I already had access to the electronics, I figured that I might as well take a backup of the EPROM's, and no backup is complete without also testing if you can restore it again..


I haven't programmed EPROM's for a while.. 😁

mandag den 25. juni 2018

New Toys

For a long time I have considered building a desktop mill, I have a great deal of the parts and materials needed, and tools shouldn't be a problem either, only time, and the right design.

But then during a random search for CNC stuff for sale, an interesting  desktop mill showed up. The Roland CAMM-3/PNC-3000 Computer Aided Modelling Machine.. :) The price was fair, so I phoned up the seller and made a appointment to pick it up.
It was a bit of a gamble, as it was in the other end of the country, but the machine looked relatively ok given it's age, and to the best of my knowledge Roland doesn't produce junk. And compared to sourcing linear rails, bearings, stepper drivers, all of the material and parts I was missing, and using countless hours in the garage, this could hardly be a bad option, almost no matter how banged up the mill was.

So 9 hours of driving later the mill was at the compound.

The mill had seen a great deal of use, and needed a cleaning job, it's from 1987, and designed to mill plastic, wax, soft metals, and other soft stuff. The collet is 6mm only and not fantastic, but it has apparently done the job since the mill was new.

According to the seller the spindle needed an new drive belt, which was a reasonable assumption given the amount of noise and vibration it was able to generate when it was running.

The original plan was to tear the mill completely apart and clean it, but I ended up with a more lightweight solution.

I started with the spindle, the belt vibrated like crazy no matter how tight or loose it was, and when the spindle was turned off, it gave off a strange whistling noise, for some time after. This turned out to be the top bearing, that was spinning freely inside the spindle housing.


The whole spindle assembly can be removed for servicing, when I got it apart, it was filled with aluminium dust, and someone (maybe me) had managed to loose one of the balls from the thrust bearings, I'm pretty sure it wasn't me..
No biggie, I'll just order 3 new bearings, and everything will be fine.. Well.. hmm.. The thrust bearings are 7003C, relatively innocent looking, but is, judging from the price, only available in solid platinum or unobtanium.. Most places I found was asking ~100-150€ a piece, and I ended up paying 80€ for a set of non brand name bearings, but from a German supplier. After all the spindle is only doing ~10K RPM.

After the spindle housing was cleaned up, and a bushing to make up for the lost material around the bearing was fabricated, it looked like this:



While waiting for the bearings, I started on the rest of the machine, it was clear the previous owners hadn't given it much love..




Work in progress:


One of the other problems I noted was the dust covers especially on the z-axis was curling up, so I added a pair of tig welding wires behind them, to keep them in place, this worked really well:


After cleaning It looked like this


I also decided to take the motor apart to check the bearings, which showed up to be a great idea


And one could ask.. why didn't you wait ordering the spindle bearings until you knew, if you might also be needing bearings for the motor..  well.. please don't..

Now I just have to wait for the bearings to arrive, until then I can use some time on getting LinuxCNC to control the mill, since it only understand HPGL, but more on that later.