Z axis CNC control

Hi Zax, just installed the new Z axis on my A3 and got everything working and the distance calibrated (400 s/mm). and the axis is working smoothly.
Couple of confusing things:
When I first started to use the jog buttons with steps/mm set to 100 the axis moved fine, when I set to 400s/mm and jogged, the axis would stall. Tried changing the output power setting on the board, the same result. Just messing about trying to get it working, selected "Jog rapid feed" under settings and all was fine at 400 s/mm. Un click and the Z motor stalls when jogged - is that normal to have to have that selected?

2nd thing, using the 10mm square sample. CNC mode selected max cut -8mm, 4 passes, safe height set to 0. Z home set to top of material.
When starting, the Z axis goes down to -2mm for first cut, not Z0. This doesn't seem right for laser although would be correct for a cutter As laser would be focused on the material at Z0 so first cut should be at Zo??
Before next pass, Z axis goes up about 3mm, then comes down again to Z -4mm, next pass, Z up by approx 3mm, then down to -6mm, finally finishing at Z -8mm. The Z axis is not coming down in n2mm steps, but 2mm movement, then a 4mm movement, then 6mm and finally the motor moves just about a whole revolution and comes down 8mm. physically the Z axis is at approx Z -15mm when finished.
So two questions, is the Z axis supposed to go up between passes?
It looks a though the software thinks it is sending the Z axis up to Z safe(0) between passes, but it isn't really, so it ends up getting further down in Z. At the end of 4 passes, the coordinates say the Z is at 0, but in reality it is at about Z -15mm - Strange. I'll play some more over the weekend, but if you can shed some light on the behaviour that would be great.

@DavidF Well let's start with the easy question, "Jog Rapid Feed". Yes that should be on, it will do the jog moves as G0 commands at the machine feed rate setting (in Grbl parameters).

Now the CNC questions, you are correct, if you have Laser Mode enabled in the CNC menu? If not, it thinks you have a spindle and cutting in the air wouldn't be correct so it drops Z-step and starts as it should.

Something is binding or losing position with your Z-axis, enter a lower Z axis feed rate (if it's blank you are using the default XY value which is likely too fast).

Hi Zax, thanks for the reply. Jog rapid speed on, got it!
I'll check the laser setting in CNC tonight. It makes sense that it might not be on.
I have Z feed rate set to 600 at the moment. I'll try tonight. It only seems to be losing position when it tries to go up between passes, so maybe in CNC mode going up to safe is at a higher feed rate??
Yes, using 1.5m

Hi Zax, ok, the laser mode was not selected so now the first pass is done at
Z0. However, I slowed everything down and between passes 1 and 2 (0 to -2mm) the z axis is being told to go up to Z 0. And it stalls. Again between -2mm and -4mm, and between -4 and -6mm. Then at the end it also tries to go up to Z zero at high speed and stalls. My Z xis feed rate is set 200 at this stage. If I reset the Z axis distance cal to 80 s/mm it will mange the moves to Z 0 without losing steps. I have looked at all the various options and tried toput everything I can see to low speed, but these jumps to Z zero are all too fast for the axis. Looking at the G-code, before each new depth adjustment there is a line that says: (This is the code after the -2mm pass:)

Hi Zax.
I am sure I don't have a friction problem. The Z axis will jog all day up and down at a feed speed (set by engrave rate it seems) of 1000/1500
I have tried Z safe heights of 0, +5,-5 and even at the final cut depth and these make no difference so I am sure that these are not the cause.
I have all available parameters set to 200 and still the Z axis stalls during these unwanted moves up between passes and at the end of the job. I notice in the default gbrl parameters (display parameters) that the z acceleration is set to 5000 mm/sec^2 and the XY are set to 800. Can these defaults be changed?
We seem to have two problems here. The first is that it shouldn't be moving up between passes, and the second is that the speed or accel of these moves is not adjustable by a parameter I can get to.
I notice you have a version 1.1f which says CNC mode Z-XY. Is that the one I should be trying??

Just a quick note. It may help?? The option for Jog rapid speed and contrary to what the manual says, actually uses the engrave speed setting. I have tried changing both and only the engrave speed changes to Z jog speed.
Thanks

@DavidF The acceleration would affect jog as well, but yes I would reduce it. You can change any Grbl parameters in debug mode, just enter the following line and press enter:

$122=200

So you have also set:

$112=200

Is the Z-axis calibrated, so 10mm is moving 10mm?

I agree with you that it does move to Z0 between passes / shapes but this is expected for clearance (at least for a CNC) but I think it could be removed in laser mode due to the focal length although I need to study some more as this would be unusual.

Hi Zax
I'll try that.
Yes, I calibrated the axis for distance and that's when I needed to have 400 s/mm for Z. The jog does stall if I don't have the "jog rapid speed" option checked. Then I can set the speed for engrave to 1500 and the Z works fine. So not sure why the accel isn't causing a problem.
Cheers

@Zax Ok, weird stuff...
The Z axis was stalling regularly during the 10mm square test when I started trying some $112 and $122 values. 200 for both and all was good. Gradually increased $112 to 5000 (max) leaving Accel at 200. All was good with $112=5000. Started to raise the accel value in 1000 increments, expecting it to fail at 5000, But NO! it worked fine with $122=5000.
So whether the stored value was corrupted at some point back in the beginning when I was installing the s/w or firmware who knows. All the time in display grbl parameters the Z accel showed as 5000mm/sec^2, so probably never know. Anyway, I have set $112=5000, and $122=1000 just to be on the safe side and all is well.
Still need to stop it doing all the return to Z0, but at least it is working now.
BTW, I had tried loading default parameters before, but it still didn't work, so who knows why it is now!