PDA

View Full Version : CONVERSION: Replacing elderly Anilam 1100 control system on vertical mill



Neale
05-08-2020, 06:03 PM
Had a call from a friend earlier - "my CNC mill ain't working!" It's a Bridgeport-style vertical mill, built by Ajax, and by the looks of it, a decent machine in decent, little used, condition. Which is more than can be said for the control system - it's built-in PC still has a floppy disk drive and the whole lot is probably 25 years old. The current fault on it might be as simple as a dirty connector somewhere, or it might be something on a control board which would probably be uneconomic to replace.

We started kicking around ideas for a refresh of the machine. I believe that it uses DC brushed motors, no plate on them, and I have no idea what's on the back of them. Encoder, tacho feedback, or whatever. I'm trying to get some idea of what to use for the control system and motor sizing so that I can give him a rough budget and estimate of work involved. I have considered leaving the motors and their drivers in place (I believe 10V analogue) but not having any idea what the servo feedback is on these machines and given the reduced choice of control options for analogue, I'm not entirely happy with that. I haven't had the covers off the motor mounts (apparently belt-drive to the feedscrews) to look at mounting arrangements, etc, to get an idea of ease of replacement but that might be easier than grafting a new motion controller on to the existing drive electronics (assuming that that's not where the fault is!)

I'm happy to give him a few options for the control electronics (UC300+PC, dedicated Chinese controller (SZGH?) are likely options) but not sure about motor sizing for a machine like this, at least to be able to consider ease of replacement and costs. Any back-of-the-envelope guesses? I'm currently thinking something like 1.5KW/6Nm absolute servos with matching drivers (absolute as this machine has a mechanical limit switch and I'm not sure how repeatable homing would be). Table size is about 36x12" and the Z axis drives the quill rather than the table.

Spindle motor drives the spindle via a variable-speed gearbox so the control system only needs motor on/off control, not speed. He's happy to stick with that.

Any thoughts or suggestions?

JAZZCNC
05-08-2020, 10:48 PM
The Big Mill I've got had the same controller and probably similar type motors and drives. Thou i think the Bridge port size machines used slightly smaller motors.?
The motors will most likely be badged up Analim but they are actually made by SEM and I'd guess around 3.5Nm -4.5Nm (30-40 IN-LBS) 4000rpm Max voltage 120-140V and will running at 100-120Vdc. Often they will have a voltage rating of around 36v per 1000rpm so 110Vdc will give 3100rpm.
They could have Resolvers or Encoders with Tacho but most likely Encoders but they will be 5 wire single end encoders and around 1000ppr.

The drives will be the same Badged Analim but the will most likely be made by Glentek. They will most likely be 200A drives if the larger motors or 160A if the smaller ones.

The simplest and cheapest solution would be to re-use the DC motor but replace the Resolvers/Tacho with differential encoders and then use DC drives with Step + Dir.
CNC drive makes 160VDC 35A drives with Step & Dir inputs which will work nicely with UC300. They also have tuning software for the drives.
If the motors have Single-ended Encoders fitted you can also get a differential line driver from CNCdrive so can use with there DC drives which only accept differential signals.

Or maybe go with the ET10 from PV Automation and run it on MYCNC and keep it fully closed loop with original drives etc. Though I think you'll buy the drives and UC300 cheaper than the ET10 and does a machine like this really need Fully closed-loop and all the tuning hassles that can come with it and old Analog drives.?

However, If it was me I'd be fitting Chinese 1.2Kw AC Servos with incremental encoders which will be more than enough for this machine and using something like ET6 or ET7 depending on I/O needs.
I wouldn't go with a UC300 with AC servos as it's limited to 100Khz so you'll need to electronically gear it in the drive to get the speed you'll require and that means you are wasting the resolution of the encoders which is what gives you the smoothness and accuracy. The UC400 would be a slightly better choice but still, you'll need some electronic gearing to get full rpm out of the motors because quadrature 2500ppr encoders will require 500Khz for full rated 3000rpm of typical AC servo.

Neale
06-08-2020, 05:56 PM
Thanks, Dean. That's thrown a few good ideas into the melting pot, and because my mind tends to think "steppers" I had forgotten the pulse rate issue with encoders. There's a few broad decisions to make, like what do we keep/replace, and whether he wants a self-contained control system or PC-driven motion controller. I've only had a quick look at the machine so I need to do a bit more investigation before making too many decisions. I've no idea at the moment how easy it will be to swap motors (mounting arrangements) or change to modern encoders, for instance. We'll see!

Muzzer
08-08-2020, 03:24 PM
When you say "modern encoders", nothing's changed in the meantime. You just need to know if your encoders are single-ended or differential output and which of those your drives require, using a converter if necessary. My SEM motors from the early 80s had Heidenhain encoders with differential outputs that wired directly into the cncdrive DG4S-16035 drives - quick and easy, no messing.

The main difference between DC drives today and 20 odd years ago is that now they use microcontrollers rather than analogue circuits. So you can throw away the tachogenerator and simply use an encoder. Conversely, an actual resolver would be a PITA that you'd want to replace with an encoder. Resolvers give some measure of absolute position, whereas encoders only tell you how many clicks the motor has moved. Again, my SEM motors had tachos but I simply left them in place, as removing them would have involved additional ballache for no obvious benefit.

Neale
08-08-2020, 09:37 PM
Thanks again for the comments. My problem is that I understand the theory of the control systems and the various bits that go to make it up, but I have no experience with the actual hardware, even to the level of knowing how interchangeable things like encoders are. Is there some kind of mechanical standard (like NEMA motor casings?) or would this mean adapter plates, spindle couplers, or whatever? This might sound trivial to those who have done this kind of thing but it's a bit of a barrier to entry for someone like me!

I could leave the servo motors in place, but almost certainly have to replace the encoders. Single-ended, differential - yes, I can cope with that, especially if there are off-the-shelf converters available.

I could leave the existing servo drivers in place (yes, Dean - I'm pretty sure from the part numbers that these are rebadged Glentek) but then need an analogue motion controller, I believe. As an alternative, are there modern DC brushed motor servo drivers that would take step/dir input? That widens the motion controller choice.

At the motion controller level, I could use either a self-contained system, complete with display, etc (like the SZGH or Newker or whatever), or a PC with motion controller (PV ET7? Probably not CSMIO-IP/S or A because that means Mach3/4 or the CS Labs equivalent, none of which seem especially desirable), or halfway house with, say, ET7 plus dedicated single-board Linux and display. Are there other likely candidates that I should look at?

It's really the driver stage onwards that gives me the most uncertainty purely due to lack of experience in replacing driver/encoder/motor "stuff". I've been a stepper and EM806 kind of guy to date...

My mate has been doing some research of his own but given the fact that he understands even less than I do, we're going to have an interesting conversation soon!

Muzzer
08-08-2020, 09:51 PM
I've got 3 of those cncdrive drives Dean mentioned on my larger machine, If you have a brushed motor with an encoder, these will work and they take a step/dir input. I'm driving mine with a Centroid Acorn but an SZGH would dohttps://www.cncdrive.com/DG4S_16035.html

They are based in Hungary, so no tax or duties on the way in to the UK.

Neale
08-08-2020, 09:59 PM
Thanks - given that there is already a suitable DC power supply, that looks like the right kind of thing.

Muzzer
08-08-2020, 10:07 PM
You probably need about 120-140Vdc, so a 100Vac transformer is about right. I used a site transformer (240-120V) and removed some of the secondary winding. You might hope the existing PSU would be OK but is it single phase?

Neale
08-08-2020, 10:09 PM
Yup, as far as I know the whole machine runs off single-phase (although I need to double-check). The machine was running until recently in its present location, so I have assumed that adequate power is available.

Muzzer
09-08-2020, 10:41 AM
The biggest load is likely to be the spindle which can use a VFD run from single phase. The servos etc don't take much power to begin with. Ideal if it's already single phase but no big deal to change over if it isn't.

Neale
22-08-2020, 04:06 PM
Had another look at the machine.

Spindle motor is driven by Mitsubishi VFD but not using variable speed as there is a continuously-variable pulley drive (plus back gear) on the mill. Still thinking about whether it's worth using electronic speed control as there's no tool changer so setting speed manually at the same time as manual tool change isn't a big deal. No big issue either way - it's only another cable.

Servo motors are badged Anilam (well, one of them has a barely-legible label). Brushed dc. Label has spec for tacho output but don't know if there is a resolver or encoder. I've seen an article about updating a similar system which used an encoder but I've no idea how standardised these systems are.

Need to update controller anyway but servo options are new dc drives (CNCdrive?) assuming that there are encoders fitted, costing around £300, or new ac servos plus drivers for around £750. Needs adaptor plate or similar to fit machine but all new technology, low technical risk, and if it all comes from SZGH, it's more-or-less pre-configured from the factory complete with cables.

To date, SZGH have been very quick with supplying manuals and quotation. Can't see from first look at manual if you can use limit switches as home switches but I can ask them. Only one upper limit and one lower limit switch input so all axes share these, which is why I'm not sure about home switches - there might be some other inputs for these but still decoding Chinglish for those...

It's not my machine or my money that's being spent although I would tend to favour the all-new setup. If it were my machine, I would probably spend a bit more time on investigation but this machine belongs to someone who wants to use it, not turn it into a project!

JAZZCNC
22-08-2020, 07:36 PM
Servo motors are badged Anilam (well, one of them has a barely-legible label). Brushed dc. Label has spec for tacho output but don't know if there is a resolver or encoder. I've seen an article about updating a similar system which used an encoder but I've no idea how standardised these systems are.

The Anilim Motors I have used 10000ppr encoders with Tacho but single-ended. They connect to the rotor with a 1/4" shaft which screws into the end of the rotor, the encoder then clamps to the shaft fastened with a grub screw, they sit on little slotted spring steel upstands which fasten to the motor plate and allow it to be adjusted.
I've replaced the encoders with differential 2500ppr quadrature encoders but these came with 6mm hole so removed the pin and turned them down on lathe. Simple and easy upgrade.




To date, SZGH have been very quick with supplying manuals and quotation. Can't see from first look at manual if you can use limit switches as home switches but I can ask them. Only one upper limit and one lower limit switch input so all axes share these, which is why I'm not sure about home switches - there might be some other inputs for these but still decoding Chinglish for those...

No I believe you can only wire Limits in series which go to L+ and L-, the home switches go to the X0, Y0, Z0 inputs.

Neale
24-08-2020, 07:03 PM
My friend has ordered a pallet-load of kit from SZGH. He has organised someone to make up adaptor plates for the new AC servos, to replace the SEM motors. It's a few hundred quid more than using the SZGH 1000mdb controller with new DC drives and existing motors but it should be simpler to put together - probably not the route I would have taken if it were my own machine but he wants to be up and running with minimum fuss and I don't want another project. I have my own mill to convert one day...

I've been through the SZGH manuals and while they are not exactly perfect English, to date they seem pretty good. You aren't going to learn how to build a CNC machine from scratch with them but if you know what you are doing it seems ok.

We'll have to sort out details like adding home switches, incoming mains switching, stuff like that, but nothing too complicated, I hope.

JAZZCNC
24-08-2020, 09:13 PM
My friend has ordered a pallet-load of kit from SZGH. He has organised someone to make up adaptor plates for the new AC servos, to replace the SEM motors. It's a few hundred quid more than using the SZGH 1000mdb controller with new DC drives and existing motors but it should be simpler to put together - probably not the route I would have taken if it were my own machine but he wants to be up and running with minimum fuss and I don't want another project. I have my own mill to convert one day...

I've been through the SZGH manuals and while they are not exactly perfect English, to date they seem pretty good. You aren't going to learn how to build a CNC machine from scratch with them but if you know what you are doing it seems ok.

We'll have to sort out details like adding home switches, incoming mains switching, stuff like that, but nothing too complicated, I hope.

Well so far I'm very satisfied with SZGH and the manual isn't that bad after you have read it a few times. It also makes more sense when you have the controller in front of you.
Prep him that while the controller is set up to some degree by SZGH he will still have to play with some settings and he will 99% need to tune the servos to the drives when on the machine. This cannot be done off the machine.

Neale
24-08-2020, 09:43 PM
Thanks, Dean - I was expecting to do that. As long as the default tuning parameters are near enough, I expect that I can muddle through that process. I do have a reasonable idea what P and I parameters do in a control system so as long as we don't make big changes and keep testing, we'll get there. This project is a bit simpler than yours anyway as we don't have tool changers or spindle servo drives to cope with.

I expect that fitting and wiring home switches shouldn't be a major exercise, but the existing machine has single limit switches on each axis with operating ramps (it uses roller-operated microswitches) at each end. I need to check if the controller is going to be happy with connecting the string of limit switches to both + and - inputs - might confuse it to get simultaneous max and min limit inputs. I'm going to be reading manuals for the next few weeks, I guess.

Muzzer - thanks also for your comments which have given useful background info. If I were doing this for myself I might well have looked into reusing the existing motors with those CNCdrive drivers, at least after checking that the motors did have encoders fitted. Given that there is already a suitable DC power supply in there, this might not have been a major exercise. However, the machine is in someone else's workshop 10 miles away so keeping it simple is key here.

We might end up with a pile of bits for eBay to sell as spares, so there is a chance to recoup some of the money spent.

Neale
29-09-2020, 10:31 AM
The kit from SZGH has arrived and I have set it all up, spread thinly across the floor, and it all seems to work as expected. Can run gcode, motors turn, etc. All seems quite well put together, cables well-labeled, and the only gotcha when first switched on was that the polarity of the estop signal from the MPG was wrong - you had to hit the estop button to make the machine work! Soon fixed, and I think I even have the "steps per" settings cracked for the 5TPI ballscrews (no, not quite 5mm!) and 2:1 reduction. Now waiting for someone else to get the mechanicals sorted (new control box to be mounted, etc) and servos installed. They need a mounting plate and probably existing pulleys rebored to suit but that bit's not my job!

In the meantime, I contacted SZGH about servo tuning software and I was sent - very promptly - the appropriate code. Installs and runs OK, I think - but it's all in Chinese and there's no English version, according to Mike-the-engineer. Any thoughts?

Duha
09-11-2020, 11:29 PM
I have just finished somethink almost identical. Replacing old Anilam Crusader with the same controls. New motors new drivers and the SZGH 1000CNC MDb controler.

Neale
09-11-2020, 11:40 PM
Do you have it up and running? We are still waiting for the guy making the motor mounting plates before we start assembling everything in its new control cabinet (the old one, modified a bit). By coincidence, I had a video-conference with the owner of this machine this afternoon, running through things like how to load gcode, checking that we were using a suitable post-processor in Fusion 360, how to set work coordinates, things like that. He is not that familiar with using CNC yet as he had not really been able to run the machine with the old Anilam controller as he never found a PP that generated valid gcode for it - there were always some odd gcode lines that it did not like - so he was reassured that we could take output from F360 and actually get it to turn the servos! Not a lot more we can do until the electronics is fitted in the cabinet and the motors are in place.

I'm still wondering about servo tuning as I only have this Chinese language version. Occasionally just running the servos on the bench they trip out with a "position exceeded" error but this seems likely to be because they are unloaded at the moment and the tuning is probably wrong. Have you been able (or needed) to do any servo tuning?

Duha
10-11-2020, 12:19 PM
Do you have it up and running? We are still waiting for the guy making the motor mounting plates before we start assembling everything in its new control cabinet (the old one, modified a bit). By coincidence, I had a video-conference with the owner of this machine this afternoon, running through things like how to load gcode, checking that we were using a suitable post-processor in Fusion 360, how to set work coordinates, things like that. He is not that familiar with using CNC yet as he had not really been able to run the machine with the old Anilam controller as he never found a PP that generated valid gcode for it - there were always some odd gcode lines that it did not like - so he was reassured that we could take output from F360 and actually get it to turn the servos! Not a lot more we can do until the electronics is fitted in the cabinet and the motors are in place.

I'm still wondering about servo tuning as I only have this Chinese language version. Occasionally just running the servos on the bench they trip out with a "position exceeded" error but this seems likely to be because they are unloaded at the moment and the tuning is probably wrong. Have you been able (or needed) to do any servo tuning?

Yes all up and runnig.
I had to change the max speed for G00 movement as it was set way to high in the controler and also the acceleration/deceleration. Than slight adjustment on steps per/mm values.
But all that took no longer than 1hour.
The programing/control is very easy mind you i have a 20 years of experience with many many controlers. At the moment i program it at the panel. Very shortly i will need to use CAM so iam going to have to find a post processor that suit or find one close enough and adjust acordingly to suit this controller.
If you need any help just let me know and i ll try my best to help with what i learned upto now.

How can i upload any photos or videos?
I would show you the way i have made the mounts.
Cheers Petr

Muzzer
10-11-2020, 05:05 PM
I made a Fusion 360 post processor for my Newker 990 which is likely to be close to what you need. If you don't have anything else, you could try that out. These Newker / Newkye / SZGH controllers seem to share a lot of DNA including the G codes.

Neale
10-11-2020, 11:19 PM
I wasn't there when someone else created a gcode file from F360 which seems to run fine on the 1000MDb. I believe although I can't swear to it that he used a Fanuc PP to generate the code. That ran to about 7000 lines and "compiled" (which I suspect might just mean syntax-checked) and ran. At least, the bench-mounted servos went round and round in a way that looked plausible! That used facing, 2D adaptive clearing, and 2D contour tool paths. Complicated tool paths but basically just a bunch of G1/G2/G3 codes - just lots of them. And I've just had another look at it - turns out that the guy who generated it was using imperial units - there's a G20 at the beginning. I completely missed that first time I looked at it. It certainly seems possible (we tried it) to switch between metric and imperial units by entering G20/G21 at the MDI screen, although I am very aware that it is a very easy way to get yourself completely screwed up. I'm trying to persuade my friend that working entirely in metric units is the only right way to go although he is an imperial diehard!

To upload pictures, switch to "advanced" mode and just above the box where you type, there is a row of icons that let you add links, upload images, etc. You might need to have posted a minimum number of posts before the system will let you do this - I'm not sure about that.

Muzzer
11-11-2020, 12:09 PM
Yes, I based my PP on the generic Fanuc post. Didn't require a lot of work although I can't recall what changed.

I made some notes recently when I recreated the post. https://mightyshiz.blogspot.com/2019/02/recreate-fusion-360-post-processor-for.html Forgive the idiotic ramblings.

One of the key changes was to cater for the fact it doesn't recognise G28, unless the SZGH allows it.

Neale
11-11-2020, 12:42 PM
Well, the good news is that according to the SZGH 1000MDb manuals, G28 is supported. I would have guessed that it is because, supposedly, the controller supports toolchangers (although my project isn't using one). I think that G28 can often translate loosely as "move to tool change position." Still good to know that they make specific reference to it.

Bad news is that I can't find how to actually set the G28 position. There are hundreds of parameters that are settable and I'm guessing that it's in there somewhere but I haven't found it yet. A search for "reference position" in the two manuals throws up lots of references to how and where it is used, but nothing on how it is set in the first place! But we'll get there eventually...

Muzzer
12-11-2020, 10:02 PM
Therein lies the challenge that is Chinglish. The words have been translated by a machine, rather like Google Translate, so the final words may be related to what you need to know but not the ones you'd choose.

I don't know why I replaced the G28 commands in my post, as I see that it implements both G28 and G30. Difficult to imagine anyone omitting those when you think about it.

Isn't the home position used by the G28 command the one that is set when you home the machine? To home these controllers, I think you press the "Return" button on the panel switch. The homing sequence etc are defined in various parameters, mainly the "Axis" ones. The actual parameter numbers may differ with your SZGH controller but here's my translation of the relevant section of the 990 manual. It may give you a pointer where to look:

Using a home switch:
Homing operation returns each axis to the machine home position in turn. When the parameter of feeding axis which back to datum point is 0, the axis of coordinate detects the datum point and return to the pulsing signal of “Zero”, the machine coordinate will be set to 0 automatically.
At system power up, once alarms are cleared and the e-stop button is released, the machine should be homed for correct operation.
Note:
The system should be homed every time it is powered on. The homing method can be set by #38 in Axis Parameter. It can be prompted or forced.
The method and type of homing signal can be set by #39 in Axis Parameter. Detecting the home switch can be sufficient. However, detecting the Z (index) signal of the axis motor encoder after detecting the home switch will give better precision.
The direction for homing for each axis can be set by #40 in Axis Parameter. D2, D3 & D4 correspond to X, Y, & Z axis. 0 is forward, 1 is reverse.
The type of the homing switch for the home position can be set by #41 in Axis Parameter. D0, D1 & D2 correspond to X, Y & Z axis. 0 is NC, 1 is #
The maximum search distance for detecting the Z (index) pulse of the axis motor can be set by #37, #38 & #39 in Axis Parameter. The value must less than the movement of the axis due to one revolution of the motor.
The return distance after homing can be set by #46, #47 & #48 in Axis Parameter.

Neale
12-11-2020, 10:26 PM
My understanding is that the G28 reference position is not necessarily the home position although I agree reading the manual that for the 1000MDb, they might be the same thing. For example, in both Mach3 and the MyCNC software that I'm currently using with my router, you can separately define the G28 position (machine coordinates, obviously) and in fact I set it over the fixed touchplate set into the bed of my machine. Definitely not the home position! But, control systems vary so maybe SZGH and the clones think differently. I have found where the home position and homing parameters are set, use of index pulse, offset of machine zero from physical home position, etc, and I had hoped that G28 was defined in the same parameter set. But I don't think it's quite that easy...

It does make sense to me that there are separate sets of coordinates for machine home and tool change position, but maybe that's just thinking that's been conditioned by what I have been using to date. Again, in my case, it's useful to have these separate as my G28 position is over the bed while the physical home position is over the floor - less useful when you drop a tool during a tool change!

Actually, thinking about homing, I do need to check if the index pulse gets sent back to the controller. I'm not sure that the encoder pulse outputs (which are available on the motor) are cabled through to the controller. I don't think that we have a cable from SZGH that connects to the encoder pulse input socket on the back of the controller - I'll need to double-check that. It would mean that the controller display would act as a DRO if the manual handwheels were used. Although, as discussed elsewhere, I would discourage the owner of the machine from doing that!

Muzzer
13-11-2020, 11:59 AM
My Acorn system allows several G28 / G30 "return" positions to be stored, for things like tool change, tool setter, park etc. But G28 seems to be quite a confusing command and is interpreted and implemented differently depending where you look. I don't recall a similar table of return positions in the Newker controller.

There's the option to set coordinates for the electronic tool setter in mine. As I have bolted mine to the table, I use that option. The alternative is to simply sit it on the table under the tool. The advantage of that approach is that you can also use the tool setter to acquire the top of the stock, by sitting the setter on top of the stock, touching off, then automatically subtracting the height of the setter from the Z coordinate.

There is an MPG input on mine which I use with a wired MPG but I looked into using the original DRO linear encoder inputs to display actual position rather than commanded position. Thought that sounded like a nice idea - I'd come to believe this was possible but turns out it isn't. I could still use an index pulse output from the motor servo drive (if it was available) to improve the homing accuracy but on my Bridgeport that would be lipstick on a pig.

If you want to use the handwheels and see where the machine is, I think you'd need to have the "absolute" version of the controller which communicates with the servos through some sort of serial bus. Even then it's not clear if that mode is supported.

JAZZCNC
13-11-2020, 10:13 PM
In the Fanuc standard G28 and G30 are actually simple commands but easily miss understood and used. How G30 works also depend on the controller.

G28 just returns to MACHINE zero, however it does this by way of going thru an intermediate point first, or it can if required. Also how it works changes depending on G90, G91 modes and it''s this that I think catches people out most.

For instance in theory you could just type G28 and nothing else and the machine would go to the MACHINE ZERO position, however, the Fanuc standard requires you enter an Axis and a value, this value is the intermediate position the axis should go thru on it's way to MACHINE ZERO.
In practice, the current Position the tool is located is often used for the intermediate value and the Axis then goes straight to ZERO. But here is where it can get funky, this depends on what mode you are in G90 or G91. For instance, these two example lines below will give exactly the same movement. For this example assume the tool is located at X10.
#1
G90
G28 X10

#2
G91
G28 X0
Both these commands will move to the MACHINE ZERO via the intermediate point.?

With Example, #1 X10 is the intermediate point, which is the location of the tool now so it goes straight to MACHINE ZERO.
But with the example, #2 things are different because we are now in the INCREMENTAL mode so we are no longer going thru an intermediate point but rather moving an intermediate distance on the way to ZERO. So X0 is seen as moving zero distance and then the axis goes to MACHINE ZERO.
Now if the code read as below it would be different again.
G91
G28 X10
In this case, the X-axis would move 10mm positive from its current location then move to MACHINE ZERO.

Now G30 is actually classed as a move to a secondary ZERO position and depending on the controller can actually have several ZERO positions.
But again in practice, it gets used exactly like G28 because of how it works.
G30 works just like G28 and sends the Axis to ZERO by going through an intermediate position but G30 works by going to the secondary ZERO which is set in the controller parameters. Depending on the controller you can have several G30 ZERO positions that are stored in parameters and called by using a "P" address.
So G30 P3 X10 would move to or thru intermediate point X10 then use the value stored in parameter #3 and move the X to this ZERO location.

However, often just G30 X10 would be used and in this case, because no "P" address is given it assumes "P1" as a default ZERO value and because many people don't program the Controllers Secondary ZERO position or the controller doesn't have this option then G30 is used just like G28 and sends the axis to ZERO.

But in essence, both G28 and G30 simply just move to MACHINE ZERO via an intermediate point.

Neale
13-11-2020, 10:53 PM
Thanks, Dean, that has clarified a few things. After reading the manual quite a few times, I was coming to the conclusion that G28 was effectively "move to machine zero", but with an optional intermediate point. Similar to Mach3 and MyCNC except that these allow a G28 position definition rather than assuming machine zero. I'm used to seeing code that has something like:
G28 G91 Z0
G90
near the end - meaning raise to machine Z0 before going to ref posn in XY, so you don't clout anything on the way. What I'm not sure about (because the manual isn't that easy to understand) is whether this sequence would work on the SZGH controller as there is something about not moving along an axis if it is not specified in the G28, so you would actually need something like:
G28 G91 X Y Z0
G90
- but maybe not!
Looking at G30, I get the impression that it does exactly the same as G28 except that it uses the current work coord zero. But I'm guessing a bit here as the manual is not at all clear. In particular, it describes G28 in detail, then mentions G281/282/283/284 which do the same thing but only in X/Y/Z/A axis. It also talks about G301/302/303/304 which are similar but G30 is not mentioned in this section at all - although it is in the table of recognised gcodes.

So, in practice, on this controller, if you have a fixed position tool setter or tool change position, would you arrange for this to be at machine coord zero, and arrange home switches at limits of travel but with appropriate offsets for the home position? Then G28 would work in the way that we currently know and love (including use of G91/90 as in my code snippet above).

JAZZCNC
13-11-2020, 11:29 PM
I'm used to seeing code that has something like:
G28 G91 Z0
G90
near the end - meaning raise to machine Z0 before going to ref posn in XY, so you don't clout anything on the way.

No Neale it doesn't mean that, this is what confuses people. G91 sets the mode to incremental so "Z0" doesn't mean go to ZERO. It means the intermediate move length is ZERO units long and then the Axis moves to the ZERO position. So in your case, it's just moving to ZERO, the result is the same thing but only because the value is ZERO, if it had been Z-10 then it would move -10 from the current position then moved to ZERO. Try it.!

The reason G91 is often used is that sometimes you don't know the current location (ie: after a canned drilling cycle) so can't specify the current location as the intermediate location for the G28 move. So G91 incremental works better because you are now telling it to move a distance rather than to a location, Hence Z0 is moving ZERO units then it goes to MACHINE ZERO.


What I'm not sure about (because the manual isn't that easy to understand) is whether this sequence would work on the SZGH controller as there is something about not moving along an axis if it is not specified in the G28, so you would actually need something like:
G28 G91 X Y Z0
G90
- but maybe not!
Looking at G30, I get the impression that it does exactly the same as G28 except that it uses the current work coord zero. But I'm guessing a bit here as the manual is not at all clear. In particular, it describes G28 in detail, then mentions G281/282/283/284 which do the same thing but only in X/Y/Z/A axis. It also talks about G301/302/303/304 which are similar but G30 is not mentioned in this section at all - although it is in the table of recognized gcodes.

So, in practice, on this controller, if you have a fixed position tool setter or tool change position, would you arrange for this to be at machine coord zero, and arrange home switches at limits of travel but with appropriate offsets for the home position? Then G28 would work in the way that we currently know and love (including use of G91/90 as in my code snippet above).

If it follows the common Fanuc standard, which I think it does, then it should work as I explained where G28 just moves to Machine ZERO but through an intermediate position. Only G30 with it's secondary parameters can move to different positions which are defined in the controls parameters and as shown called with a "p" call in the code ie: G91 G30 P301 Z0 where the "P301" is the parameter address in the controller and the value in this parameter is the location. The Z0 is again saying move Zero units for the intermediate move because we are in G91 Mode.

What I think the manual is saying with G281/282/283/284/ is that it stores the ZERO values for each axis in these parameters, these parameters can then be called in macro's, etc using the "p" address. ie: G0 P282 is like saying G28 Y

JAZZCNC
14-11-2020, 01:14 AM
Something else I think should be pointed out for sake of clarity and might also explain why G28 sometimes doesn't work as expected is better explination of the intermediate move and how it works. The intermediate move is NON optional for both G28 and G30 and it must be included along with an Axis definition for it to work. But this is what can make it appear to work strangely.?
The G28/G30 commands is exclusively a move to MACHINE Zero Position, however, there's a sting in it's tail which is what bites people, so lets say you command:
G90 G28 X0 Y0 Z0 what do you think will happen.?
You'd assume X0,Y0,Z0 would mean move the axis to Machine Zero. . . .But it won't.!
Remember the intermediate move MUST happen, so in this case X0,Y0,Z0 are the intermediate move coordinates but in what Coordinates system.? Machine or Work.?? . . Yep the intermediate moves are in WORK coords, so in this case it would go to the WORK ZERO, then to the MACHINE ZERO. And you can imagine the carnage that could happen if the tool was located at the other end of the machine and all 3 axis set off going for WORK ZERO together before heading to MACHINE ZERO.!!

So this is why G90/G91 become so important when using G28/30. Often G28 will be proceeded with G91 to put into incremental mode to make it easier with the intermediate move then straight after the G28 move the next line will be G90 to put back into Absolute mode which is safer to work in.

Little differences BIG end results if get it wrong.!

Muzzer
14-11-2020, 03:02 PM
I read Peter Smit's bible on g code to understand what G28 was about. I suspect the reason I edited my post was to ensure it actually did what was required ie retract fully to machine Z home position. Don't recall the specifics but I may have struggled to understand what Newker were actually doing with it.

I also ended up rewriting the tool length macros because they didn't work correctly, something to do with my machine being a knee mill and they probably targetted a bed mill..

You can edit the post processor easily enough to spit out the correct g code for end of program, tool change etc. I also put in an option to decide whether to move the table to an accessible position after finishing the machining. That comes up as an option in the Fusion dialogue box when you post process the job.

Neale
14-11-2020, 10:27 PM
Interesting discussion, at least to me who has had perhaps more limited access to different controller types than you guys!

Absolutely right, Dean - I got my G90 and G53 in a twist. Stupid of me - I've used enough of both in things like tool-height setting macros to be aware of the difference. Your detailed description of why absolute/incremental around the G28 is needed is a subtle point that isn't really that obvious when you read the manuals. Not until you've driven the tool through the bed and then had to figure out why...

I've only used G28 in the context of Mach3/CSMIO and MyCNC/ET6, and it works the same way in both - "go to predefined ref posn", and the user can specify the ref posn in parameters somewhere. Sounds like this is rather different to the Fanuc interpretation. Another case of "both are right but both are different" - you just need to understand what's happening. Now I know about the Fanuc view of G28, the SZGH manual makes a lot more sense. I would guess that they have added the "G281" etc format so that instead of
G90 G28 Z0
G91
you could just use G283 ("move to ref posn along Z axis")
Not that much of a saving, really

I understand the point about the Fanuc G30 taking a position parameter for the destination position although moving via an intermediate point. What I read in the SZGH manual, though, sounds as if the position parameter concept doesn't exist and they use the work coordinate zero as the final destination. Frankly, I'm going to end up experimenting once the machine is up and running but even if we end up redefining machine zero somewhere other than the home switch position because that's more useful for manual tool-change, that's not a big deal. I've left the default action in F360 to move to the toolchange position at the end of a toolpath in place although Muzzer's idea of making that a tick box option in the PP is interesting. On the odd occasion when I've wanted to move the tool out of the way at the end of a run, I've edited the gcode manually.

Muzzer
14-11-2020, 11:29 PM
I you are interested, here's my post processor. You'd need to change the file ending to .CPS to use it with Fusion.

Pretty sure it will work with the SZGH controllers.

Neale
15-11-2020, 11:08 PM
Many thanks. Shall hold off doing anything until the machine is up and running for testing. So far, we know that we can generate gcode from F360 using the built-in Fanuc PP and that runs (it makes the servos go round on the bench!) but at least that means that there are no unrecognised commands or syntax errors in there. Whether it does what it is supposed to is another thing and will have to wait for now. I feel a bit of air-cutting coming on!

Muzzer
16-11-2020, 12:25 PM
Yes, IIRC, the Fanuc post works 99% out of the box with these things - it's just that you probably want to customise it to generate the desired opening and closing commands. Also, they haven't 100% implemented Macro B and I have a feeling they added a few variations of their own. I was also unable to get my original 4th axis to work correctly (inverse time etc).

Neale
16-11-2020, 01:58 PM
Indeed - wouldn't expect a major issue with that.

But remembering that I know nuffin' - what's Macro B?

Muzzer
16-11-2020, 03:33 PM
That's the full fat name for the Fanuc g code std AFAIK.