Welcome! Log In Create A New Profile

Advanced

Trouble swapping Z endstop for an inductive sensor due to internal pullup

Posted by gonadgranny 
Trouble swapping Z endstop for an inductive sensor due to internal pullup
July 19, 2016 11:39AM
Hi there.
I am trying to set up auto bed levelling by replacing my Z-min endstop with an inductive sensor. I am having trouble because the sensor outputs high when activated. I have tested the output of the pin which the old endstop was connected to and it is high when the endstop switch is open and low when closed.
I have tried altering my marlin settings so that the z endstop pullup is disabled but this doesnt change anything.
Does anyone understand what I might be doing wrong here?
Thanks in advance for any possible reply's,
Danny
Re: Trouble swapping Z endstop for an inductive sensor due to internal pullup
July 19, 2016 12:05PM
Edit your configuration.h file and change the following line to true or false depending what it's currently set to.

const bool Z_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
Re: Trouble swapping Z endstop for an inductive sensor due to internal pullup
July 19, 2016 12:08PM
Invert the endstop. Find Z_MIN_ENDSTOP_INVERTING and change it to the opposite.
Re: Trouble swapping Z endstop for an inductive sensor due to internal pullup
July 20, 2016 07:59AM
I have tried changing marlin settings as you suggested but the endstop pin is always high. this makes my inductive sensor which outputs 5 volts useless at the moment.
ive tried to understand how my current mechanical switch works and i believe that when it is tripped it connects the output to ground through a resistor subsequently bringing its voltage down to zero which i assume marlin reads as becoming active. ive tried recreating this setup myself by connecting the output through a 10k resistor to ground and the voltage dropped to about 3 so will continue experimenting.
of course even if i recreate the switch myself i still dont know how i will translate this for use with the inductive sensor.
it seems like this should be easy with some firmware changes but as i said i have so far been unsuccessful. nothing has brought the endstop pin down to zero volts as would be expected with an input pin.
Please forgive my electronics ignorance here i am entirely self taught and the concepts are still not completely familiar to me. any help would again be much appreciated,
Danny
Re: Trouble swapping Z endstop for an inductive sensor due to internal pullup
July 20, 2016 09:05AM
Is it a PNP sensor? It sounds like it.

Try commenting out the internal pullup resistors:

  //#define ENDSTOPPULLUP_ZMIN
  //#define ENDSTOPPULLUP_ZMIN_PROBE
Re: Trouble swapping Z endstop for an inductive sensor due to internal pullup
July 20, 2016 09:59AM
I have already tried commenting out these lines and in fact any line which mentions "endstoppullup" to try and disable it but nothing has worked, always reads 4.6v. My current plan (unless someone can suggest something easier) is to recreate the switch using a pulldown resistor and switch using a transistor with its base connected to my inductive sensor. its a lot longer than commenting out code but so far i have no other options...
Re: Trouble swapping Z endstop for an inductive sensor due to internal pullup
July 20, 2016 10:42AM
So when bench testing the sensor with a small load on the signal lead, what voltage does it give open and triggered? Power it with 12v initially. Then repeat with 5v some sensors will run on 5v, meaning the signal will be 5 not 12v saving hassle of voltage divider/regulator/relay.

If you've tried all 4 combinations of pullups on/off and logic true/false either the sensor is duff or something much stranger is going on.

Self taught, sensor problem troubleshooter here.

Edited 4 time(s). Last edit at 07/20/2016 10:45AM by DjDemonD.


Simon Khoury

Co-founder of [www.precisionpiezo.co.uk] Accurate, repeatable, versatile Z-Probes
Published:Inventions
Re: Trouble swapping Z endstop for an inductive sensor due to internal pullup
July 20, 2016 11:36AM
The inductive sensor is doing its job fine. its giving me 0v when open and 5v(therabouts) when triggered. i used resistors to reduce it from the initial 12v logic state. The problem i am having is that my printer printers motherboard defaults to having the endstop pins in a pulled high state and i think it must be wired in because ive tried turning them off in the software and it doesnt change anything.
So in order to trip the switch i need to pull it back down to ground. this is what my mechanical switch does i believe. so i am going to try connecting my inductive sensor to a transistor which is in turn connected to ground through a resistor. i believe this will recreate the circumstances which the current mechanical switch uses but incorporating my inductive sensor. just a lot more messing about than i originally thought but hey, learnt some new stuff on the way. will let you know if it works. thanks for the help all.
Danny
Re: Trouble swapping Z endstop for an inductive sensor due to internal pullup
July 20, 2016 11:38AM
Maybe you can change the pins.h file and use a different pin for z min endstop?


Simon Khoury

Co-founder of [www.precisionpiezo.co.uk] Accurate, repeatable, versatile Z-Probes
Published:Inventions
Re: Trouble swapping Z endstop for an inductive sensor due to internal pullup
July 20, 2016 11:55AM
Are you using a RAMPS V1.4 chinese clone? I ask because I have two RAMPS V1.4 boards, one was a cheap chinese board for $8 that says Robotale on the side of it the other was roughly $45 that has all the details of the RAMPS board in the silk screen.

My chinese knockoff $8 board has some different wiring / traces that I've noticed. For example, all the normal pins underneath the stepper drivers are shorted together which means I don't even need to attach the jumpers which also means I can't take this board out of the settings that have 3 jumpers. I bring this up, as if your using a chinese knockoff RAMPS board, there may be internal traces at play that are interfering with the pullup resistor settings in Marlin that leaves them in place no matter what you specify in the firmware. If this is the case, like DjDemonD suggested, choosing a different pin might be your fix.

Edited 1 time(s). Last edit at 07/20/2016 11:56AM by PDBeal.
Re: Trouble swapping Z endstop for an inductive sensor due to internal pullup
July 20, 2016 12:38PM
Those ramps boards fixed on 1/16th can be fixed by cutting the traces between the stepper jumpers.


Simon Khoury

Co-founder of [www.precisionpiezo.co.uk] Accurate, repeatable, versatile Z-Probes
Published:Inventions
Re: Trouble swapping Z endstop for an inductive sensor due to internal pullup
July 20, 2016 12:43PM
I am indeed using a cheap Chinese board. this one. I have lots of free auxillary pins and have tested them with the multimeter and they are on 0v. Could I use one of these instead? Could I set this up in the pins.h file?
Thanks,
Danny
Re: Trouble swapping Z endstop for an inductive sensor due to internal pullup
July 20, 2016 12:59PM
Quote
DjDemonD
Those ramps boards fixed on 1/16th can be fixed by cutting the traces between the stepper jumpers.

Unless those traces are underneath the physical jumper pins, I didn't see any connection between the pins anywhere else on the board. And if those are jumper-ed together, who knows what else doesn't work exactly right.

Ah, ha, I see the traces are underneath the jumper pins on this post.

Edited 2 time(s). Last edit at 07/20/2016 01:02PM by PDBeal.
Re: Trouble swapping Z endstop for an inductive sensor due to internal pullup
July 20, 2016 01:32PM
Quote
gonadgranny
I am indeed using a cheap Chinese board. this one. I have lots of free auxillary pins and have tested them with the multimeter and they are on 0v. Could I use one of these instead? Could I set this up in the pins.h file?
Thanks,
Danny

Yes find a pin you want to use you'll have to look up the numbering. In pins.h depending on marlin version you'll find define z_min_pin enter the new one, recompile, upload.

Edited 2 time(s). Last edit at 07/20/2016 01:33PM by DjDemonD.


Simon Khoury

Co-founder of [www.precisionpiezo.co.uk] Accurate, repeatable, versatile Z-Probes
Published:Inventions
Re: Trouble swapping Z endstop for an inductive sensor due to internal pullup
July 20, 2016 02:16PM
Quote
PDBeal
Ah, ha, I see the traces are underneath the jumper pins on this post.

Love the idea of burning the traces with a Lipo battery that's right up my street. *looks for Lipo battery with evil glint in the eye*

It's obviously just an oversight as the board I have has all the header pins and fancy multicoloured jumpers installed that do nothing!

Edited 2 time(s). Last edit at 07/20/2016 03:02PM by DjDemonD.


Simon Khoury

Co-founder of [www.precisionpiezo.co.uk] Accurate, repeatable, versatile Z-Probes
Published:Inventions
Re: Trouble swapping Z endstop for an inductive sensor due to internal pullup
July 21, 2016 08:01AM
Thanks for all the help folks! On the advice of DjDemonD i changed the pin number of my z-endstop to one of my free auxiliary ones and it works! Now to try and calibrate it...
Danny

For the record i found which pins to change using the schematic found here and I also changed the pin number in the pin_RAMPS_14.h file as opposed to the pins.h file.
Re: Trouble swapping Z endstop for an inductive sensor due to internal pullup
July 21, 2016 09:14AM
Yeah the marlin 1.1.x RC versions have sensibly broken down the pins file into individual boards. But glad it worked.


Simon Khoury

Co-founder of [www.precisionpiezo.co.uk] Accurate, repeatable, versatile Z-Probes
Published:Inventions
Sorry, only registered users may post in this forum.

Click here to login