Hello Guest it is September 27, 2020, 02:18:33 PM

### Author Topic: Limiting 5th axis rotation, new setup  (Read 1001 times)

0 Members and 1 Guest are viewing this topic.

#### Duael

• 14
• Artist
##### Limiting 5th axis rotation, new setup
« on: September 14, 2018, 10:51:04 PM »
Hello,
New to Mach3.

I have a new gantry style 5 axis that I am setting up.
It has a 2.2 Water Cooled Spindle.
As a practical matter, I don't need my 5th axis to rotate anymore than 100cw to -100ccw (if Zero is Up).
What I dont want to happen is for it to rotate 360 by accident with these water hoses attached.

I have Limit Switches on X, X+, and The Y Switch has to metal plates at Y and Y+. The Z has a Touch Plate w/alligator clip.
The Limits double as Home Switches (at least that is the plan)

I am confused by the Home Negative checkbox in Home/Soft Limits.
Does this mean I can only tell my 5th axis to either rotate 0 to 100cw or 0 to 100ccw? With the appropriate Home Neg setting?
(Otherwise the Homing could cause a full rotation if it started on the wrong side of Zero)?

Is there any other way than Soft Limits, to tell my 5th axis not go past x degrees, when Homing, Jogging or any other time that suits its fancy?

Thank you

#### joeaverage

• 6,220
##### Re: Limiting 5th axis rotation, new setup
« Reply #1 on: September 15, 2018, 12:38:56 AM »
Hi,
it is common to use a limit switch as a home switch also on an axis.

Take say the X axis with two limit switches, one at each end. Lets say the leftmost one is X-- and X Home and the rightmost one is X++.
Your Soft Limits on the Homing and Limits page would be 0 (0 being home AND X--) and X++=400mm for an X axis of 400mm travel.

Imagine you have only one switch, a home switch on the X axis. Lets say that it is 100mm from the lefthand extreme of the axis. Your settings on the
Home and Limits page would be X-- = -100 and X++=300mm. Note the travel (400mm) is the same in both cases its just that the zero point is somewhere
in between the left and right extremes of the axis.

You want to program limits into your fifth axis. On Machs General Setup Page check that the fifth axis, B, is in angular units and also that rotational
soft limits are engaged. I suspect you will want Rotational Rollover unchecked.

If you have one B axis switch at the center point of rotation (home) then your softlimits would be -100 and +100. If you had two limit switches at each end of travel
with the home at the ccw end then the limits would be 0 and +200.

Provided you reference (home) your machine when you turn it on prior to use and your soft limits are set correctly they work pretty well. Mach will refuse,
in fact throw an error, if the Gcode or jog inputs attempt to cause an axis to go out of bounds. If you forget to reference (home) your machine then its
entirely possible for your machine to go out of bounds because you forgot to tell it where it was at the start, so even having the boundaries correct doesn't

The safest method is to have limit switches, one at each end of travel. Most high speed industrial machines have separate limit switches like that, it means that
if any one of the switches is activated the machine is shut down.....no ifs....no buts.....completely de-powered, its a safety measure. Such a machine will have
soft limits as well set to go off before the machine touches the physical limit switch. The idea is that 99.9% of the time the machine will work within the soft limit
boundaries and only as a result of some dangerous failure will the limit switch activate, and to comply with safety laws shut the power off.

Craig
My wife left with my best friend...
and I miss him!

#### Duael

• 14
• Artist
##### Re: Limiting 5th axis rotation, new setup
« Reply #2 on: September 15, 2018, 09:49:38 AM »
Thank you for the above average reply Joeaverage.

I would much prefer two switches here for safety.
But I have not seen a DIY 5 axis with switches on the 5th.
Can you point me to one? A video, blog or tutorial.

I can probably have some metal brackets made to mount two switches for my 5th.
That being said,
1) being that close to cutting, wont the switches need constant cleaning to work correctly? (I'm cutting brass and hardwood together, small bits, lots of dust)
2) Is there room left on a DB9slim for wiring two more switches? Should/could I try a single switch, like my Y, that uses two metal plates at each end of travel, to reduce wiring?
(its a real pain to get more than two wires in these screw terminals)

My DB9 wiring is as follows;
Both X's Signals (white) go to 1
Both X's Grounds (black) go to 9
Both X's 12v (Red) go to 6
Y signal (white) to 2
Y Ground (black) to 8
Y 12v (red) to 7
Z Black with white strip to 3
Z black to 8

#### joeaverage

• 6,220
##### Re: Limiting 5th axis rotation, new setup
« Reply #3 on: September 15, 2018, 10:33:28 AM »
Hi,
if you use two switches, one at each end of travel and wire them together how will you home the axis?

If you use the one wire then it would have contact at 100cw but also 100ccw, so which is home?

Craig
My wife left with my best friend...
and I miss him!

#### Duael

• 14
• Artist
##### Re: Limiting 5th axis rotation, new setup
« Reply #4 on: September 15, 2018, 11:02:52 AM »
Hello,

This makes me think I should only rotate 100. (for now that would be an acceptable solution for my current project)
With either one or two switches, the Home would be UP (Zero).

Otherwise Home would be at 90cw or 90ccw.
(Is that a bad thing. It seems like something I dont want to do)
Novice cnc'er here.
« Last Edit: September 15, 2018, 11:05:45 AM by Duael »

#### joeaverage

• 6,220
##### Re: Limiting 5th axis rotation, new setup
« Reply #5 on: September 15, 2018, 03:25:19 PM »
Hi,
the ideal is to have three switches, one home and two limit switches. Industrial machines are wired that way.
It means that there is no confusion between a limit or a home event. That does require that your controller or
breakout board has sufficient inputs, not always the case with hobby CNC gear.

I personally would fit a single home switch on a dedicated input and use Soft Limits. If you want the extra protection of limit switches then fit them
and wire them in series to a separate input.

Craig
My wife left with my best friend...
and I miss him!

#### Duael

• 14
• Artist
##### Re: Limiting 5th axis rotation, new setup
« Reply #6 on: September 15, 2018, 08:15:01 PM »
Is this what you just said?

#### joeaverage

• 6,220
##### Re: Limiting 5th axis rotation, new setup
« Reply #7 on: September 15, 2018, 08:55:41 PM »
Hi,
no not really, but looking at what you have drawn you probably don't have a choice, you don't have enough inputs to do as
I suggested.

I would in preference, I must point out that I use an Ethernet SmoothStepper with two ports equipped with BoB's which give 18 inputs
and 16 outputs, have all your home switches on separate inputs. I would have your X, Y and Z axes limit switches in series on another input.
I would have your two fifth axis limit switches in series on yet another input. Given that you fifth axis is likely to suffer damage it makes sense to
have limit switches and an input dedicated to monitoring that axis.

My suggestion would require four inputs for the home switches an two inputs for the two limit switch circuits, for a total of six inputs. Do you have
six inputs to spare?

Craig
My wife left with my best friend...
and I miss him!

#### joeaverage

• 6,220
##### Re: Limiting 5th axis rotation, new setup
« Reply #8 on: September 15, 2018, 10:21:45 PM »
Hi,
my preference would be something like the attached.

Note that the home switches are independent of all limit switches. In an industrial machine if any of the limits switches activates the machine
de-powers, not just stop, but kills the electrical supply.

Thus when you home the machine, if you combined a home and a limit switch, then the machine would stop. Mach can handle this by ignoring limits
when the machine is homing. That means when homing the machine is in a potentially dangerous state, it could accidentally exceed it limits and Mach
would not shut down. For large equipment this would be contrary to safety law in many countries.

Note that in industrial machines each limit switch would have its own input as well, it would allow the controller to permit the operator jog the machine
in the direction that brings the machine back into bounds and disable th jog direction that makes it worse. This would require even more inputs and wiring
for which very few hobbyists bother.

While I recommend the advantages of having separate and multiple inputs for limit and home switches you may, and probably are, constrained
by the number of inputs on your controller or BoB. If you have only two inputs to spare then your previous diagram will work but Mach will not know
which limit switch has just operated, just that one has. Likewise should any of the home switches operate while Mach is expecting the Y axis home
switch to meet its pre-programmed homing order Mach will interpret it as Y Home, when it was in actual fact an false activation of the B axis home switch
say. Consequently the Y axis would be mis-referenced and a crash is now likely.
My wife left with my best friend...
and I miss him!

#### Duael

• 14
• Artist
##### Re: Limiting 5th axis rotation, new setup
« Reply #9 on: September 16, 2018, 01:31:41 PM »
Craig,

Thank you for all your help from down under.

I was talking to a friend and he pointed out that there are options to limit rotation for B within the Postprocessor.
I'm using Fusion360.

I'm going to explore that for the time being as I dont have the inputs for a proper setup like you suggest.
I may return to my diagram (not mine, found online), but either way, it looks like I am just gonna have to think smart(er) when my toy is operational.