Welcome! Log In Create A New Profile

Advanced

Disable End Stops on Repetier-host?

Posted by RobGer 
Disable End Stops on Repetier-host?
April 29, 2013 03:34PM
Hi All,

My end stops use reed sensors. The Y-Axis sensors homing trips about +30mm above the bed. This seems a lot for a reed switch sensor but the magnets are strong.
The sensors each have two wires, normally read open circuit & read less than 1 ohm when a magnet is brought near.
I set a Z-Offset of -20 so my extruder head is just above the bed.
The problem is the Z-Axis end stop prevents movements below it's homing height of +20mm above the bed.
When I manually unplug the Y-Axis end stop all works well.
I've tried to disable using below line but it docent seem to work.
#define ALWAYS_CHECK_ENDSTOPS false

Is there a way to disable end stop checking following homing operation on Repetiet-host?

Assistance appreciated.

Rob.
Re: Disable End Stops on Repetier-host?
April 29, 2013 04:15PM
download latest version of repetier host:[www.repetier.com]


ensure this is set to false:

#define ALWAYS_CHECK_ENDSTOPS false

then go in and look at commands.h
you could move the zaxis to initialize first, before x and y
if(zaxis) {
if ((MIN_HARDWARE_ENDSTOP_Z && Z_MIN_PIN > -1 && Z_HOME_DIR==-1) || (MAX_HARDWARE_ENDSTOP_Z && Z_MAX_PIN > -1 && Z_HOME_DIR==1)){
UI_STATUS_UPD(UI_TEXT_HOME_Z);
steps = (printer_state.zMaxSteps-printer_state.zMinSteps) * Z_HOME_DIR;
printer_state.currentPositionSteps[2] = -steps;
move_steps(0,0,2*steps,0,homing_feedrate[2],true,true);
printer_state.currentPositionSteps[2] = 0;
move_steps(0,0,axis_steps_per_unit[2]*-ENDSTOP_Z_BACK_MOVE * Z_HOME_DIR,0,homing_feedrate[2]/ENDSTOP_Z_RETEST_REDUCTION_FACTOR,true,false);
move_steps(0,0,axis_steps_per_unit[2]*2*ENDSTOP_Z_BACK_MOVE * Z_HOME_DIR,0,homing_feedrate[2]/ENDSTOP_Z_RETEST_REDUCTION_FACTOR,true,true);
#if defined(ENDSTOP_Z_BACK_ON_HOME)
if(ENDSTOP_Z_BACK_ON_HOME > 0)
move_steps(0,0,axis_steps_per_unit[2]*-ENDSTOP_Z_BACK_ON_HOME * Z_HOME_DIR,0,homing_feedrate[2],true,false);
#endif
printer_state.currentPositionSteps[2] = (Z_HOME_DIR == -1) ? printer_state.zMinSteps : printer_state.zMaxSteps;
}


best bet is to list your configuration.h file. I really don't understand what you want. homing sensors should be precise and work only at homing positions. temp, magnetic flux should not change sensitivity. read switches also have a lot of reluctance and residual energy. this causes lag time between when switch closes, and when switch will then again open. They should probably not be used for homing, if they are then step motion needs to be greater than 50ms per pulse motion to compensate for the residual magnetic effects. purchase some hall effect sensors, or use contact switches.

the only time the checks are enabled again is if DRIVE_SYSTEM=3. is this a Cartesian robot, or a delta robot?

Edited 6 time(s). Last edit at 04/29/2013 04:35PM by jamesdanielv.
Re: Disable End Stops on Repetier-host?
April 29, 2013 04:32PM
Hi James,

I want to disable the z-axis end stop except for during homing operation as activation of the z-axis end stop prevents the printer from traveling below Z0 while printing.
Z0 position is set when homing this axis and is approximately +20mm above bed height. So print head need to move below this height to print but it cant as the end stop tripping prevents this. Hope this explanation is clearer.

Thanks for help.
Attachments:
open | download - Configuration.h (46.7 KB)
Re: Disable End Stops on Repetier-host?
April 29, 2013 05:05PM
I'm not sure if it is a bug or not, it seems that in motion.h there are references to
check_endstop



in motion.h
void queue_move(byte check_endstops,byte pathOptimize) {
printer_state.flag0 &= ~PRINTER_FLAG0_STEPPER_DISABLED; // Motor is enabled now
while(lines_count>=MOVE_CACHE_SIZE) { // wait for a free entry in movement cache
gcode_read_serial();
check_periodical();
}

and inside motion.h I think that for some reason the check_endstops variable is not global, because it is set in commands.h by this

queue_move(ALWAYS_CHECK_ENDSTOPS,true);

queue_move is an external call. I don't know why this constant needs to be declared a variable, and then added to an array, as the array is just checked for if the endstop is set or not.

perhaps repetier can clarify how end stops are enabled and disabled in code?

is there any reason in motion.h we can not just use the constant ALWAYS_CHECK_ENDSTOPS?

Edited 1 time(s). Last edit at 04/29/2013 05:06PM by jamesdanielv.
Re: Disable End Stops on Repetier-host?
April 29, 2013 05:46PM
The reason is quite simple. Queue_move is used by normal moves and the homing commands. Even if you disable ALWAYS_CHECK_ENDSTOPS checks should still occur duringhoming, hence the flag.

If you want ALWAYS_CHECK_ENDSTOPS to work also on z endstop look into Repetier.pde bresenham_step and move the z endstop test inside the if condition. There is a thread about this in the repetier forum, but i think you should be able to find the place.


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: Disable End Stops on Repetier-host?
April 29, 2013 08:03PM
thanks repetier,

RobGer does this make sense for you?

you can look at [forums.reprap.org] for repetier details. i am not sure which topic discusses the z disable
Re: Disable End Stops on Repetier-host?
April 29, 2013 09:56PM
Hi James,

I really struggle to understand the code but will take a closer look tonight. I will also scan the Repetier forum for mentioned thread.

Thank you all very much for your assistance.

Kind Regards,

Rob.
Re: Disable End Stops on Repetier-host?
April 30, 2013 03:52AM
I Searched the forum but could not see any discussions on disabling Z-Axis end stop except for when homing.
For now I will just unplug the Z stop sensor after homing. Not the best solution though.
I think my biggest problem is that the Z-Axis sensor trips above the actual bed zero and there is no way to easily change this.
Perhaps I should replace the reed switch with a mechanical switch set at actual bed zero.
Any other suggestions appreciated.

Kind Regards,

RobGer
Re: Disable End Stops on Repetier-host?
April 30, 2013 04:52AM
gimme a few hours. I'll see if i can post what repitier was saying. but replacing reed switches would be ideal.
Re: Disable End Stops on Repetier-host?
April 30, 2013 06:07AM
Hi James,

I found this on [forums.reprap.org]
'The option to disable endstop checks during normal moves only works for x and y axis. For safety reasons the z endstop is always checked. Set the pin number to -1 to disable z axis checks - on your own risk.'

This might work for me if I only new how to set the pin number as described.
Does this mean anything to you?

Thanks,

Rob.
Re: Disable End Stops on Repetier-host?
April 30, 2013 07:14AM
no this is different. this completely disables z axis checks. your machine will home by crashing z

#define Z_MIN_PIN -1



the best way is to disable z only after homing.

in repetier.pde (first tab)

change the following lines from around line 1900 that looks like this

// Test Z-Axis every step if necessary, otherwise it could easyly ruin your printer!
#if Z_MIN_PIN>-1 && MIN_HARDWARE_ENDSTOP_Z
if((cur->dir & 68)==64) if(READ(Z_MIN_PIN) != ENDSTOP_Z_MIN_INVERTING) {cur->dir&=~64;}
#endif
#if Z_MAX_PIN>-1 && MAX_HARDWARE_ENDSTOP_Z
if((cur->dir & 68)==68) if(READ(Z_MAX_PIN)!= ENDSTOP_Z_MAX_INVERTING) {cur->dir&=~64;}
#endif



to this to comment the code out and make it not used:


/*
// Test Z-Axis every step if necessary, otherwise it could easily ruin your printer!
ALWAYS_CHECK_ENDSTOPS == true
#if Z_MIN_PIN>-1 && MIN_HARDWARE_ENDSTOP_Z
if((cur->dir & 68)==64) if(READ(Z_MIN_PIN) != ENDSTOP_Z_MIN_INVERTING) {cur->dir&=~64;}
#endif
#if Z_MAX_PIN>-1 && MAX_HARDWARE_ENDSTOP_Z
if((cur->dir & 68)==68) if(READ(Z_MAX_PIN)!= ENDSTOP_Z_MAX_INVERTING) {cur->dir&=~64;}
#endif

*/

this disables a vital check that ensures z axis will not crash. doing so is at your own risk. test it if you would like but be prepared for the worst.

Also i took a look at homing for z axis which is done in commands.ccp

if(zaxis) {
if ((MIN_HARDWARE_ENDSTOP_Z && Z_MIN_PIN > -1 && Z_HOME_DIR==-1) || (MAX_HARDWARE_ENDSTOP_Z && Z_MAX_PIN > -1 && Z_HOME_DIR==1)){
UI_STATUS_UPD(UI_TEXT_HOME_Z);
steps = (printer_state.zMaxSteps-printer_state.zMinSteps) * Z_HOME_DIR;
printer_state.currentPositionSteps[2] = -steps;
move_steps(0,0,2*steps,0,homing_feedrate[2],true,true);
printer_state.currentPositionSteps[2] = 0;
move_steps(0,0,axis_steps_per_unit[2]*-ENDSTOP_Z_BACK_MOVE * Z_HOME_DIR,0,homing_feedrate[2]/ENDSTOP_Z_RETEST_REDUCTION_FACTOR,true,false);
move_steps(0,0,axis_steps_per_unit[2]*2*ENDSTOP_Z_BACK_MOVE * Z_HOME_DIR,0,homing_feedrate[2]/ENDSTOP_Z_RETEST_REDUCTION_FACTOR,true,true);
#if defined(ENDSTOP_Z_BACK_ON_HOME)
if(ENDSTOP_Z_BACK_ON_HOME > 0)
move_steps(0,0,axis_steps_per_unit[2]*-ENDSTOP_Z_BACK_ON_HOME * Z_HOME_DIR,0,homing_feedrate[2],true,false);
#endif
printer_state.currentPositionSteps[2] = (Z_HOME_DIR == -1) ? printer_state.zMinSteps : printer_state.zMaxSteps;
}


it does not use the code that you are deleting so you should be ok.

repetier host compiles ok with the change, but be aware, and check the homing features and make sure they still work ok.
Re: Disable End Stops on Repetier-host?
April 30, 2013 03:25PM
Hi James,

Thank you for working so hard to help me out.
I will give this a try now & let you know how I go.

Rob.
Re: Disable End Stops on Repetier-host?
April 30, 2013 03:47PM
As a person who has used reed switches in other applications.

Do NOT use them as home switches.

Replace them.

The range is random, and the hysteresis is large.
Re: Disable End Stops on Repetier-host?
April 30, 2013 04:51PM
I'm trying to use them as they are what came pre-installed on my CubeX printer.
They worked for 3D systems so I i see no reason why they wont wrk for me.

Edited 1 time(s). Last edit at 04/30/2013 06:04PM by RobGer.
Re: Disable End Stops on Repetier-host?
April 30, 2013 05:50PM
I commented out the code as suggested and found the Z-Axis homing does not work as it no longer detects the Z-axis end stop.
I've checked the Z-axis end stop activation using M119 and can see that it is detected.
It does however now allow me to travel to -Z positions.
Re: Disable End Stops on Repetier-host?
April 30, 2013 10:50PM
ok, i'll take another stab at it tonight. do you need to be using repetier host firmware, or can you switch to marlin until your switches arrive?
Re: Disable End Stops on Repetier-host?
May 01, 2013 02:34AM
Hi James,

I can give marlin a go. Don't go to too much trouble. I have ordered some mechanical & hall effect end stops as a back up plan.
Wish I could shout you a beer for your troubles.

Kind Regards,

Rob.
Re: Disable End Stops on Repetier-host?
May 01, 2013 04:45AM
in marlin UN-comment in configuration.adv

#define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing

this is default for x,y,z axis.

your config says rambo board right?

more info on board here [reprap.org]


edit: I will again need to look into this because the firmware for the rambo is all for rostockmax.


[reprap.org] shows the pins for the rambo.

Edited 3 time(s). Last edit at 05/01/2013 04:56AM by jamesdanielv.
Re: Disable End Stops on Repetier-host?
May 01, 2013 05:14AM
Hi James,

Thanks again.

I will check out & let you know how I go.

Ta. Rob,
Re: Disable End Stops on Repetier-host?
May 02, 2013 04:48AM
Hi James,

I had a play around with your previous suggestion using Repetier and have come up with the following solution that solves my problem using the CubeX reed switches.
I will however re-enable Y-Axis end stop checking while printing once my new end stops are fitted as a safety measure.

Repetiet Firmware Z-Axis Disable on print Changes as follows:

Commands.cpp

Line # 31 Define home_flag
int home_flag = 0;

Line # 531 Set Flag when homing
case 28: {//G28 Home all Axis one at a time
          home_flag = 1;
          byte home_all_axis = (GCODE_HAS_NO_XYZ(com));
          home_axis(home_all_axis || GCODE_HAS_hot smileycom),home_all_axis || GCODE_HAS_Y(com),home_all_axis || GCODE_HAS_Z(com));
          home_flag = 0;
}

Repetier

Line # 123 Reference 
extern int home_flag;

Line# 1900 Only Check Z-Axis End Stops while homing
   // Test Z-Axis every step if necessary, otherwise it could easyly ruin your printer!
   if(home_flag == 1) {
#if Z_MIN_PIN>-1 && MIN_HARDWARE_ENDSTOP_Z
   if((cur->dir & 68)==64) if(READ(Z_MIN_PIN) != ENDSTOP_Z_MIN_INVERTING) {cur->dir&=~64;}
#endif
#if Z_MAX_PIN>-1 && MAX_HARDWARE_ENDSTOP_Z
   if((cur->dir & 68)==68) if(READ(Z_MAX_PIN)!= ENDSTOP_Z_MAX_INVERTING) {cur->dir&=~64;}
#endif
  }
Re: Disable End Stops on Repetier-host?
May 02, 2013 05:04AM
good, you saved me the trouble! smiling smiley
Re: Disable End Stops on Repetier-host?
May 02, 2013 11:26AM
If you only want to use endstops on homing:

Change
   }
   // Test Z-Axis every step if necessary, otherwise it could easyly ruin your printer!
#if Z_MIN_PIN>-1 && MIN_HARDWARE_ENDSTOP_Z
   if((cur->dir & 68)==64) if(READ(Z_MIN_PIN) != ENDSTOP_Z_MIN_INVERTING) {cur->dir&=~64;}
#endif
#if Z_MAX_PIN>-1 && MAX_HARDWARE_ENDSTOP_Z
   if((cur->dir & 68)==68) if(READ(Z_MAX_PIN)!= ENDSTOP_Z_MAX_INVERTING) {cur->dir&=~64;}
#endif
  }

into

  // }  moved to end
   // Test Z-Axis every step if necessary, otherwise it could easyly ruin your printer!
#if Z_MIN_PIN>-1 && MIN_HARDWARE_ENDSTOP_Z
   if((cur->dir & 68)==64) if(READ(Z_MIN_PIN) != ENDSTOP_Z_MIN_INVERTING) {cur->dir&=~64;}
#endif
#if Z_MAX_PIN>-1 && MAX_HARDWARE_ENDSTOP_Z
   if((cur->dir & 68)==68) if(READ(Z_MAX_PIN)!= ENDSTOP_Z_MAX_INVERTING) {cur->dir&=~64;}
#endif
  } }

and set
#define ALWAYS_CHECK_ENDSTOPS false

to ignore endstops if not homing.


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