NPN sensor problem
-
@phaedrux said in NPN sensor problem:
M122
M122 === Diagnostics === RepRapFirmware for Duet 2 WiFi/Ethernet version 3.3 (2021-06-15 21:44:54) running on Duet WiFi 1.02 or later Board ID: 0JD0M-9P6M2-NWNS4-7J9DL-3SN6Q-TT2ZK Used output buffers: 3 of 24 (11 max) === RTOS === Static ram: 23876 Dynamic ram: 75028 of which 24 recycled Never used RAM 15488, free system stack 184 words Tasks: NETWORK(ready,13.4%,231) HEAT(delaying,0.0%,314) Move(notifyWait,0.1%,364) MAIN(running,86.2%,443) IDLE(ready,0.3%,29), total 100.0% Owned mutexes: WiFi(NETWORK) === Platform === Last reset 00:05:12 ago, cause: power up Last software reset at 2021-08-26 17:54, reason: User, GCodes spinning, available RAM 15488, slot 2 Software reset code 0x0003 HFSR 0x00000000 CFSR 0x00000000 ICSR 0x0041f000 BFAR 0xe000ed38 SP 0x00000000 Task MAIN Freestk 0 n/a Error status: 0x00 Step timer max interval 0 MCU temperature: min 12.6, current 20.6, max 21.0 Supply voltage: min 24.2, current 24.3, max 24.5, under voltage events: 0, over voltage events: 0, power good: yes Heap OK, handles allocated/used 0/0, heap memory allocated/used/recyclable 0/0/0, gc cycles 0 Driver 0: position 0, standstill, SG min/max not available Driver 1: position 0, standstill, SG min/max not available Driver 2: position 0, standstill, SG min/max not available Driver 3: position 0, standstill, SG min/max not available Driver 4: position 0, standstill, SG min/max not available Driver 5: position 0 Driver 6: position 0 Driver 7: position 0 Driver 8: position 0 Driver 9: position 0 Driver 10: position 0 Driver 11: position 0 Date/time: 2021-08-27 16:46:06 Cache data hit count 4294967295 Slowest loop: 2.88ms; fastest: 0.17ms I2C nak errors 0, send timeouts 0, receive timeouts 0, finishTimeouts 0, resets 0 === Storage === Free file entries: 10 SD card 0 detected, interface speed: 20.0MBytes/sec SD card longest read time 2.6ms, write time 0.0ms, max retries 0 === Move === DMs created 83, maxWait 0ms, bed compensation in use: none, comp offset 0.000 === MainDDARing === Scheduled moves 0, completed moves 0, hiccups 0, stepErrors 0, LaErrors 0, Underruns [0, 0, 0], CDDA state -1 === AuxDDARing === Scheduled moves 0, completed moves 0, hiccups 0, stepErrors 0, LaErrors 0, Underruns [0, 0, 0], CDDA state -1 === Heat === Bed heaters = 0 -1 -1 -1, chamberHeaters = -1 -1 -1 -1 === GCodes === Segments left: 0 Movement lock held by null HTTP is idle in state(s) 0 Telnet is idle in state(s) 0 File is idle in state(s) 0 USB is idle in state(s) 0 Aux is idle in state(s) 0 Trigger is idle in state(s) 0 Queue is idle in state(s) 0 LCD is idle in state(s) 0 Daemon is idle in state(s) 0 Autopause is idle in state(s) 0 Code queue is empty. === Network === Slowest loop: 15.79ms; fastest: 0.00ms Responder states: HTTP(0) HTTP(0) HTTP(0) HTTP(0) FTP(0) Telnet(0), 0 sessions HTTP sessions: 1 of 8 - WiFi - Network state is active WiFi module is connected to access point Failed messages: pending 0, notready 0, noresp 0 WiFi firmware version 1.23 WiFi MAC address e8:db:84:92:3c:57 WiFi Vcc 3.40, reset reason Turned on by main processor WiFi flash size 4194304, free heap 24456 WiFi IP address 192.168.1.112 WiFi signal strength -66dBm, mode none, reconnections 0, sleep mode modem Clock register ffffffff Socket states: 0 4 0 0 0 0 0 0
M98 P"config.g" HTTP is enabled on port 80 FTP is disabled TELNET is disabled Driver assignments: X0 Y1 Z2:4 E3, 3 axes visible Warning: Macro file config-override.g not found
-
@tecno said in NPN sensor problem:
M558 P5 C"^!zprobe.in" H5 F120 T6000
M119
Endstops - X: not stopped, Y: not stopped, Z: at min stop, Z probe: at min stop -
@petr-k said in NPN sensor problem:
@tecno said in NPN sensor problem:
M558 P5 C"^!zprobe.in" H5 F120 T6000
M119
Endstops - X: not stopped, Y: not stopped, Z: at min stop, Z probe: at min stopWell if the sensor was not actually triggered remove the ! character from the M558 and test again.
Frederick
-
@petr-k if it's definitely a NPN NO sensor, then this command should work:
M558 P5 C"^!zprobe.in" H5 F120 T6000
unless the senor has high leakage current. If that's the case then you might need to add a pullup resistor (e.g. 10K) between the sensor output and +3.3V or +5V. But I've not heard of this happening before.
Are you certain that it isn't a PNP output sensor?
-
@dc42 This is writes on sensor LJ20A3-10-Z/BX. Ok I will try pull-up, thanks.
-
@dc42 pullup did nothing
-
@fcwilt said in NPN sensor problem:
M558 P5 C"^!zprobe.in" H5 F120 T6000
Z probe value 1000, when triggered value is 0
-
@petr-k said in NPN sensor problem:
@fcwilt said in NPN sensor problem:
M558 P5 C"^!zprobe.in" H5 F120 T6000
Z probe value 1000, when triggered value is 0
Was that with the ! character or without?
Frederick
-
-
@petr-k said in NPN sensor problem:
Well then it should work with the ! unless the the output voltage of the sensor simply isn't meeting the logic levels needed of the input.
What is the forward voltage drop of that diode?
Did you try it without the diode?
As I recall the logic 0 voltage level for the input is appx 0.8 volts. It's possible the combination of the drop across the NPN transistor in the sensor and the diode fails to meet that logic 0 level.
Frederick
-
@fcwilt I try it without diode too, but it was the same, nothing changed.
-
@petr-k said in NPN sensor problem:
@fcwilt I try it without diode too, but it was the same, nothing changed.
Do you have a way to measure the voltage at the input to the board to verify the low (sensor triggered) and high (sensor not triggered) voltage levels
Frederick
-
@petr-k said in NPN sensor problem:
M584 M584 X0 Y1 Z2:4 E3 ; set drive mapping
You have M584 twice on that line.
-
-
@petr-k if you have a multimeter then as @fcwilt suggested, you should measure the voltage between the IN pin and GND pins of the Z Probe connector. You should get:
- With the sensor not connected: nearly 3.3V (and DWC should report the Z probe reading as 0). If you don't read 3.3V then most likely your M558 command is wrong.
- With the sensor connected but not triggered: same (except that if the sensor includes a pullup resistor, you may get a higher voltage than 3.3V)
- With the sensor connected and triggered: about 0.2V if you don't use the diode, or 0.5V if you do.
Edit: in your photo it looks as though you may be using 2 diodes connected in series.
-
sensor connected, not triggered - 3.0V
sensor connected, triggered - 0V
sensor disconnected, not triggered - 0V
sensor disconnected, triggered - 1,5 VAll with diode.
My soldering looks like a second diode
-
G31 X35 Y-4 Z0 P500 was the problem, I had two parameters P (P0 and P500), now works great
-
@petr-k And Pā 0