PDA

View Full Version : Limit switches, inertia and controllers



Voicecoil
29-01-2019, 09:19 PM
So, I'm trying to decide exactly where to put the limit switches exactly, however it seems to me that there's quite a few variable involved. The big unknown is how quickly the gantry/carriage (gantry will be about 22Kg all in, carriage 7Kg less) will slow down, and does the controller (UC400ETH) actively brake the steppers or just shut them off. Obviously I don't want to lose cutting area by setting the limits too conservatively, but neither do I want to risk breaking stuff :black_eyed: Anyone got any ideas please?

Neale
29-01-2019, 10:45 PM
It's a good question, but in practice I don't think that you need to worry too much. I'm using Mach3 and the CSMIO/IP-M motion controller, but I'm assuming that the UC300 is similar in its functionality. I home at 40% of rapid speed (Mach3 configuration parameter); I believe that Mach3 respects the acceleration parameters you have specified for each axis so that it will never try to slow the axis faster than the steppers can handle - assuming that you have set appropriate acceleration/deceleration parameters, anyway! So, the motion controller does not need to brake the steppers as such, it just reduces the pulse rate sent to the stepper as it would for any change of speed. One very useful trick that is not obvious is to arrange the proximity switches (if that's what you are using) so that the trigger passes by it, not heads straight for it. This means that if the axis does overrun for any reason, it doesn't smash the switch! You might think that this will give less accurate trigger points but that doesn't seem to be the case in practice. You probably only need a few millimetres between the limit/home switch position and the physical end of travel, to only for the slight overrun as the first phase of homing completes. Again, I assume that the UC300 is similar, but the Mach3/CSMIO homing process involves driving the axis towards the home switch until it triggers. There will be a little overrun as the axis is decelerated. The axis is then stopped and reversed more slowly until the switch triggers again. The second trigger point is where the home position is registered.

Oh, and my gantry weighs around 40Kg and I have absolutely no problems.

cropwell
30-01-2019, 04:04 AM
One very useful trick that is not obvious is to arrange the proximity switches (if that's what you are using) so that the trigger passes by it, not heads straight for it. This means that if the axis does overrun for any reason, it doesn't smash the switch!

Yerss - My MD machine was designed with axial approach to the homing switch. It is too easy to jog onto it and crush the coil. It was an expensive mistake buying a replacement switch from MD as they charged £17 for the replacement (£2 on AliExpress).

The inductive switches such as the LJ12A-4-Z/BX trigger OK on the aluminium of the gantry, but, although they give a supply voltage range of 6 - 36V they need 12v min to operate reliably.

The -4- is the trigger distance

Neale
30-01-2019, 10:25 AM
I agree with comments about voltage - when I was setting up my machine I tested the proximity switches on a variable-voltage power supply and they were getting a bit flaky once down to about 9V. 12V gives solid performance. I run mine on 24V, partly to allow for any voltage drops where I have a pair wired in series (where an axis has + and - limits, I pair these together to share an input). In testing, I wired 4 in series, just to see what happened, and that worked OK as well. Not surprising if you look at how they work, but it's comforting to know that it's also true in practice as well as in theory!

routercnc
30-01-2019, 11:26 PM
If you haven’t built a machine before it’s easy to assume that the steppers are like regular motors and will spin on and coast down to a stop allowing the axis to sail on a bit. But as Neale says they only move if they get a series of step pulse signals. If the pulses stop then the motor pretty much stops dead and (someone jump in here!) is held in position by the coils being energised in one place. In fact Estops make a bit of a mild bump/bang as the stop is so quick so you only do it when called for. I’d be surprised if they overshoot more than an 1/8 of a turn and probably less.
The estop is so fast that under normal conditions it is kinder to the machine to use a software accel/decel ramp. What looks like a soft ramp up to speed and soft ramp down to a stop is actually the motor following the ramp parameters you asked for in the setup, not an uncontrolled overrun In MACH3 this is easy to do and other software no doubt has this as it is required for nice machine control.
So to cover all bases (homing and fast jog) maybe allow 10mm between home and limit. Make the home adjustable and you can claw some travel back once built and tuned.

cropwell
31-01-2019, 03:16 AM
I always thought that the drivers went to half current hold when not actually stepping (if that feature selected). Maybe half current only comes in after a time delay allowing the motor to overcome any overrun due to rotational momentum? Anybody know?

Voicecoil
31-01-2019, 07:07 PM
Thanks for the advice lads, sounds like it's less of a concern than I thought it might be. Incidentally I tested some LJ12A-4-Z series switches (of Chinese origin) and the actual sensing distance with 8mm thick material was 3.5mm for steel and 1.5mm for ali.

Neale
31-01-2019, 08:39 PM
Sensing distance is one thing, but the other thing to watch is the hysteresis - difference between switch-on and switch-off points. I had problems with my machine where I homed Z, then X and Y together. However, because of the tiny difference between on/off switch points, the vibration during X/Y homing was enough to trigger the Z home switch which by this time had become a limit switch. Fortunately, there is a Mach3 setting which offsets the home position slightly after homing which avoided the problem, but it's something to watch for. Spec sheets for more expensive switches seem to suggest something like 10% of the switching distance but mine was rather less than that.

routercnc
02-02-2019, 12:11 PM
On this general subject there are at least 4 ‘end of axis’ type features:
Home (physical sensor to home and zero the axis)
Soft limits (software detection for end of travel)
Limits (physical sensor for end of travel and invoke stop or estop depending on your setup)
Buffer (mechanical buffer for physical hardstop- not often seen on DIY machines but VMCs often have a rubber stop on the ballscrew as a last resort as these machines are heavy and move fast!)

I mention this as the other day I was jogging my machine around and managed to almost hit the home switch ( proximity type). I don’t have soft limits on and the home switch also feeds into my end of travel pin and does not invoke an estop (by design). I haven’t had a chance to investigate further but it looked like when I approached the home at full jog speed it treated it like I had released the jog key and decelerated to a gentle stop. But because it was moving quickly, unlike during homing, it used up all of the 4mm travel. If this is the case I will have to tune the accel / decel to be quicker or set up soft limits. My sensors are head on as I couldn’t get them side on. Anyone else seen this or do you estop if the end of travel is detected?

Clive S
02-02-2019, 04:51 PM
I don’t have soft limits on

Is there a reason not to use the soft limit as that would stop it

hanermo2
02-02-2019, 06:17 PM
Fwiw..
On steppers, the max acceleration with 48V DC, 542 drivers, Nema 23 3Nm steppers, 3:1 via HTD 5/15 mm, about 0.8 secs to max speed.
My table on a moving table VMC is over 200 kg in mass.
It stops in maybe 1- 2 mm from max speed. Using hw pulsing from a good generator, lately pokeys.

On 400W ac servos, Nema 23, 3.9 Nm peak, it stops in about 1 mm or less.

On the lathe, the new saddle assy == 150 kg.
32 / 4 mm ballscrew, 750W cont ac servos, 10 Nm peak.

X starts and stops in much less than 1 mm, if I was to use high acceleration - I don´t.
I use about 20% of max acc. for "normal" use.

Steppers in the past used to do similar, with much lower top speeds, and much less accuracy.

My c axis spindle and z axis (lathe) have about 10 kW of power in terms of inertia (I know its not kW technically).
Ie industrial turning centers (HAAS ST10) of 10 kWh cont. has about the same peak torque (102 Nm at 1200 rpm) as I have (90 Nm) 0-1000 rpm.
Using a 10" 4-jaw chuck.

The steppers at 1:3 ran about 600-700 rpm, 200 rpm+ at screw of 5 mm rise.

The servos run 3000 rpm, but I only use one third or 1000 rpm.
Very fast accelerations are like hitting the screw mount bearings with a big hammer, 10 kg, literally.
It wears the bearings out fast.

My mounts could take 3000 kgf loads, you could stand a truck on them.

Recap:
Lathes and mills typically go to max-speed in about 1 mm - 2 mm of travel.
Steppers are ok for full-out, and servo systems depend on a lot of stuff.

Anecdote:
The ac servos go to 3000 rpm in about 20 ms, 0.02 secs. Both 60V 400W and 220V 750 W servos.
It is likely the lathe servos could do full-peak accelerations, with the saddle, to 3000 rpm, at 0.02 secs or so.

At 10 Nm direct drive peak, the push force is about 650-700 kgf, 7000 N, near 1900 lbs of force.
For 150 kg mass on saddle assy, ==> 4.3 kgf.
43 m s/s acceleration.

At 1000 rpm x 5 mm, = 5 m/min. /60 = .083 m/sec.
8.3 cm/sec.
In 0.02 secs, the travel is 0.166 cm, = 1.6 mm.

routercnc
02-02-2019, 09:01 PM
[QUOTE=Clive S;107130]Is there a reason not to use the soft limit as that would stop it[/QUOTE
No reason. Just need to get a session back in the workshop again !

Clive S
02-02-2019, 09:21 PM
[QUOTE=Clive S;107130]Is there a reason not to use the soft limit as that would stop it[/QUOTE
No reason. Just need to get a session back in the workshop again !

I know how you feel :beer:

Neale
04-02-2019, 10:52 PM
Main reason for not using soft limits seems to be that you can't jog with soft limits on until you have homed the machine. I don't find that a limitation, but it all depends on things like where you home the machine, where you park the spindle when loading/unloading work, work area and rapids speed.

I've been using my machine this evening, but the cold drove me indoors eventually.

Voicecoil
06-02-2019, 11:03 PM
Aaaah, someone else who has a cold workshop - welcome to the club :cold:

Max Maker
06-08-2019, 07:00 PM
Learn from my mistakes. You will most likely at one point accidentally go further than your limit switches. My CNC crushed them on the very first test because of a dodgy endstop cable. My next CNC will use induction switches that won’t get crushed.

routercnc
06-08-2019, 10:10 PM
Yes, they work just as well detecting side-on as face-on. Mounting them side-on allows the moving metal part to slide past the face of the sensor and if it overshoots it will go past and hit the physical end stop, and the sensor is saved. You still have to work out what went wrong, but the sensor is saved.