Close



Page 3 of 9 FirstFirst 12345 ... LastLast
Results 21 to 30 of 89
  1. #21
    Technician
    Join Date
    Oct 2013
    Location
    South Australia
    Posts
    50
    Quote Originally Posted by Roxy View Post
    All right!!! Good! OK, here is what I think: I think we have two main issues to deal with. First, we need to make sure that any Z_Probing leaves the nozzle in a good (safe) position. And the second thing I think is going to happen is the Z-Probe is going to get fired during the middle of a print because of the edges curling upwards.

    Now that everybody is on the same version of the firmware, we can probably make progress pretty quickly.

    OK... First, lets try to get any Z-Probing to leave the nozzle at a safe height. There are a couple problems with this. G28 and G29 use different support functions to do their work right now. (I think they will get cleaned up eventually to use the same stuff. But right now, they do the work differently.)

    We need to have

    #define Z_RAISE_BETWEEN_PROBINGS 10.0

    defined in configuration.h Probably 10 is excessive right now, but it will let you see if it is doing the right thing.

    Now let's change run_z_probe() to leave the nozzle up. Right now it looks like this:

    static void run_z_probe() {
    plan_bed_level_matrix.set_to_identity();
    feedrate = homing_feedrate[Z_AXIS];
    ...
    plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], zPosition, current_position[E_AXIS], feedrate/60, active_extruder);
    st_synchronize();

    current_position[Z_AXIS] = st_get_position_mm(Z_AXIS);
    // make sure the planner knows where we are as it may be a bit different than we last said to move to
    plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
    }

    Lets change the very end of it to:

    plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], zPosition, current_position[E_AXIS], feedrate/60, active_extruder);
    st_synchronize();

    current_position[Z_AXIS] = st_get_position_mm(Z_AXIS);
    // make sure the planner knows where we are as it may be a bit different than we last said to move to
    plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);

    SERIAL_PROTOCOLLNPGM( "At end of run_z_probe() raising nozzle." );
    do_blocking_move_relative( 0.0, 0.0, (float) Z_RAISE_BETWEEN_PROBINGS );
    SERIAL_PROTOCOLLNPGM( "At end of run_z_probe() done raising nozzle." );

    }

    That should handle the bulk of the G29 code. Now for the G28 code, lets make sure

    #define Z_SAFE_HOMING

    is enabled in configuration.h . There are a million different code paths depending upon what options are turned on. In this case, the Z-Axis is treated with extra care. So... probably it makes sense to start with that. I'm not 100% certain this next change is going to do what we want, but it is the cleanest way to do this if it works. Be sure to have your finger ready to press the reset button when you test it. I think what we want to do is go find:

    static void homeaxis(int axis) {
    #define HOMEAXIS_DO(LETTER) \
    ((LETTER##_MIN_PIN > -1 && LETTER##_HOME_DIR==-1) || (LETTER##_MAX_PIN > -1 && LETTER##_HOME_DIR==1))

    if (axis==X_AXIS ? HOMEAXIS_DO(X) :
    axis==Y_AXIS ? HOMEAXIS_DO(Y) :
    axis==Z_AXIS ? HOMEAXIS_DO(Z) :
    0) {
    int axis_home_dir = home_dir(axis);


    At the very end of this function (Macro Defination) is this code:

    #if defined (ENABLE_AUTO_BED_LEVELING) && (PROBE_SERVO_DEACTIVATION_DELAY > 0)
    if (axis==Z_AXIS) retract_z_probe();
    #endif
    }
    }

    Let's change it to:


    #if defined (ENABLE_AUTO_BED_LEVELING) && (PROBE_SERVO_DEACTIVATION_DELAY > 0)
    if (axis==Z_AXIS) retract_z_probe();
    #endif
    }

    if (axis==Z_AXIS) {
    SERIAL_PROTOCOLLNPGM( "At end of homeaxis(Z) raising nozzle." );
    do_blocking_move_relative( 0.0, 0.0, (float) Z_RAISE_BETWEEN_PROBINGS );
    SERIAL_PROTOCOLLNPGM( "At end of homeaxis(Z) done raising nozzle." );
    }

    }


    If the G28 modification does not work right, we can do the changes right in the G28 code itself. Please compile and load these changes. And of course report back what is and isn't working right. Once we get the Positive Z_PROBE_OFFSET handled, we need to make sure the print doesn't stop because the Z-Probe gets fired in the middle of a print.
    I have an error on compiling.



    Marlin_main.cpp: In function 'void run_z_probe()':
    Marlin_main.cpp:921: error: 'do_blocking_move_relative' was not declared in this scope




    Section of code.

    static void run_z_probe() {
    plan_bed_level_matrix.set_to_identity();
    feedrate = homing_feedrate[Z_AXIS];


    // move down until you find the bed
    float zPosition = -10;
    plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], zPosition, current_position[E_AXIS], feedrate/60, active_extruder);
    st_synchronize();


    current_position[Z_AXIS] = st_get_position_mm(Z_AXIS);
    // make sure the planner knows where we are as it may be a bit different than we last said to move to
    plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);


    SERIAL_PROTOCOLLNPGM( "At end of run_z_probe() raising nozzle." );
    do_blocking_move_relative( 0.0, 0.0, (float) Z_RAISE_BETWEEN_PROBINGS );
    SERIAL_PROTOCOLLNPGM( "At end of run_z_probe() done raising nozzle." );
    }


    static void do_blocking_move_to(float x, float y, float z) {
    float oldFeedRate = feedrate;


    feedrate = XY_TRAVEL_SPEED;


    current_position[X_AXIS] = x;
    current_position[Y_AXIS] = y;
    current_position[Z_AXIS] = z;
    plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], feedrate/60, active_extruder);
    st_synchronize();


    feedrate = oldFeedRate;
    }


    static void do_blocking_move_relative(float offset_x, float offset_y, float offset_z) {
    do_blocking_move_to(current_position[X_AXIS] + offset_x, current_position[Y_AXIS] + offset_y, current_position[Z_AXIS] + offset_z);
    }


    static void setup_for_endstop_move() {
    saved_feedrate = feedrate;
    saved_feedmultiply = feedmultiply;
    feedmultiply = 100;
    previous_millis_cmd = millis();


    enable_endstops(true);
    }


    static void clean_up_after_endstop_move() {
    #ifdef ENDSTOPS_ONLY_FOR_HOMING
    enable_endstops(false);
    #endif


    feedrate = saved_feedrate;
    feedmultiply = saved_feedmultiply;
    previous_millis_cmd = millis();
    }

  2. #22
    Super Moderator Roxy's Avatar
    Join Date
    Apr 2014
    Location
    Lone Star State
    Posts
    2,183
    Quote Originally Posted by regpye View Post
    I have an error on compiling.



    Marlin_main.cpp: In function 'void run_z_probe()':
    Marlin_main.cpp:921: error: 'do_blocking_move_relative' was not declared in this scope
    ...
    }
    My bad...

    But it isn't my fault. This is one of those times life isn't fair. Scroll down 5 or 6 lines... That is where the definition for do_blocking_move_relative() is. A simple quick fix would be to cut and past the do_blocking_move_relative() function up above run_z_probe(). Then it will be declared when run_z_probe() needs to reference it. Its a shame to mess up the order of things, but if you want to keep making forward progress... That will do it. (But I have to get some sleep!!!! I'll check back in the morning.)
    Last edited by Roxy; 04-28-2014 at 10:19 PM.

  3. #23
    Technician
    Join Date
    Oct 2013
    Location
    South Australia
    Posts
    50
    Quote Originally Posted by Roxy View Post
    My bad...

    But it isn't my fault. This is one of those times life isn't fair. Scroll down 5 or 6 lines... That is where the definition for do_blocking_move_relative() is. A simple quick fix would be to cut and past the do_blocking_move_relative() function up above run_z_probe(). Then it will be declared when run_z_probe() needs to reference it. Its a shame to mess up the order of things, but if you want to keep making forward progress... That will do it. (But I have to get some sleep!!!! I'll check back in the morning.)
    Not sure what to do about this, so I will leave it until I get further instructions.
    I will work on another machine build ready to test this out on. I want to keep a machine for each version so I can compare the differences between them.

  4. #24
    Super Moderator Roxy's Avatar
    Join Date
    Apr 2014
    Location
    Lone Star State
    Posts
    2,183
    Here is the 'right' way to fix that forward reference issue that is keeping it from compiling. It is literally a one line fix.
    Make the declaration for run_z_probe() have the forward declaration for do_blocking_move_relative() just in front of it.
    Usually there is a header file where this would go, but the best place to put this is just in front of the run_z_probe() function so it stays close to where it is needed. That way all the changes are together if you need to move your changes to a more current code base in the future. This time I actually changed my code to verify it would compile! (and then changed it back)

    With these changes the run_z_probe() function knows everything about do_blocking_move() that it needs to know. It knows what type (and how many) parameters it takes and it knows what type (none) of value it returns. The compiler can generate a 'call' to the function even though it doesn't know what the function looks like yet.


    #endif // AUTO_BED_LEVELING_GRID

    static void do_blocking_move_relative(float , float , float ) ; // New line to fix forward reference issue

    static void run_z_probe() {
    plan_bed_level_matrix.set_to_identity();
    feedrate = homing_feedrate[Z_AXIS];

    Last edited by Roxy; 04-29-2014 at 08:32 AM.

  5. #25
    Technician
    Join Date
    Oct 2013
    Location
    South Australia
    Posts
    50
    Quote Originally Posted by Roxy View Post
    Here is the 'right' way to fix that forward reference issue that is keeping it from compiling. It is literally a one line fix.
    Make the declaration for run_z_probe() have the forward declaration for do_blocking_move_relative() just in front of it.
    Usually there is a header file where this would go, but the best place to put this is just in front of the run_z_probe() function so it stays close to where it is needed. That way all the changes are together if you need to move your changes to a more current code base in the future. This time I actually changed my code to verify it would compile! (and then changed it back)

    With these changes the run_z_probe() function knows everything about do_blocking_move() that it needs to know. It knows what type (and how many) parameters it takes and it knows what type (none) of value it returns. The compiler can generate a 'call' to the function even though it doesn't know what the function looks like yet.


    #endif // AUTO_BED_LEVELING_GRID

    static void do_blocking_move_relative(float , float , float ) ; // New line to fix forward reference issue

    static void run_z_probe() {
    plan_bed_level_matrix.set_to_identity();
    feedrate = homing_feedrate[Z_AXIS];

    OK, done that and tried it oiut.
    Nozzle really lifts high now ha..ha..

    Here is a printout of what appeared on the screen as it was working.

    Printer is now online.
    echo:Home X/Y before Z
    At end of homeaxis(Z) raising nozzle.
    At end of homeaxis(Z) done raising nozzle.
    SENDING:G29
    At end of run_z_probe() raising nozzle.
    At end of run_z_probe() done raising nozzle.
    Bed x: 1.00 y: 1.00 z: 6.92
    At end of run_z_probe() raising nozzle.
    At end of run_z_probe() done raising nozzle.
    Bed x: 158.00 y: 1.00 z: 4.12
    At end of run_z_probe() raising nozzle.
    At end of run_z_probe() done raising nozzle.
    Bed x: 158.00 y: 160.00 z: 4.15
    At end of run_z_probe() raising nozzle.
    At end of run_z_probe() done raising nozzle.
    Bed x: 1.00 y: 160.00 z: 6.53
    Eqn coefficients: a: -0.02 b: -0.00 d: 6.84
    planeNormal x: 0.02 y: 0.00 z: 1.00
    echo:endstops hit: Z:-3.47

    I haven't tried a print yet, it is nearly 1.00 am here in Australia, so I am off to the shower and then to bed. Will have another look at it ion the morning (later in the morning)
    Thanks for all your effort, much appreciated.

  6. #26
    Super Moderator Roxy's Avatar
    Join Date
    Apr 2014
    Location
    Lone Star State
    Posts
    2,183
    Quote Originally Posted by regpye View Post
    OK, done that and tried it oiut.
    Nozzle really lifts high now ha..ha..

    OK... Well, that was intentional... I would wait until everything else checks out, but you can change that equate from 10mm to 1mm or 2mm when you are ready.

    And I would leave them in for now, but eventually you will want to delete that extra chit-chat about where the code is executing and what it is doing. That just clutters up the display. That was in there just to help with debugging if the firmware went crazy.

    Quote Originally Posted by regpye View Post
    Here is a printout of what appeared on the screen as it was working.

    Printer is now online.
    echo:Home X/Y before Z
    At end of homeaxis(Z) raising nozzle.
    At end of homeaxis(Z) done raising nozzle.
    SENDING:G29
    At end of run_z_probe() raising nozzle.
    At end of run_z_probe() done raising nozzle.
    Bed x: 1.00 y: 1.00 z: 6.92
    At end of run_z_probe() raising nozzle.
    At end of run_z_probe() done raising nozzle.
    Bed x: 158.00 y: 1.00 z: 4.12
    At end of run_z_probe() raising nozzle.
    At end of run_z_probe() done raising nozzle.
    Bed x: 158.00 y: 160.00 z: 4.15
    At end of run_z_probe() raising nozzle.
    At end of run_z_probe() done raising nozzle.
    Bed x: 1.00 y: 160.00 z: 6.53
    Eqn coefficients: a: -0.02 b: -0.00 d: 6.84
    planeNormal x: 0.02 y: 0.00 z: 1.00
    echo:endstops hit: Z:-3.47
    If you got all the way through the G29 probes without an issue, we might be close. I just noticed, you have a 2.5 mm slope to your bed???? I'm guessing that is on purpose?

    Quote Originally Posted by regpye View Post
    I haven't tried a print yet, it is nearly 1.00 am here in Australia, so I am off to the shower and then to bed. Will have another look at it ion the morning (later in the morning)
    Thanks for all your effort, much appreciated.
    I'm sorry I was so tired last night. I couldn't stand to sit at my computer and try to get everything accurately typed in. This working back and forth across the globe really slows things down!

    It may be we can handle the Z-Probe triggering during a print with just a few changes to the configuration.h file. I don't know about that yet. I guess the right thing to do is just wait until you print a part and see what happens ????

    And once all that is taken care of... It would be good for you to visit this thread:

    http://3dprintboard.com/showthread.p...2518#post12518

    And add the M48 command to your Marlin_Main.CPP file. With that you will be able to measure the repeatability of your Z-Probe to know if the mechanics are working well. Probably you are going to get the best numbers we have seen so far.
    Last edited by Roxy; 04-29-2014 at 10:37 AM.

  7. #27
    Technician
    Join Date
    Oct 2013
    Location
    South Australia
    Posts
    50
    Quote Originally Posted by Roxy View Post
    And add the M48 command to your Marlin_Main.CPP file. With that you will be able to measure the repeatability of your Z-Probe to know if the mechanics are working well. Probably you are going to get the best numbers we have seen so far.
    Tried it out and left all the messages in so could see what is happening.

    SENDING:G1 Y0 F4000 X0 F4000
    At end of homeaxis(Z) raising nozzle.
    At end of homeaxis(Z) done raising nozzle.
    SENDING:G1 Y0 F4000 X0 F4000
    SENDING:M48
    M48 Z-Probe Repeatability test. Version 1.85
    At end of run_z_probe() raising nozzle.
    At end of run_z_probe() done raising nozzle.
    At end of run_z_probe() raising nozzle.
    At end of run_z_probe() done raising nozzle.
    At end of run_z_probe() raising nozzle.
    At end of run_z_probe() done raising nozzle.
    At end of run_z_probe() raising nozzle.
    At end of run_z_probe() done raising nozzle.
    At end of run_z_probe() raising nozzle.
    At end of run_z_probe() done raising nozzle.
    At end of run_z_probe() raising nozzle.
    At end of run_z_probe() done raising nozzle.
    At end of run_z_probe() raising nozzle.
    At end of run_z_probe() done raising nozzle.
    At end of run_z_probe() raising nozzle.
    At end of run_z_probe() done raising nozzle.
    At end of run_z_probe() raising nozzle.
    At end of run_z_probe() done raising nozzle.
    At end of run_z_probe() raising nozzle.
    At end of run_z_probe() done raising nozzle.
    At end of run_z_probe() raising nozzle.
    At end of run_z_probe() done raising nozzle.
    Mean: 11.120100
    Standard Deviation: 0.005024
    echo:endstops hit: Z:6.12


    Should be better with the new setup that I haven't fitted yet. I thought of some other hardware design changes, so I am printing those while re-building.
    Should have the new hardware all setup within a few days.

  8. #28
    Super Moderator Roxy's Avatar
    Join Date
    Apr 2014
    Location
    Lone Star State
    Posts
    2,183
    Quote Originally Posted by regpye View Post
    Tried it out and left all the messages in so could see what is happening.

    Mean: 11.120100
    Standard Deviation: 0.005024

    Should be better with the new setup that I haven't fitted yet. I thought of some other hardware design changes, so I am printing those while re-building.
    Should have the new hardware all setup within a few days.
    We don't have a lot of numbers yet, but .005 is pretty good! You will get very good bed leveling with that number. Do you have a high quality micro switch installed? I don't know this for sure yet, but if you actually installed a Micro-Switch branded micro-switch, you probably get the best numbers you can get.

  9. #29
    Technician
    Join Date
    Oct 2013
    Location
    South Australia
    Posts
    50
    Quote Originally Posted by Roxy View Post
    We don't have a lot of numbers yet, but .005 is pretty good! You will get very good bed leveling with that number. Do you have a high quality micro switch installed? I don't know this for sure yet, but if you actually installed a Micro-Switch branded micro-switch, you probably get the best numbers you can get.
    I just got a micro switch from ebay like you did. I have been looking at Farnell's they have a range of Honeywell switches and you can select the pressure that you need. I will see if I can find one that is very sensitive and affordable, because the price range goes from less than a dollar to several hundred dollars (go figure??)
    Bed time again. can't stay up as late as I did last night, I really felt it today.

  10. #30
    Super Moderator Roxy's Avatar
    Join Date
    Apr 2014
    Location
    Lone Star State
    Posts
    2,183
    Did you get through a print with the new setup? Any problems?

Page 3 of 9 FirstFirst 12345 ... LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •