Welcome! Log In Create A New Profile

Advanced

Problem with Z-probe and autoleveling

Posted by ArturKrajewski 
Problem with Z-probe and autoleveling
January 11, 2014 08:31AM
Hello everyone smiling smiley

My name is Artur, i'm from Poland.
I have problem with latest Repetier-Firmware and z-probe/autoleveling feature.

First, I moved Z_MIN to Z_MAX:
pins.h

#define Z_MIN_PIN          -1  //27
#define Z_MAX_PIN          27  //-1

configuration.h

#define MIN_HARDWARE_ENDSTOP_Z false
...
#define ENDSTOP_PULLUP_Z_MAX true
#define ENDSTOP_Z_MAX_INVERTING true
#define MAX_HARDWARE_ENDSTOP_Z true
...
#define min_software_endstop_z true
...
#define max_software_endstop_z false
...
#define Z_HOME_DIR 1  //-1

After this printer is homing in X=0, Y=0, Z=170 without any problems and I can print as earlier.

Second, I configured servo:
#define FEATURE_SERVO 1
#define SERVO0_PIN 15

I tested it with M340, it works great.

Third, I configured z-probe:
#define FEATURE_Z_PROBE 1
#define Z_PROBE_PIN 40
#define Z_PROBE_PULLUP 1
#define Z_PROBE_ON_HIGH 0
#define Z_PROBE_X_OFFSET 50
#define Z_PROBE_Y_OFFSET 30
#define Z_PROBE_WAIT_BEFORE_TEST 0
#define Z_PROBE_SPEED 2
#define Z_PROBE_XY_SPEED 500
#define Z_PROBE_HEIGHT 3.3
#define Z_PROBE_START_SCRIPT "M340 P0 S1450"
#define Z_PROBE_FINISHED_SCRIPT "M340 P0 S600"
#define FEATURE_AUTOLEVEL 1
#define Z_PROBE_X1 55
#define Z_PROBE_Y1 35
#define Z_PROBE_X2 130
#define Z_PROBE_Y2 200
#define Z_PROBE_X3 200
#define Z_PROBE_Y3 35

This is separated switch connected to PIN 40 on my board.
I tested it with G31, I get "L" when it is not pressed, and "H" when I press the switch with finger.

When I send G29 S2 to the printer (just after homing):
- servo moves to correct position (so Z_PROBE_START_SCRIPT is OK)
- extruder moves to X=55, Y=35,
- then moves to X=5, Y=5 (I guess it is Z_PROBE_X1 - Z_PROBE_X_OFFSET and Z_PROBE_Y1 - Z_PROBE_Y_OFFSET, so it should be OK)
- and than I immediatelly get "Error: Z-probe failed".
Z axis is not move at all, but on LCD Z switches from 170 to 0.

My board is teensylu based "UniqueOne" with AT90USB1287 CPU. All other features (LCD, SD, fan etc.) work great.
My full configuration.h is attached.

Do you have any ideas what might be a reason of this error?

Greetings

Artur
Attachments:
open | download - 2014-01-11 13.37.09.jpg (359.4 KB)
open | download - 2014-01-11 13.36.10.jpg (385.3 KB)
open | download - 2014-01-11 13.37.21.jpg (386.1 KB)
open | download - Configuration.h (20.8 KB)
Re: Problem with Z-probe and autoleveling
January 11, 2014 11:49AM
You get that error, when a endstops triggers before the first move. You should call these methods when you are short over the bed, especially if you use G32 which does 3 probes (to safe time). In any case make sure you are away from any endstop (M119 returns L for all endstops).


Repetier-Software - the home of Repetier-Host (Windows, Linux and Mac OS X) and Repetier-Firmware.
Repetier-Server - the solution to control your printer from everywhere.
Visit us on Facebook and Twitter!
Re: Problem with Z-probe and autoleveling
January 11, 2014 01:19PM
Hello,

I tried G30 started in position X=150,Y=150, Z=100 (nearly center of printer) and error was the same.

I do not understand two things:

1) I have #define FEATURE_AUTOLEVEL 1 ih configuration H, but after M502 M500 I have "Autolevel active" = 0 in EEPROM

2) in float Printer::runZMaxProbe() and float Printer::runZProbe there is:

    stepsRemainingAtZHit = -1;
    ...
    if(stepsRemainingAtZHit<0)
    {
        Com::printErrorFLN(Com::tZProbeFailed);
        return -1;
    }
    setZProbingActive(false);

Com::tZProbeFailed is exactly an error I get.

stepsRemainingAtZHit variable is set to -1 and is not set in any other place to any other value.

In this case it is impossible to not get this error. But of course I can be wrong smiling smiley

Edited 1 time(s). Last edit at 01/11/2014 01:20PM by ArturKrajewski.
Re: Problem with Z-probe and autoleveling
January 12, 2014 03:58AM
You omitted the line that would have changed the variable:

PrintLine::moveRelativeDistanceInSteps(0,0,-probeDepth,0,EEPROM::zProbeSpeed(),true,true);

In your case especially in DeltaSegment::checkEndstops

#if FEATURE_Z_PROBE
        if(isZNegativeMove() && Printer::isZProbeHit())
        {
            cur->setXMoveFinished();
            cur->setYMoveFinished();
            cur->setZMoveFinished();
            dir = 0;
            Printer::stepsRemainingAtZHit = cur->stepsRemaining;
            return;
        }
#endif

So the question is, why this code segment does not get called in your case.

One reason would be
long probeDepth = 2 * (Printer::zMaxSteps - Printer::zMinSteps);

is 0. Also check your z probe speed in eeprom.


Repetier-Software - the home of Repetier-Host (Windows, Linux and Mac OS X) and Repetier-Firmware.
Repetier-Server - the solution to control your printer from everywhere.
Visit us on Facebook and Twitter!
Re: Problem with Z-probe and autoleveling
January 12, 2014 05:30AM
Is autoleveling feature available only for delta printers?
Re: Problem with Z-probe and autoleveling
January 12, 2014 07:47AM
No, autoleveling works for all printers. But deltas are especially hard to calibrate so you will see more users with delta doing calibration.


Repetier-Software - the home of Repetier-Host (Windows, Linux and Mac OS X) and Repetier-Firmware.
Repetier-Server - the solution to control your printer from everywhere.
Visit us on Facebook and Twitter!
Re: Problem with Z-probe and autoleveling
September 28, 2014 09:16AM
Have same problem

Z Max endstop on pin 27
Probe switch on pin 38
Servo on pin 15

Home Z to Max Endstop

M119 - all endstops L (when pressed it will change to H)

G31 - probe switch on L (when pressed it will change on H)

When type G30 - Error: Z-Probe Failed

Where problem is? Configuration.h attached
Attachments:
open | download - Configuration.h (20.8 KB)
Re: Problem with Z-probe and autoleveling
September 28, 2014 09:20AM
What does happen between command send and error? Any movements, motors going on etc.


Repetier-Software - the home of Repetier-Host (Windows, Linux and Mac OS X) and Repetier-Firmware.
Repetier-Server - the solution to control your printer from everywhere.
Visit us on Facebook and Twitter!
Re: Problem with Z-probe and autoleveling
September 28, 2014 09:25AM
I was manualy hit Home Z (and Z axis stop on z max endstop)

after type G30

Printer Height: 0.00
EEPROM updated
X:0.00 Y:2.01 Z:0.00
Error: Z-Probe Failed
Re: Problem with Z-probe and autoleveling
September 28, 2014 09:42AM
That error comes, if there were no steps done to find probe switch. One possible reason is that

probeDepth = 2 * (Printer::zMaxSteps - Printer::zMinSteps);

return 0, which essential means you zLength in eeprom is 0. Set it to your estimated z height and it should work again.


Repetier-Software - the home of Repetier-Host (Windows, Linux and Mac OS X) and Repetier-Firmware.
Repetier-Server - the solution to control your printer from everywhere.
Visit us on Facebook and Twitter!
Re: Problem with Z-probe and autoleveling
September 28, 2014 09:45AM
Roland, please see my configuration.h and help with settings
THNX!

Edited 1 time(s). Last edit at 09/28/2014 09:45AM by codec.
Re: Problem with Z-probe and autoleveling
September 28, 2014 10:19AM
Config look sgood, just check whats your zlength in eeprom.


Repetier-Software - the home of Repetier-Host (Windows, Linux and Mac OS X) and Repetier-Firmware.
Repetier-Server - the solution to control your printer from everywhere.
Visit us on Facebook and Twitter!
Re: Problem with Z-probe and autoleveling
September 28, 2014 11:10AM
Found the problem smiling smiley

I was test with firmware from January '14 - problems with autoleveling.
Today I was download new one firmware and everything work without problems.

Edited 1 time(s). Last edit at 09/28/2014 04:14PM by codec.
Re: Problem with Z-probe and autoleveling
May 11, 2015 10:24AM
Hello Roland

i have the same iisue but im not getting one thing , im trying to set auto level for a month now

my setup is

latest firmware (from today)
z min end stop
z probe on pin 47 (capacitive sensor)

after im G28 , im sending G30 then the probe probe for hight

then im sending g32 and on the second probe point im getting z probe error and that is becaouse the z min endstop triggers -- i got it by now

now i dont want to use Z max endstop beacouse i dont want to send the bed all the way down 195 mm and then back

what is your advice ? can i use z probe as a min endstop instead to have zmin stop and probe as well ?

many thanks

elidor
Re: Problem with Z-probe and autoleveling
May 11, 2015 11:01AM
z min and autoleveling does fit well. For it to work it must trigger after the endstop has passed the deepest possible bed for you slightly rotated bed. And that is exactly what you do not want. If it works as endstop it should trigger before you hit the bed and not after it. I know it takes ages to go up and down, but exactly that and some other advantages are the reason why you should do it.

The only solution left is never do home to z min, only x and y and then G32 without storing to eeprom. I think that might work also I have not tested it myself I know others do it that way. Problem is we then start from undefined z position which firmware also does not like as it want's to start near the bed for better speed and now goes down to a starting point. You can define this height to a high value to prevent this. Starting lower is always allowed. So hold your hand near reset if you start testing how it behaves.


Repetier-Software - the home of Repetier-Host (Windows, Linux and Mac OS X) and Repetier-Firmware.
Repetier-Server - the solution to control your printer from everywhere.
Visit us on Facebook and Twitter!
Re: Problem with Z-probe and autoleveling
May 11, 2015 03:30PM
HI

thank you alot for the quick support =)


i was trying what you have adviced ... it working great

first..

home X0 Y0
G30
G32
Print...
start g code G1 X0 Y0 on slicer


some idea for other approch

no min endstop

1. user cannot move z axis or home z axis when connect printer
2. the system will automaticly move up z axis by 5 mm or so on power up ( like delta home on start ) in order to avoid bed collision - just to be sure....
3.when user send G32 - system probe and store the lowest point on bed as z=0 as a virtual endstop - the Z0 reset when disconnect or emergency stop


i belive its ok not to store the setting on eeprom and beacouse maybe some user will change nuzzle and bed temp (ABS VS PLA) that will effect the z hight

thank you no cali for me any more thumbs up
Re: Problem with Z-probe and autoleveling
May 12, 2015 03:13AM
We have a homing order. There we could a additional combination that also mark home z as Autolevel or an other flag like you said having no z endstop and having autolevel transform home z in G32.

The G30 has no effect btw. It is for hosts wanting to probe different points.

Not really sure with the 5mm up. It is needed if you are too deep and dangerous if you are starting too high but without endstop we do not know where we start. Also the automatic move at the beginning is not always easy since some boards power already over usb and then we have to stepper power to move at all. So I guess regardless of what we try there is always a risk with this solution that the user should be aware of, so he has to watch out what starting conditions are.


Repetier-Software - the home of Repetier-Host (Windows, Linux and Mac OS X) and Repetier-Firmware.
Repetier-Server - the solution to control your printer from everywhere.
Visit us on Facebook and Twitter!
Sorry, only registered users may post in this forum.

Click here to login