George,
In the tool 8 section of the macro you check if it is tool#8 and then you do another endif, shouldn't that be END. Not sure if that is what is messing up the macro or not but it seems to go off to no where? Strange you can call the moves from the MDI and they work correctly. The other thought is is is actually using degrees or steps, think that is a MACH3 setting under general. But if it works from the command line that must be set correctly.
Russ
George,
Really, well I am now on Mach4 and it uses LUA so some of my experience on Mach3 macros is not as up to date. Maybe someone who write a bunch of macros can review your set. Since this works on the command line this must be something wrong in the Macro.
Russ
Thanks Russ, command line moves are not consistent!! the travel of the rotational turret varies, I'm expecting to arrive at each tool position but sometime tools are skipped and the turret moves through 3 tools before stopping, other times it only moves half the distance expected.
Very Strange indeed!!
George
This sounds like the ismoving code is not working correctly
George,
I think I would start back and the beginning. I would first test movement of the motor that turns the tool changer. Not sure if yours is a rotary tool changer, that is what is sounded like. You just want to do tests moving the tool changer and not taking any action to actually change the tools. So see how many pulses it takes to rotate the tool changer 360 degrees. That is the very first step, and see if you can repeat that over and over and get the same exact results.
Russ
Hi Russ,
I attempted to move my 'Rotary' tool changer through 360 degrees by using the following MDI command.
G0 A360
I finally got it to rotate through 360 degrees by changing the 'Steps per' in motor tuning set to 167 This seems to be a very odd number for the steps per but it seems to work for my turret.
A Axis is set to Angular
ROT 360 rollover is checked
Distance mode is set to Inc checked
Turret moves 360 degrees each time.
I'm pretty sure that there is something amiss with the homing of the tool turret, I will try and fit a new homing sensor tomorrow.
George
Last edited by Georgie; 03-07-2017 at 01:23 PM.
George,
Perfect, now if you have six tools do the following test.
Move it 360/6 = 60 degrees. If you have 8 tool positions just divide by 8.
You want to move to G0 A60
Does that work? then go to G0 A120 and so on. Is that aspect working?
Russ
Georgie,
This is good news you have a great deal of this working. Now the next step is to make the macro that only handles say one tool, T1. You need to verify that works each and every time, then add the next tool. My guess is the addition of the second tool is where you will start to see issues. But that will allow you to pin point the issue causing the problems.
Russ
Ok Russ, I have an 8way rotating tool turret
Here's what I did.
I set distance mode to ABS
I checked the Rot 360 rollover box
I set A axis to angular
I placed a G90 directly after Get Selected tool =1
I homed the Z axis this was fine.
I don't have a 'Home' button for the A axis However I can home the axis by pressing the 'ref turret' button. The axis does ref to the sensor but very slowly ??? Once it hits the sensor then it backs of 1 degree.
If I move the turret and the Z axis away from the home position and then do a 'Home all' the Z axis returns to the home position set but the A axis does not move at all ???
Ok from the turret at home I then input via MDI
G0 A45 Turret moves 45 Deg
Input G0 A45 again, turret does not move
Input G0 A90 , turret moves to an additional 45 Deg
Input G0 A135, turret moves to an additional 45 Deg
And so on through to 360 Deg.
That seemed to work fine but heres the odd bit.
From the A axis home position,
Input T201 turret moves 45 Deg this seems ok
Input T301 turret moves an additional 90 Degrees, in other words it skips a tool.
Input T401 turret moves an additional 135 Degrees, now it skip 2 tools
Input T501 turret moves an additional 180 Degrees, now it skips 3 tools.
And so on....
I now set distance mode to Incremental and with each entry of G0 A45 the turret moves 45 Degrees each time, this seems correct.
I ref the turret again, now sitting at tool No1
T101 , no move
T201 moves past tool No2 then backs against it's stop, this seems good
T301 move 90 skipping a tool
T401 moves 135 skipping 2 tools
T501 moves 180 skipping 3 tools.
Clearly some wrong with my M6 macro or my setup,
I'm frazzled so I need some help.
Regards
George
Georgie,
OK, here is what is wrong.
When you original reference the A axis that sets the zero degree mark for that axis, which is fine. You would need to add a button if you wanted that as a button option.
You have your distance mode set to absolute for the A axis. That means it only accepts absolute moves. You have the axis set to 360 rollover.
When you issue the command G0 A45 it goes to 45 degree absolute. When you issue G0 A45 again it does not move. Why? Because you are at 45 degree absolute already.
When you issue the command G0 A90 it moves another 45 degrees because you are at 45 degrees absolute and to get to 90 degrees absolute it needs to move 45 more degree, this is all working correctly.
In incremental mode when you issue the command G0 A45 it will always advance another 45 degrees with each of these commands
I will look at your macro again but you probably want to keep things in Absolute mode because then you don't have to keep track of where you are and do math to calculate what you must do to get to the next position.
Hang in there I will examine your code again, after my meetings this afternoon.
Russ
No problem, glad you have it all working correctly now.
Russ