Thanks is not exactly what I need but it has given me an idea, I don't really want to go to the limit every time I originate, I just need to be able to move the Z axis towards the table in the case of a stop near the upper physical limit, When executing Home Z it rises 5mm and ends up crashing, what I am going to do is create a macro according to your proposal to be able to move the Z towards the table a distance of 10 mm despite not having the origin and then do homing.
Macro: Move Z without origins
G91; relative positioning
G1 H2 Z5 F6000; lift Z relative to current position
I really appreciate your help and interest
Greetings