Mazak Spindle Warm Up Macro

Mazak Spindle Warm Up Macro

CNC Training Call David: 07834 858 407

CNC Training Centre Reviews

30 five star ratings on Google (just saying)

Warm up Programme

This Mazak Spindle Warm Up Macro is something I created recently for the Macro training course that we offer at the CNC Training Centre. The course covers Macro Programming suitable for Haas, Mazak and Fanuc.

I must admit I often think that with Macro programming a little knowledge is a dangerous thing. On visiting companies I just think it’s more about a programmer’s ego than really getting good CNC code.

See this article, it gives a brief description of macro programming.

If you just want the Mazak Spindle Warm Up Macro then just jump to the end and copy it. I won’t be offended by the fact that you are just too selfish and greedy and can’t even spare the time to read my articles that I slave for hours to produce!

Gratuitous use of macro programming (that’s bullshit to the normal folk), can be dangerous and really confusing to the operator using it.

  • A macro can automate a regular task.
  • Families of parts can be grouped together and simplified in one programme.
  • Macros should be fool proofed with alarms to prevent erroneous input.
  • The details of the macro ideally should be protected (ie lock the 9000 programmes).
  • Where possible alias the macro to a G or M code.
  • The machine operator is your customer so treat him or her well.
  • If you don’t like re-inventing the wheel every day then macros are for you.
  • Don’t forget to check if you have the macro option on your machine it can be quite expensive to add. Oh and it will really piss you off if you read this whole article and find you ain’t got it!

Some Explanation.

This macro (Mazak Spindle Warm Up Macro) is for the warming up of the spindle, it’s a much smoother warm up because it does not take big leaps in speed. It is a much more gradual approach.

You tell it your maximum rpm you want to warm up to and the time you want the warm up to last. You can tell it what RPM increase you want as a step. You also tell it the initial speed you want your spindle to start at from cold.

It goes on to calculate the difference between your start speed and your maximum speed. It divides this speed by the speed increment that you give it. This will tell it how many times to go around the loop.

In the loop it uses the machine timer. It zeros the timer then runs it for the calculated time for each step.

It has to then get this time in milliseconds because that’s what the geeks use in these machine timers.

Ideally it should be aliased to an M code.

Alias WTF? No it’s not like changing your name from Reginald Kenneth Dwight to Elton John it is a bit more sophisticated.

What it means.

Well it means you can access a programme using your own G code or M code.

Mazak Spindle Warm Up Macro

So for example if you put 200 into parameter 92 when you programme a G200 it will jump to programme 9011. Just as if you had put M98 P9011 or G65 P9011. With a G code you can pass arguments to the programme a bit like G81. In G81 you tell it the depth and rapid point these are the Z and the R values. Now you can do the same with your G code.

Also for parameter 82 if you put 33 into parameter 81 when you programme M33 the control will jump into programme 9001. You cannot pass arguments when you use an M code. Best not to argue then eh.

So for my Mazak Spindle Warm Up Macro we will use M33 and alias it to programme 9000. So having done all this you can lock out programme 9000 so no one can even see it. (Our little secret). They will not be able to edit it either.

All they need to know is that M33 will run the Mazak Spindle Warm Up Macro.

M33 is aliased to O9000

 

Now then a word about testing.

Actually it’s more than one word but here we go.

When you test your macro you need to stop your control from looking ahead, put the blinkers on as it were.

(Sorry that’s totally wrong blinkers actually make a horse look ahead and not to the side).  Anyway CNC controls have to look ahead and here is why.

Cutter Compensation.

Below is a typical tool path where the tool is compensated to the left. In order to machine the part without cutting into it the control needs to read in front.

Mazak Spindle Warm Up Macro

As it moves up the left hand side it needs to know where its going in advance, moving round the outside in single block it would stop here.

Mazak Spindle Warm Up Macro

If it were about to cancel the compensation it would end the move here.

Mazak Spindle Warm Up Macro

If it were about to go to the left on the inside it would need to stop here.

Mazak Spindle Warm Up Macro

They would all be the same Y position but in single block it stops ready for the next move (three different places).

So this explains why the control looks ahead. Each move relies on the next for correct positioning.

When we write a macro programme and we are testing it this look ahead is a real nightmare. The system often will know the answer before you think it has seen the question.

Complicated?  mm read on:

Right joking aside, what we do is to use a G code to stop the system from looking ahead. What we can then do is single block through the macro and check the calculations as we go.

When you are happy with the code you can let the system look ahead again by turning look ahead back on.

Although what you are doing may be very simple, a very small mistake can really bugger things up. (Sorry for saying bugger, I meant knacker).

Have a System.

Now my advise here is to be very systematic in your approach and test each line of your macro as you go. Be happy that each line works ok before you move on to the next.

You can try it this with the Mazak Spindle Warm Up Macro below. Turn off the block look ahead and the single block restriction and check each variable as it is changed. It will help you to understand how the Mazak Spindle Warm Up Macro works.

Oh one other thing plan your macro before you start don’t get to excited and rush on. Also keep a record of what variables you have used so that you don’t accidentally use a variable twice. Things can get very scary if you do this.

Comment, comment, comments and more comments to say what the comments are for. Honestly you can’t have too many comments in a macro. The best approach is to imagine that you were abducted by aliens (I sincerely hope you never are) but if you are the will anyone understand your code?

If the answer is no then you are not explaining your code well enough. Also if you are like me and you have a poor memory then you will need them for yourself. So when you look back at this macro in 200 years you will know what it meant.

Check this article on how to lay out your CNC code and add comments.

“The code give us the bloody code?”

OK.

So here is the Mazak Spindle Warm Up Macro.

I hope it works for you.

PLEASE DO NOT USE THIS MACRO IF YOU ARE UNDER 18 OR ARE OF A NERVOUS DISPOSITION

Mazak Spindle Warm Up Macro

Oh by the way if you get bored easily then I definitely wouldn’t read all this. Just put the code in your machine and enjoy it with my compliments (thicko).

Mazak Spindle Warm Up Macro

O09000 (Mazak Spindle Warm Up Macro)

#3004= 7 (OVERRIDE CONTROL NOT ALLOWED)
#100= 20. (TIME)
#101= #100 * 60000. (TIME MILLISECONDS)

#102= 500. (RPM FROM COLD)
#103= 7000. (MAX RPM)
#104= #103 – #102 (RPM INCREASE)

#105= 1. (RPM STEP)
#106= #104 / #105 (LOOP)
#107= #101 / #106 (DWELL)
M03 S#102 (Start spindle at initial speed)

WHILE [ #106 GT 0 ] DO1 (DO LOOP)
S#102 (START SPINDLE AT INCREASED RPM)
#3001= 0 (RESET INTERNAL TIMER TO ZERO)

WHILE [ #3001 LT #107 ] DO2
END2

#106= #106 – 1 (COUNTER DECREASES BY ONE)
#102= #102 + #105 (INCREASE SPEED BY STEP)
END1

#3004= 0 (OVERRIDE BACK ON)

M30 

Boring, boring so what does it all mean?

Explanation of  Mazak Spindle Warm Up Macro

O09000 (Mazak Spindle Warm Up Macro)

#3004= 7 (OVERRIDE CONTROL NOT ALLOWED)
(Set this to a 7 to stop override of speed.)

#100= 20. (TIME)
(Total time of warm up in minutes)

#101= #100 * 60000. (TIME MILLISECONDS)

#102= 500. (RPM FROM COLD)
(Spindle will start at 500 RPM)

#103= 7000. (MAX RPM)
(Maximum RPM you want the warm up to reach)

#104= #103 – #102 (RPM INCREASE)

#105= 1. (RPM STEP)
(This in the step used as the RPM increases)

#106= #104 / #105 (LOOP)
(Calculate the number of times it goes around the loop)

#107= #101 / #106 (DWELL)
(Dwell time after each speed increase)

M03 S#102 (Start spindle at initial speed)

WHILE [ #106 GT 0 ] DO1 (DO LOOP)
S#102 (START SPINDLE AT INCREASED RPM)
#3001= 0 (RESET INTERNAL TIMER TO ZERO)

WHILE [ #3001 LT #107 ] DO2
(TIMER COUNTS DOWN BY DWELL TIME)
END2

#106= #106 – 1 (COUNTER DECREASES BY ONE)
#102= #102 + #105 (INCREASE SPEED BY STEP)

END1

#3004= 0 (OVERRIDE BACK ON)
(Override works again.)
M30

Single Block

You can suppress single block in a macro. You can suppress single block in this macro (Mazak Spindle Warm Up Macro) because it is really annoying if you expect your spindle to warm up in 30 minutes. You come back having made tea, toast and croissants (as us engineers do).

“Shit” you say “the machines been on single block and stopped at 500 rpm for 30 minutes”

Just add these.

#3003= 1 (SINGLE BLOCK OFF)

#3003= 0 (SINGLE BLOCK ON)

I have suppressed spindle override because you need the correct speed in a spindle warm up programme.

If you read the explanations above you will see how it works.

 

CautionSwitchSingleBlock

Oh and by the way here is a similar article for a Haas or Fanuc type machine.

Services offered at CNC Training Centre

Edgecam Training.

Classroom programmer training.

Onsite CNC Machine Training.

CNC Training on all controls and machines.

Mazak Training Fanuc Training

Don’t forget we offer training on all types of Mazak Machines and all Fanuc Controls 6m to 31i Oi old to young.


Mazak Quick Turn 10 CNC Lathe. What’s not to Like?

CNC Training Call David: 07834 858 407

30 Five Star Reviews

CNC Training Centre Reviews

Contact CNC Training Centre

Mazak Quick Turn 10

It’s been a while since I trained anyone on a Mazak Quick Turn Machine. Another training job completely out of the blue.

Custom Rifles, didn’t know what to expect really. Anyway a drive to Tunbridge Wells, where for the price of a garden shed you could probably buy my village in the Midlands.

I just want Mazak Training I’m not interested in your boring article.

 

Mazak Quick Turn

I ended up in glorious countryside on a farm in what felt like the middle of nowhere. The guy who runs this company (Paddy) has his workshop in the outbuildings of the farm.

 

 

It is like walking into Dr Who’s Tardis. This workshop wants for nothing, surface grinding, shot blasting. This guys even got a Faro Arm!

CMM Solutions

Two Haas machines and the Mazak Quick Turn 10. Not the tidiest of workshop but I am told it’s a work in progress.

It is really heartwarming to see such investment in tooling and modern equipment in what effectively is a one man band.

Paddy is a brilliant engineer and mostly self taught. Loads of the CNC stuff learnt from my website (happy days) . This guy googles everything but not in a “What I had for breakfast, oh fuck the cat just threw up” type of way.

This is very constructive use of google definitely the way forward.

He already had a pretty good understanding of what the machine could do. Being self taught, several gaps in his knowledge, so, in steps me, to fill em all up.

Paddy rebuilds, repairs and creates custom rifles.

Mazatrol

I had forgotten just how brilliant these machine are. I don’t believe there is a quicker way to get a part from drawing to bubble wrap than the Mazak Quick Turn.

Check out this video on Tool Path Store another brilliant feature on the Mazak Quick Turn.

 

I’m not flogging these things by the way but if your reading this article I’m always open to offers. That is providing I keep my clothes on, well maybe not, how much we talking?

Mazak Quick Turn

From its original concept Mazatrol has never really got much better and that’s not a criticism. For turning it’s just bloody good, very bloody good.

G Code Programming

When I train people on G code type controls who have worked on Mazatrol and machines like the Quick Turn 10 they are stunned at how complex the programs are.

 

Mazak Quick Turn

Like for example on a Mazak you index the turret and you wanna use a tool. Now that’s not a big ask is it?

Well on most other controls you can’t because the bloody offset is not active. You can call it in MDI if you want. That is if you know how. Trouble is, the minute you press RESET it’s gone .

How to stop this from happening

On a Mazak once you index the turret that tool is active along with all its associated geometry.

That means you can start manual turning with hand wheel or jog and the diameter is what it says on the screen.

Mazak Quick Turn

So simple, so obvious but what a difference it makes. The list goes on and on as to how well thought out these Mazak Quick Turn machines are.

All the information is saved with the program. So that means your work offset, jaw details and chuck details are all there when you call the program again.

Graphics

Now the graphics are not like“Assassin’s Creed Origins” but they are adequate and definitely help a lot. If you can be arsed to set the graphics up with chuck jaws n stuff then you can be certain all will be okay when you run it for real.

Mazak Quick Turn

You can even jump from the program directory straight to a graphic simulation of the part so there is no “oh shit I wish I’d made a note of what this does” moment. You quickly get to see what the program does.

Footnote: You should still add a program description (and there’s a facility for this too.)

Liar Liar Your Bums On Fire

One of the main criticisms I hear of Mazatrol is that you have to “Lie to it”. I think when you want to do something a bit unusual it’s sometimes hard to get Mazatrol to do it.

This Mazak Quick Turn 10 is a two axis CNC Lathe. Let’s be honest most of the bits you make are gonna be quite simple. If not then this is where the Manual Programming Unit steps in.

Manual programming units are the Mazak “Get Out Of Jail Free” card

You can go back to some very crude G code programming within Mazatrol. These Manual Programming Units can sometimes get you out of a jam. It is quite limited, in what G codes you can use, but it will help a lot.

Incremental is a bit strange because it does not use U and W like you would normally on a Fanuc type system. It puts like a sign after your X or Z to tell you it’s incremental.

Need To Know

It’s well documented how easy it is to program in Mazatrol so I won’t dwell on it.

If you have never used Mazatrol you need to check it out. I think it is the epitome of “need to know”. What I mean by that is that it’s the minimum amount of information to get it to make some bits.

You know stuff like do you want tool nose radius compensation? Of course you bloody do. So it doesn’t ask you, you just get it.

Mazak Quick Turn

Anyone who has only used Mazatrol probably wouldn’t know what you were on about. And why should they care?

It’s like knowing all the bits inside your telly who gives a shit when you just want to watch “Emmerdale Farm”. I don’t watch that crap by the way, honest.

Read On It’s Not All This Boring

This control can smoothly go into ISO programming. Not sure if this is an option but they all seem to have it.

So………. from a Mazatrol program you just jump into an ISO G code type program and everything works the same.

So what’s all the fuss about. If there’s something you can’t do in Mazatrol just write a bit of straight ISO G code type program and call it from your Mazatrol main program. So there you go job done stop whining.

Even the graphics work in ISO so there is no excuse.

Priority

When you finish your program you get this list of processes and you can really easily swap things around. You know like if you wanted to thread before you did the grooving, you can easily just swap the order.

Haas SL 10

Then you have this button that says Rough Priority. When you press it all the roughing is done first. How cool is that??

Mazak Quick Turn

Program Restart

It always amazes me that CNC Machines are never that good on this. Well Mazaks are not bad actually.

You can really easily start from any program unit in Mazatrol. It’s also got this Single Process thingy that’s been around for years. Dead useful though. It means you can just run one unit, so you don’t have to worry about it carrying on to the next unit it just does that unit and ends.

Useful for stuff like just going over a thread again.

You can’t actually break into a unit to restart but on CNC Lathes you nearly always just want to start at the beginning of a tool.

If you have an ISO program it’s still better than a lot I could name. A bit convoluted in a way only the Japanese seem to be able to do. Nevertheless seven out of ten.

Procrastination

I was accused of this years ago and once I’d looked it up I thought yea that’s me. “What’s the point of this you ask? He’s off again”

When you are running an ISO program and you are milling say a shape or something. You look at the program and you see something coming up that you never got round to changing. It could be a feedrate or something.

It’s something that can keep pissing you off cos you forget to do it.

Help is At Hand. On a Mazak you can actually go into edit and alter it then come back n continue your program.

I just love showing people that one, makes me feel like I earned my money.

Oh yea by the way this is only when you are in an ISO program not Mazatrol

Things I Don’t Like

  • Take That Records
  • Beef Burgers
  • Brass Bands

No I meant about this machine Mazak Quick Turn.

Not much actually, oh the editing is a bit slow.

Editing

Editing in ISO is a doddle.

Editing in Mazatrol is very cumbersome and when it comes to stuff like copying a unit you have to say what program it’s from and all sorts of bollocks. It wants your bank account number and sort code.

There are more questions than a fuckin mortgage application.

Moving units is the same not a pleasant customer experience. Once you get used to it and how the Mazak brain is wired it’s ok though.

Let’s Be Honest

There ain’t much to not like about the Mazak Quick Turn.

Check this out on VFC it’s brilliant.

Even if I were only going to use the machine is ISO (Fanuc type programming) and not use Mazatrol I would still seriously consider buying one of these machines.

Why…..

  1. In ISO it’s easier to restart a program than most G code controls.
  2. The editing is easy.
  3. Better graphics than most. (It’s still like early space invaders)
  4. Erm…..

Oh yea I’d better do a plug for training. If you want to be trained on a Mazak give me a call.

 


Careers in CNC

View all current vacancies in CNC

Click here

Call David: 07834 858 407