MarlinFirmware / Marlin

Marlin is an optimized firmware for RepRap 3D printers based on the Arduino platform. Many commercial 3D printers come with Marlin installed. Check with your vendor if you need source code for your specific machine.
https://marlinfw.org
GNU General Public License v3.0
16.28k stars 19.24k forks source link

BLTouch not responding to M280 commands - Pin assignments incorrect? #6756

Closed SpeedGP closed 6 years ago

SpeedGP commented 7 years ago

Hello, I've been struggling with this for about a week now and am out of ideas. The main issue is when the printer is turned on, the BLTouch goes through the self test, but that's it (it will go into alarm mode if I hold the pin). It will not respond to "Reset BLTouch" through the LCD, or any of the M280 The main difference between my setup is I have a Fan Extender using pins D11 and D6, so I've moved the Servo0 pin to pin D0. I've also tried D1, and/or changing the Servo0 to Servo1-3 with no success either. Just to clarify, the command I am currently using is M280 P0 S10 (or S90).

I've enabled #define BLTouch and set NUM_SERVOS 3, Z_ENDSTOP_SERVO_NR 0, set the servo pins

ifdef IS_RAMPS_13

define SERVO0_PIN 7 // RAMPS_13 // Will conflict with BTN_EN2 on LCD_I2C_VIKI

else

define SERVO0_PIN 1

endif

define SERVO1_PIN 0

define SERVO2_PIN 5

define SERVO3_PIN 4

Set fan pins (Fan 6 works perfect)

ifndef FAN_PIN

define FAN_PIN 6 // IO pin. Buffer needed

endif

(I don't have Controller fan setup currently, for some reason pin 11 is set to high all of the time, or my Fan Extender board is half burnt out)

define CONTROLLERFAN_PIN -1 //Pin used for the fan to cool controller (-1 to disable)

define CONTROLLERFAN_SECS 60 //How many seconds, after all motors were disabled, the fan should run

define CONTROLLERFAN_SPEED 255 // == full speed

ifndef FAN_PIN

define FAN_PIN -1

endif

ifndef FAN1_PIN

define FAN1_PIN -1

endif

ifndef FAN2_PIN

define FAN2_PIN -1

endif

ifndef CONTROLLERFAN_PIN

define CONTROLLERFAN_PIN -1

endif

My setup is a Prusa i3 Steel with a Ramps 1.4 EEB (board 44) running 1.1.0 RC8 12-6-2016. It is a genuine BLTouch Classic from Antclabs. And like I said before, Pin D11 seems to be set high, I'm not sure if this has something to do with the BLTouch or not. I assume I am changing all of the right config and pin assignments.

Please let me know if there is anything I can try or anything I've done blatantly wrong. I am waiting until someone asks to upload full config.h and config_adv.h

Thank you very much,

James

Roxy-3D commented 7 years ago

Have you tried just turning on #define BLTOUCH option Configuration.h ? It should default everything to reasonable values for a RAMPS board. You just plug in the wires to Servo-0 and with that option enabled, the 'Right' things should happen.

And I know for a fact bugfix_v1.1.0 has much better BL-Touch support than what is in an early December release.

Bob-the-Kuhn commented 7 years ago

Even worse than uploading the config files - I also want the pins_RAMPS.h file. Please ZIP the three files and drop it on your reply.

I tried following your defines. I ended up with SERVO0 on pin 1 and pin 11 as unused.

SpeedGP commented 7 years ago

I had a feeling that was coming :)

Yes, 11 should be unused, that's one of the most confusing things... but not that big of an issue at this point.

I've changed those few items so many times, I may have written them backwards, but just as long as I can get pin D0 or D1 as the signal wire for the BLTouch, I'll be super happy!

configs.zip

SpeedGP commented 7 years ago

This is a COMPLETE shot in the dark, but could pins.h "sensitive_pins" be causing the issue?

define SENSITIVE_PINS { 0, 1, \

X_STEP_PIN, X_DIR_PIN, X_ENABLE_PIN, X_MIN_PIN, X_MAX_PIN, \
Y_STEP_PIN, Y_DIR_PIN, Y_ENABLE_PIN, Y_MIN_PIN, Y_MAX_PIN, \
Z_STEP_PIN, Z_DIR_PIN, Z_ENABLE_PIN, Z_MIN_PIN, Z_MAX_PIN, Z_MIN_PROBE_PIN, \
PS_ON_PIN, HEATER_BED_PIN, FAN_PIN, FAN1_PIN, FAN2_PIN, CONTROLLERFAN_PIN, \
_E0_PINS _E1_PINS _E2_PINS _E3_PINS _E4_PINS BED_PINS \
_H0_PINS _H1_PINS _H2_PINS _H3_PINS _H4_PINS \
_X2_PINS _Y2_PINS _Z2_PINS \
X_MS1_PIN, X_MS2_PIN, Y_MS1_PIN, Y_MS2_PIN, Z_MS1_PIN, Z_MS2_PIN \

}

Bob-the-Kuhn commented 7 years ago

You have SERVO0 connected to pin 1.

The BLTouch signal should be attached to the Z_MIN endstop.

Bob-the-Kuhn commented 7 years ago

You also need to set Z_MIN_ENDSTOP_INVERTING to "false".

Here's a write up on testing a BLTouch.

Testing a BLTouch with serial number:

  1. Connect BLTouch, power up controller and upload the firmware
  2. Blue LED will be ON if a servo signal is present. Blue LED is faint.
  3. M119 ; should return OPEN. If not check that the BLTouch is enabled in the configuration. If enabled then check wiring and check that the correct pin is being used.
  4. M280 P0 S10 ; should deploy the probe and the orange LED will be OFF.
  5. M119 ; should return OPEN
  6. M280 P0 S90 ; should stow the probe and the orange LED will be ON
  7. M280 P0 S60 ; puts it into the M119 test mode.
  8. The probe should remain stowed and the blue LED should be OFF. If it's ON then the unit needs to be adjusted.
  9. M119 ; should return TRIGGERED
  10. M280 P0 S160 ; returns it to normal operation
  11. M119 ; should return OPEN.
SpeedGP commented 7 years ago

Maybe I'm using the wrong terminology. The three wires that are supposed to be connected to pin D11, 5v and Gnd, I'm referring to pin D11 as 'signal'. The issue is I already have something taking up all 4 "servo" connections, so I'd like to use "aux 1", ie 5v, gnd, D1 (or D0) for the BLTouch.

And you are right, right this second in the config, I have D1 setup, and I've tested this pin too, but it does not seem to change anything.

SpeedGP commented 7 years ago

Trying inverting now, one sec

Bob-the-Kuhn commented 7 years ago

Are the four items already attached to the servo connectors actually using servo signals?

Bob-the-Kuhn commented 7 years ago

The three pin connector should go to gnd, +5V and D1.

The two pin connector should go to gnd & Z_MIN.

SpeedGP commented 7 years ago

The three pin connector looks correct, the two pin connector looks correct. I just changed and uploaded "z_min_endstop_inverting" to false, then I ran M119 while the probe was up, it registered Open, then I pulled it down manually, and it still registered open.

Something is seriously messed up here... What do you suggest? Download the latest re-enter everything from scratch?

Only two of the 'servo' pins are used, the other two are just blocked by the 4x3 dupont connector

Bob-the-Kuhn commented 7 years ago

The BLTouch normally issues a single 5mS pulse when it is triggered. M119 won't see that. M119 should always say open for the BLTouch.

Please provide a picture of how the 3 pin connector attaches to the board.

I'd also like you to fill this out for the BLTouch: Brown wire - pin ?? on the RAMPs board Red wire - pin ?? on the RAMPs board Orange wire - pin ?? on the RAMPs board White wire - pin ?? on the RAMPs board Black wire - pin ?? on the RAMPs board

SpeedGP commented 7 years ago

I just left for work. I will follow up on this a little later tonight.

For the record, thank you for your help. I do truly appreciate it.

James

-James--

On Tue, May 16, 2017 at 11:27 AM, Bob-the-Kuhn notifications@github.com wrote:

The BLTouch normally issues a single 5mS pulse when it is triggered. M119 won't see that. M119 should always say open for the BLTouch.

Please provide a picture of how the 3 pin connector attaches to the board.

I'd also like you to fill this out for the BLTouch: Brown wire - pin ?? on the RAMPs board Red wire - pin ?? on the RAMPs board Orange wire - pin ?? on the RAMPs board White wire - pin ?? on the RAMPs board Black wire - pin ?? on the RAMPs board

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/MarlinFirmware/Marlin/issues/6756#issuecomment-301872590, or mute the thread https://github.com/notifications/unsubscribe-auth/ALPvIN-a4auM98Qack5QG0III0svAHSRks5r6eqXgaJpZM4NcsrD .

SpeedGP commented 7 years ago

Ok,

I have some extensions connected, green and black goes to the two-pin white and black, and the Red Black Blue connects to the brown red orange.

Brown wire - pin gnd aux1 on the RAMPs board Red wire - pin 5v aux1 on the RAMPs board Orange wire - pin D1 aux1 on the RAMPs board White wire - pin z-min signal on the RAMPs board Black wire - pin z-min gnd on the RAMPs board

img_20170516_184629 img_20170516_184730 img_20170516_184803 img_20170516_184955

It looks like there is a test mode I should play with, but I haven't read into it yet.

James

Bob-the-Kuhn commented 7 years ago

You won't be able to get into the test mode until we can deploy & stow the probe.

As best I can tell it's wired up correctly.

+5 & ground have to be correct otherwise the orange light wouldn't be on and the pin wouldn't extend & retract on power up.

It's hard to tell from the picture but it looks like the servo signal is going to the D1 pin on AUX1. ramps 1 4 pinout

Is the blue LED on? It's much dimmer than the orange LED. It's on the bottom end of the PCB on the right side. You need to be looking for it to see it.

I'm leaning toward a bad connection.

arduino-mega-pinout-diagram

SpeedGP commented 7 years ago

Will do, thanks!

Quick random question, num_servos, it says it starts with 0, so if you had two physical servos, would you type 2, or 1? Also, z_servo_nr (or whatever it is called) should reflect the index, so 0 or 1, correct?

On May 16, 2017 8:46 PM, "Bob-the-Kuhn" notifications@github.com wrote:

You won't be able to get into the test mode until we can deploy & stow the probe.

As best I can tell it's wired up correctly.

+5 & ground have to be correct otherwise the orange light wouldn't be on and the pin wouldn't extend & retract on power up.

It's hard to tell from the picture but it looks like the servo signal is going to the D1 pin on AUX1. [image: ramps 1 4 pinout] https://cloud.githubusercontent.com/assets/20692583/26137220/739b4ff2-3a86-11e7-9a14-949f1397e220.png

Is the blue LED on? It's much dimmer than the orange LED. It's on the bottom end of the PCB on the right side. You need to be looking for it to see it.

I'm leaning toward a bad connection.

  • Issue a M280 P0 S120 and then wiggle the connectors and mate/unmate them a few times. The pin will start cycling if you find the magic connection.
  • Please check continuity from the blue D1 connector pin to the solder connection on the BLTouch.
  • Remove & reseat the RAMPs board onto the Arduino Mega (yes, again). Make sure there's no space between the mating connectors.
  • Check continuity between the D1 input to the RAMPs board and the D1 pin on the AUX1 connector
  • Really long shot - move the blue wire to A3/D57 or A4/D58

[image: arduino-mega-pinout-diagram] https://cloud.githubusercontent.com/assets/20692583/26137690/712fc380-3a89-11e7-9050-1afd71fa10da.png

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/MarlinFirmware/Marlin/issues/6756#issuecomment-301977455, or mute the thread https://github.com/notifications/unsubscribe-auth/ALPvIADZ3Oywgk25ik810vpipzACj0Szks5r6m2ngaJpZM4NcsrD .

Roxy-3D commented 7 years ago

so if you had two physical servos, would you type 2, or 1?

If you had two... You have servo 0 and servo 1

SpeedGP commented 7 years ago

But servo_num would be 2?

On May 16, 2017 9:06 PM, "Roxy-3D" notifications@github.com wrote:

so if you had two physical servos, would you type 2, or 1?

If you had two... You have servo 0 and servo 1

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/MarlinFirmware/Marlin/issues/6756#issuecomment-301979781, or mute the thread https://github.com/notifications/unsubscribe-auth/ALPvIIvausBLxmX0qlOoDegsh5pJyyK1ks5r6nJKgaJpZM4NcsrD .

SpeedGP commented 7 years ago

Your longshot worked! It is currently using Pin D57/A3 and the blue light came on! I am able to use the M280 commands, and complete a bed level. You rock!!!!

One more tiny thing, this has been happening randomly the past 24 hours, do you think it is the USB cable or possibly BAUD speed?

[image: Inline image 1]

-James--

On Tue, May 16, 2017 at 9:07 PM, James Hilferty james.hilferty@gmail.com wrote:

But servo_num would be 2?

On May 16, 2017 9:06 PM, "Roxy-3D" notifications@github.com wrote:

so if you had two physical servos, would you type 2, or 1?

If you had two... You have servo 0 and servo 1

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/MarlinFirmware/Marlin/issues/6756#issuecomment-301979781, or mute the thread https://github.com/notifications/unsubscribe-auth/ALPvIIvausBLxmX0qlOoDegsh5pJyyK1ks5r6nJKgaJpZM4NcsrD .

Bob-the-Kuhn commented 7 years ago

I'm really happy that it's working. Wish I knew why D0 and D1 won't work.

Your image got thrown away somewhere in the ethers. Please post it directly in this forum rather than as an email attachment.

I'm guessing you're getting random drops/faults in your prints. USB com issues can be the cause. I always print from the SD card because I have USB issues from my laptop. My laptop will go to sleep in the middle of a print!

SpeedGP commented 7 years ago

Actually no, it's just during connection. I use to have it drop out in the middle, but fixed it after getting a shorter, shielded cable with ferrite at both ends. I've been printing constantly from OctoPi for about a year now with zero issues.

This is in regards to the initial connection, sometimes it works fine, sometimes it hangs at connecting and displays this. I was assuming speed mismatch or noise on the line.

image

PS. The fan extender is still running pin 11 high (or so it seems). I'll be looking into this later in the week, but it's not super high on my priority list.

Seriously you rock! I'm an IT guy, I'm happy to send you some troubleshooting thoughts on your laptop :)

Bob-the-Kuhn commented 7 years ago

You can use the M43 I command to see what the controller thinks pin 11 is doing. This command will print out a list of all the pins, the signals/functions attached to them, if its an input, output or PWM and the current state/value.

To enable this command go to the end of Configuration_adv.h and enable PINS_DEBUGGING.


I have no idea why it sometimes hooks up immediately and sometimes doesn't.

SpeedGP commented 7 years ago

Thanks! I'll give it a try!

for your laptop, first thing would be to look through power options in control panel, there is an advanced section, look through hibernate, sleep, turn hard disks off after, etc. the other place to look is in device manager, you'll probably looking for your usb controller, right click, go to power management tab, uncheck "allow this device to turn off to save power".

You're welcome to close this ticket. thank you so much! (Unless you would like to see results from M43)

On May 17, 2017 7:46 AM, "Bob-the-Kuhn" notifications@github.com wrote:

You can use the M43 I command to see what the controller thinks pin 11 is doing. This command will print out a list of all the pins, the signals/functions attached to them, if its an input, output or PWM and the current state/value.

To enable this command go to the end of Configuration_adv.h and enable PINS_DEBUGGING.

I have no idea why it sometimes hooks up immediately and sometimes doesn't.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/MarlinFirmware/Marlin/issues/6756#issuecomment-302113736, or mute the thread https://github.com/notifications/unsubscribe-auth/ALPvIEEOVEHDNEVbAblxSiwuyz4SktYBks5r6wgugaJpZM4NcsrD .

oksakoor commented 7 years ago

When i power on 3D Printer, then Bl Touch do selftest (moving pin up and down) But after that cant move pin up or down and dont respond at all.

Roxy-3D commented 7 years ago

I forget... But I think the BL-Touch moves the pin when it gets power. If that is true... it is not being told by the firmware to move the pin. It needs to be connected to a Servo connector. Probably Servo-0

oksakoor commented 7 years ago

You suggest activate this?

//#define Z_ENDSTOP_SERVO_NR 0 // Defaults to SERVO 0 connector. //#define Z_SERVO_ANGLES {70,0} // Z Servo Deploy and Stow angles

Roxy-3D commented 7 years ago

If you have the #define BLTOUCH enabled, it should automatically set up those values. But Yes... Those do need to be defined.

oksakoor commented 7 years ago

When i was installing Bl Touch i enabled those

define BLTOUCH

define NUM_SERVOS 1

Roxy-3D commented 7 years ago

That looks correct. And the BL-Touch cable should be plugged into the Servo-0 connector.

oksakoor commented 7 years ago

I plugged like this pictures shows. Is that Servo-0 connector? servo

Roxy-3D commented 7 years ago

Yes. That looks correct. But you would be much better off giving it 5 volts from a separate power supply. I don't think that is the problem you are fighting right now.

SpeedGP commented 7 years ago

Have you tried M280 P0 S90 or M280 P0 S10

oksakoor commented 7 years ago

I tried both codes and in lcd menu "BL Touch"- pin doesn't move

SpeedGP commented 7 years ago

https://www.google.com/url?sa=t&source=web&rct=j&url=https://3dator.com/wp-content/uploads/2016/04/AnthonyQuayle003.pdf&ved=0ahUKEwiLrMnkkP_TAhUS_mMKHVeWCl8QFggcMAA&usg=AFQjCNExLmy_geyECm2szqWBOGE6KKwELQ&sig2=jqjv88hrgejRbtqtIWgh9A

On May 20, 2017 11:40 AM, "Roxy-3D" notifications@github.com wrote:

Yes. That looks correct. But you would be much better off giving it 5 volts from a separate power supply. I don't think that is the problem you are fighting right now.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/MarlinFirmware/Marlin/issues/6756#issuecomment-302891115, or mute the thread https://github.com/notifications/unsubscribe-auth/ALPvICYcleEKTyVuqefw8czg6yNYVEWIks5r7zOpgaJpZM4NcsrD .

oksakoor commented 7 years ago

I read this, but with Marlin 1.1.1 i need only enable those?

define BLTOUCH

define NUM_SERVOS 1

SpeedGP commented 7 years ago

id look through that pdf and make sure your config is right https://www.google.com/url?sa=t&source=web&rct=j&url=https://3dator.com/wp-content/uploads/2016/04/AnthonyQuayle003.pdf&ved=0ahUKEwiLrMnkkP_TAhUS_mMKHVeWCl8QFggcMAA&usg=AFQjCNExLmy_geyECm2szqWBOGE6KKwELQ&sig2=jqjv88hrgejRbtqtIWgh9A

On May 20, 2017 11:46 AM, "oksakoor" notifications@github.com wrote:

I tried both codes and in lcd menu "BL Touch"- pin doesn't move

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/MarlinFirmware/Marlin/issues/6756#issuecomment-302891409, or mute the thread https://github.com/notifications/unsubscribe-auth/ALPvIB3hNwwsEotXlG9OnXiKcS9B7_0_ks5r7zT-gaJpZM4NcsrD .

github-actions[bot] commented 2 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.