Welcome! Log In Create A New Profile

Advanced

Duet 0.8.5 NPN or PNP Prox Sensor?

Posted by critical_limit 
Duet 0.8.5 NPN or PNP Prox Sensor?
November 17, 2015 05:00AM
Hi all,

I can´t find the thread where somebody said that NPN Prox. Sensors can directly connected to the Duet.

Maybe someone can help me out.
How to connect a NPN to the Endstop connectors of the Duet 0.8.5? Or was it PNP??? Can´t remember, but someone did it without any other electronics.
Outer pins are used for a normal switch. Is the inner pin 12V (24V) ? Maybe somebody can explain how to connect.

thanx
Dirk

Edited 1 time(s). Last edit at 11/18/2015 09:28AM by critical_limit.
Re: Duet 0.8.5 NPN or PNP Prox Sensor?
December 13, 2015 05:13PM
Hey, did you find an answer to that ? I personally went on and just plugged everything in. Nothing burned, but the logic is reverted (With G31, I get 1023 when not triggered and 0 when triggered).

I tried Z Probe type 1, 2 and 3 (type 4 maybe ? did not figure how to wire that one).

I wired Brown and Blue to 12v and black to the pin used by the IR sensor.

Don't find any way to revert the logic, if you have any clue I'm interested!

EDIT: typo

Edited 1 time(s). Last edit at 12/13/2015 05:14PM by Korri.
Re: Duet 0.8.5 NPN or PNP Prox Sensor?
December 13, 2015 07:11PM
I think the best way would be to wire the ground and output connections of an NPN sensor to the E0 endstop connector, and the 12V input to +12V. Select probe type 4 in the M558 command and use the M574 E0 S0 command to invert the polarity.



Large delta printer [miscsolutions.wordpress.com], Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].
Re: Duet 0.8.5 NPN or PNP Prox Sensor?
December 14, 2015 07:03PM
Quote
dc42
I think the best way would be to wire the ground and output connections of an NPN sensor to the E0 endstop connector, and the 12V input to +12V. Select probe type 4 in the M558 command and use the M574 E0 S0 command to invert the polarity.

Did just that, works like a charm, thanks !
Re: Duet 0.8.5 NPN or PNP Prox Sensor?
December 15, 2015 04:11AM
I'm glad it worked for you. One warning though: if the ground wire connection breaks, the sensor is likely to feed more than 3.3V into the output pin, which may damage the Duet.



Large delta printer [miscsolutions.wordpress.com], Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].
Re: Duet 0.8.5 NPN or PNP Prox Sensor?
December 22, 2015 10:11AM
I have a PNP inductive sensor that was working fine on my previous RAMPS 1.4. I've created a new voltage divider which is outputting 2.95V when triggered and connected it to the Duet 0.85 as shown on the diagram below. Whether it is triggered or not, the Z-Probe reading on the web interface just sits at 1000. The relevant lines from my config.g file are

; Z probe and compensation definition
;*** If you have an IR zprobe instead of a switch, change P4 to P1 in the following M558 command
M558 P4 X0 Y0 Z0					; Z probe is a switch and is not used for homing any axes
G31 X0 Y0 Z0.74 P500				; Set the zprobe height and threshold (put your own values here)

Do I need to invert the polarity with "M574 E0 S0" or is there something else wrong? Any help would be appreciated.



Re: Duet 0.8.5 NPN or PNP Prox Sensor?
December 22, 2015 04:00PM
I think the problem is that the endstop inputs each drive an LED and your voltage divider has too high a resistance to pull the voltage on the endstop input down far enough. My advice is to connect the output from the voltage divider to the analog Z probe input instead (pin AD12 on the dedicated Z probe connector of the Duet 0.8.5) and select probe type 1 in the M558 command instead of type 4.



Large delta printer [miscsolutions.wordpress.com], Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].
Re: Duet 0.8.5 NPN or PNP Prox Sensor?
December 23, 2015 04:00AM
Quote
dc42
I think the problem is that the endstop inputs each drive an LED and your voltage divider has too high a resistance to pull the voltage on the endstop input down far enough.

That is a definite possibility. That LED is much dimmer than the X,Y,Z end stops.

Quote

My advice is to connect the output from the voltage divider to the analog Z probe input instead (pin AD12 on the dedicated Z probe connector of the Duet 0.8.5) and select probe type 1 in the M558 command instead of type 4.

I did try that yesterday, although I still had the probe type set with P4. What was odd is that when I triggered the proximity sensor, the temperature readings took a dive. I will try setting it to P1 at lunchtime.
Re: Duet 0.8.5 NPN or PNP Prox Sensor?
December 23, 2015 10:18AM
Swapping on to the AD12 pin and setting as a type 1 has got it working and solved the temperature drop-out issue. I've run it through autocalibration multiple times now with success. Now I just need to work out why I can't get the first layer to stick, but that's nothing to do with the Duet.

For anyone with the same setup, here is the revised Wiring diagram. R1 = 47k ohm and R2 = 16k ohm


Thanks for your help David.

Edited 1 time(s). Last edit at 12/23/2015 10:36AM by gowen.
Re: Duet 0.8.5 NPN or PNP Prox Sensor?
January 27, 2016 10:46PM
Exactly the thread I was looking for. I have a PNP sensor so going to use this info to get it hooked up. Only problem was I didn't have 47k and 16k resistor. I created a voltage divider using a 2.7k and 1k resistor and I'm getting 3.2v on the output when hooked to a 12v source. Haven't tested to see what voltage it will be with the sensor, but it should be close.
Re: Duet 0.8.5 NPN or PNP Prox Sensor?
February 11, 2016 06:48AM
Thanks, this saved me a lot of trouble!

Just curious though, why run the second ground wire from the probe connector? Is that not the same ground as -12V ?
Re: Duet 0.8.5 NPN or PNP Prox Sensor?
February 11, 2016 08:57AM
It's belt and braces. I've had a few instances where there have been odd ground loops, so now I prefer to connect cables in pairs.

I haven't had a look at the PCB design to check if the copper has a direct connection between the two pins.
Re: Duet 0.8.5 NPN or PNP Prox Sensor?
February 12, 2016 04:29AM
Thanks! I guess what I do will depend on what wire I find in the shop.
Re: Duet 0.8.5 NPN or PNP Prox Sensor?
March 25, 2016 10:01PM
I have followed the instructions above using an NPN sensor for bed levelling. I can get the sensor to trigger manually when connected to the AD12 pin. However, the output signal is inverted with my sensor (same problem as Korri had originally). I get 3.5V of sensor voltage, when the output is high (sensor away from bed) and 0V when the sensor is low (in contact with bed). I used the following commands in the config.g in this order:

Firmware is 1.09r-dc42 (2016-01-16)

M574 X2 Y1 Z2 S1	; set endstop configuration (X microswitch at high end (active high), Y microswitch low end (active low), Z microswitch high end (active high)
M574 E0 S0		; set bed levelling endstop at low end (active low). LJ12A3-4-Z/BX
M558 P1 X0 Y0 Z0  ; Output from voltage divider (3.5V) connected to AD12
G31 Z1 P500           ; Set the probe height and threshold

Sending a G30 P0 Z-99999 returns this:
"Z probe warning: probe already triggered at start of probing move"
The sensor is clearly not triggered.

I verified that M574 E0 S0 is actually applied by sending M574, which returns:
"Endstop configuration: X high end (active high), Y low end (active high), Z high end (active high), E (active low)"

Only when the sensor is actually triggered, the Z axis will try to move and I don't get an error message.

This tells me that the M574 E0 S0 command that should invert the trigger logic did not actually do what I expected it to do: It did not invert the trigger logic at AD12.
Am I on the wrong track?

Cheers,
Peter

(edit: typo)

Edited 3 time(s). Last edit at 03/25/2016 10:05PM by peterl.
Re: Duet 0.8.5 NPN or PNP Prox Sensor?
March 26, 2016 11:21AM
To use M574 to invert the signal, you need to connect then sensor output to the E0 endstop input instead of AD12, and use M558 P4 instead of P1. You don't need a voltage divider with an NPN sensor, but I recommend connecting a 1N4148 or similar diode between the sensor output and E0 endstop input (cathode to sensor output), to protect the Duet in the event of a failed sensor ground connection.



Large delta printer [miscsolutions.wordpress.com], Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].
Re: Duet 0.8.5 NPN or PNP Prox Sensor?
March 26, 2016 07:57PM
Thank you for your fast response and the detailed advice!
That worked perfectly. Probe at E0 and M558 P4 must have been the only combination I hadn't tried. Murphy gets you every time.
I connected 12V and ground to the sensor and the sensor output to E0. The diode seems a good idea. I will add it.
Happy Easter.
Re: Duet 0.8.5 NPN or PNP Prox Sensor?
July 08, 2016 05:49PM
Deleted

I was being STUPID Sorry

Edited 1 time(s). Last edit at 07/08/2016 06:32PM by Calvinx66.
Re: Duet 0.8.5 NPN or PNP Prox Sensor?
July 08, 2016 07:09PM
Hi,

Im usinng a NPN sensor with 24V.
Do I need a voltage divider?
I tried to connect on z-probe connector and E0 endstop, with M558 P1 and P4. None worked

Thanks
Re: Duet 0.8.5 NPN or PNP Prox Sensor?
July 09, 2016 06:42AM
Quote
phcella
Hi,

Im usinng a NPN sensor with 24V.
Do I need a voltage divider?
I tried to connect on z-probe connector and E0 endstop, with M558 P1 and P4. None worked

Thanks

I answered a similar question on the Duret WiFi forum yesterday. This was my reply:

>>
According to [www.mikrocontroller.net] … Series.pdf the /BX ones are NPN output and the /BY are PNP output. So if it is a /BX type then instead of resistors, you should use a small signal Schottky diode, connected cathode to sensor output and anode to the STP pin on the E0 endstop connector. A silicon diode such as 1N4148 may work as well, but although that seems to work for some people, the last person I suggested it to found that it pulled the E0 STP pin low enough to light the LED on the Duet at less than full brightness, but not low enough for the Duet to recognise it as triggered.
<<

The person who posted the question replied that a 1N4148 diode did work for him.



Large delta printer [miscsolutions.wordpress.com], Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].
Re: Duet 0.8.5 NPN or PNP Prox Sensor?
July 09, 2016 10:52AM
Thank's David for your answer.. But can the duet support 24v while the sensor is not trigged?

Is the connection right?


Edited 1 time(s). Last edit at 07/09/2016 12:43PM by phcella.
Re: Duet 0.8.5 NPN or PNP Prox Sensor?
July 09, 2016 01:32PM
Yes, that connection is correct for an NPN sensor. What the NPN output does is to connect the STP endstop input to ground when the sensor is triggered. The diode is a precaution, to guard against feeding 24V into the pin if the ground wire on the sensor becomes disconnected.



Large delta printer [miscsolutions.wordpress.com], Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].
Sorry, only registered users may post in this forum.

Click here to login