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.23k stars 19.22k forks source link

Marlin Re-ARM detecting but not reading LCD SD card #19137

Closed Power3DPrinting closed 4 years ago

Power3DPrinting commented 4 years ago

Bug Description

I am upgrading some old 3D printers with Re-ARM and the reprap discount smart controller LCD will detect but not read files saved to the SD card. Basically, the machine will home and move but I cannot give it gcode because everything but the LCD is inside the printer's case.

My Configurations

Configuration.zip

Steps to Reproduce

Marlin 2.0.6

  1. I followed chris's basement guide for wiring a reprap discount smart controller with Re-ARM: https://www.youtube.com/watch?v=-dChi2CR7Vc
  2. I broke out the 5V lead from the ribbon connector on EXP1 to the 5V pin on J12 of the Re-ARM board
  3. I broke out pins 6,7,8 as shown in the video to the Re-ARM board as shown
  4. I enabled SD support and reprap_discount_smart_controller in configuration.h
  5. I changed SDCARD_CONNECTION ONBOARD to SDCARD_CONNECTION LCD in Configuration_adv.h
  6. I inserted a 16GB Fat32 sd card with a file named CT.gcode and it would detect a sd card had been inserted but I could not find file CT
  7. I renamed the file as .g, .txt, and .nc with the same result
  8. I tried formatting exFAT and NTFS but they would not be detected and caused the text to scramble
  9. I need help, three printers with Re-ARM, same problem

Expected behavior: [What you expect to happen] select gcode from sd card inserted into lcd sd slot

Actual behavior: [What actually happens] no gcode is shown in sd card

Additional Information

I am using RAMPS 1.6 and it was working before with RAMPS 1.5/1.6 with Arduino Mega 2560 and A4988 steppers. I recently went 24V so Re-ARM was an easier choice to not have to mod the RAMPS shield for the higher voltage to the Arduino. I also changed three of the steppers to some leftover TMC2130 V1.0 from Fysetc on each of the three printers and basically they had a jumper bridged on them forcing standalone mode and I don't have the tools to remove it so I started moving the pins up for SPI connection but ultimately left them disconnected for standalone mode (TMC connection error, rip). They appear to be moving okay in standalone mode when controlled from the LCD.

This has been one long drawn out project to mod some broken Cetus MkII's for my school lab this summer. They worked with the A4988 at 12V but the steppers had 10 times the inductance of normal Nema 17 steppers (not exaggerating) which at 12V would essentially lock the printer into 200 step rotations and salmon skinning was almost as disgusting as the noise. That's why I stepped up to 24V and I had these TMC2130's leftover from a project years ago when I was a stupid scrooge so I figured I may as well get rid of them on these printers. I honestly thought Re-ARM was a drop in replacement and even bought original Re-ARM boards years ago. Now that I have been working on them for a couple weeks, I am running out of hair to pull. At least this will help save my hair cutting bills.

https://github.com/MarlinFirmware/Marlin/issues/12436 configuration changes

https://reprap.org/forum/read.php?146,238858 SD card and file formatting

http://panucattdevices.freshdesk.com/support/solutions/articles/1000242059-support-files Re-ARM Pinout

boelle commented 4 years ago

Same with bugfix-2.0.x branch ?

Power3DPrinting commented 4 years ago

Same with bugfix-2.0.x branch ?

I haven't given a try to the bugfix version but if you think it is worth a try I will write up a new configuration.

boelle commented 4 years ago

its the most updated branch that get fixes at least once or twice each day

you can use a tool like winmerge to copy over old settings

Power3DPrinting commented 4 years ago

Thanks, I'll go do that!

Power3DPrinting commented 4 years ago

its the most updated branch that get fixes at least once or twice each day

you can use a tool like winmerge to copy over old settings

It was very similar to 2.0.6 so it made it easy to transpose the configs but I didn't get any different result from the sd card reader. Nothing shows up in the menu :(

Power3DPrinting commented 4 years ago

I am losing track of the trouble shooting I am doing if I don't write it down.

I tried SPI_SPEED SPI_HALF_SPEED, SPI_QUARTER_SPEED, and SPI_EIGHTH_SPEED on each of my three machines, will not read from SD card

I tried a combination of 250000 baudrate and SD_CHECK_AND_RETRY, 115200 baudrate and SD_CHECK_AND_RETRY, and 115200 baudrate and //SD_CHECK_AND_RETRY. will not read from SD card

I tried a couple more SD cards with no difference

I have repeatedly homed successfully with each new firmware so the TMC2130's in standalone with their SPI pins: SDI, SCK, CS, and SDO pins facing upwards appears to be fine

I also tried moving the EXP1 5V pin from J12 to J3 with no difference so power draw seems fine

My best guess is that I did something wrong with the LCD adapter wiring to J12 such as another part of the LCD not getting 5V or 3.3V or the pins_RAMPS_RE_ARM.h have some mismatched pins and whatever I jumped from pins farthest from the AUX3 part of the LCD adapter from left to right pins 4,5,6 to J12 pins P1_10, P1_14, P1_17 respectively were either not enough, one of them are acting interference, or another is coming into conflict with SPI connection to the LCD.

I need sleep zzzzzzzz

Power3DPrinting commented 4 years ago

All of this below is from pins_RAMPS_RE_ARM.h

define LCD_BACKLIGHT_PIN P0_16 //(16) J3-7 & AUX-4 - only used on DOGLCD controllers

#define LCD_PINS_ENABLE                P0_18  // (51) (MOSI) J3-10 & AUX-3
#define LCD_PINS_D4                    P0_15  // (52) (SCK)  J3-9 & AUX-3
#if ENABLED(ULTIPANEL)
  #define LCD_PINS_D5                  P1_17  // (71) ENET_MDIO
  #define LCD_PINS_D6                  P1_14  // (73) ENET_RX_ER
  #define LCD_PINS_D7                  P1_10  // (75) ENET_RXD1
#endif

endif

I was checking pins_RAMPS_RE_ARM.h and rewatching chris's guide and realized LCD pins 5,6,and 7 going to P1_10, P1_14, P1_17 do not match with his video. In his video he says pins 6,7,8 go to P1_10, P1_14, P1_17. I am not sure if this is a naming discrepancy that happened over time or the source of error.

/**

I do not know what DOGLCD_A0, DOGLCD_CS, LCD_PINS_D5, LCD_PINS_D6 or LCD_PINS_D7 are but at the moment I only have maybe three of these five pins jumped from the LCD adapter to the Re-ARM board and I am not sure if I should worry about missing DOGLCD pins for the smart discount controller or if they are already connected.

//#define SCK_PIN P0_15 // (52) system defined J3-9 & AUX-3 //#define MISO_PIN P0_17 // (50) system defined J3-10 & AUX-3 //#define MOSI_PIN P0_18 // (51) system defined J3-10 & AUX-3 //#define SS_PIN P1_23 // (53) system defined J3-5 & AUX-3 (Sometimes called SDSS)

As shown there are four lcd pin things and I only have three of them wired on the LCD adapter. These are commented out and not functional but I am just not sure if there is some wiring I am missing or the pins have been shifted.

Power3DPrinting commented 4 years ago

I tried adding this to the smart discount controller in configuration.h, the text seems a bit more stable now but did not help with SD card reading.

// // RepRapDiscount Smart Controller. // https://reprap.org/wiki/RepRapDiscount_Smart_Controller // // Note: Usually sold with a white PCB. //

define REPRAP_DISCOUNT_SMART_CONTROLLER

define ST7920_DELAY_1 DELAY_NS(0)

define ST7920_DELAY_2 DELAY_NS(250)

define ST7920_DELAY_2 DELAY_NS(250)

I am currently running one of my machines tethered to my computer, it is returning an SD Init Fail and now it firmly says there is "no media" with the sd card inserted when trying to access the sd card. Running from USB is a little simpler uploading firmware but I really don't have any clue what else to do but try almost randomly turning settings on and off without result.

for now I tried turning on and off SD_CHECK_AND_RETRY without success, I also turned off EEPROM_AUTO_INIT without success getting the printer to read from the SD card.

Power3DPrinting commented 4 years ago

I have finally gotten SPI working with the TMC2130's and I was moving onto auto fan cooling the TMC drivers because they get hot and all I had spare are some 5V fans. I found out that all of the servo pins are protected from M42 and this got me thinking maybe there is a protected pin list somewhere that is interfering with SD card reading. I don't know where this might be because there isn't anything labeled as protected in pin_RAMPS_RE_ARM.h. help???

Power3DPrinting commented 4 years ago

define E0_AUTO_FAN_PIN P1_18

servo 3 pin D4 is not working with my 5V 0.1A 40mm fan and Re-ARM but did work with the Arduino Mega 2560 when called with M42 P4 S254.

I tried returning E0_AUTO_FAN_PIN to -1 and issuing M42 P4 S254 and M42 P1_18 S254 but could not get the fan to spin up.

Not sure how to disable protected pins because there isn't any array listed as such. I have a good guess these protected pins are also protecting the pins to the SD card reader and is why the reader will not work.

I figured out the pin is protected because I am trying to power the fan on USB power, it will try and spin up when the Re-ARM Jumper is in INT mode.

Power3DPrinting commented 4 years ago

2020-08-26 11_59_52- Bugfix 2 0 x  rearm and RepRapDiscount Smart Controller · Issue #11927 · Marlin

https://github.com/MarlinFirmware/Marlin/issues/11927

I found this similar thread and I can narrow down the issue is EXP1 related with a pin from D4 or RS from the LCD adapter to J3 on the Re-ARM being a potential missing link for SD card communication. As seen, I have D5, D6, D7, and 5V wired correctly, I can also confirm the encoder and beep pins are functional. I am guessing the EN/Enable pin and GND/ground are functional so that leaves me to wondering how D4 or RS are connected and if pins_RAMPS_RE_ARM.h match them.

Oddly, D4 is a servo pin, I have no idea what is going on here

AnHardt commented 4 years ago

...because there isn't any array listed as such...

bool pin_is_protected(const pin_t pin) {
  static const pin_t sensitive_pins[] PROGMEM = SENSITIVE_PINS;
  LOOP_L_N(i, COUNT(sensitive_pins)) {
    pin_t sensitive_pin;
    memcpy_P(&sensitive_pin, &sensitive_pins[i], sizeof(pin_t));
    if (pin == sensitive_pin) return true;
  }
  return false;
}

Then search for SENSITIVE_PINS and maybe for HAL_SENSITIVE_PINS

Power3DPrinting commented 4 years ago

Thanks for the reply!!!

What folder/page is that in? I couldn't find it in a ctrl+f search of config, config_adv, and pins_RAMPS_RE_ARM.h.

Just another update on troubleshooting, I just tried using a full graphic display (I don't have enough for all my printers) but it appears the SD card reader is working with it but now I am getting a TMC connection error and only the A4988 controlled Z-motor will move. So there is maybe hope that I don't have to run these printers tethered to my computer and things like the LCD SD cards and case fan can work, just not sure why not with the 2004 display :|

Power3DPrinting commented 4 years ago

I have no idea what happened, I tried rolling back to the discount smart controller and the TMC connection error persists meaning something got shorted or damaged... great... I'll have to see if I can get things working on this machine again but I will have to move to another machine

Power3DPrinting commented 4 years ago

Great news! All three of my printers and nine TMC2130's cause TMC CONNECTION ERR which means my resoldering and wiring checks mean I have done all that I can to the physical system and Marlin is frankly janked after my edits to get the full graphic LCD working.

I am going to try and start stripping features out of my config until things working I guess starting with turning off power loss recovery and eeprom even though they were working before. This is great. Here I was thinking I needed to buy new hardware but now I just have to bill myself 100 hrs trying to diagnose this Marlin fishy business.

Power3DPrinting commented 4 years ago

Going back through the connections of the TMC2130's, some of the double wire dupont female pins needed to be tightened with some needle nose pliers or re-crimped altogether to fit in their plastic dupont holders. I also found 4 of 10 drivers were not working so I pooled the 6 working drivers into two machines and got them working with the Full Graphic LCD. I will refresh the solder of the non-functional TMC2130's to see if I can get enough for the third printer and I modeled a new mount for the Full Graphic Display. Not a clue how to get the RepRap Discount Smart Controller working, I browsed through pins_RAMPS_RE_ARM.h and saw some of the same LCD jumped pins were defined for TMC2130 CS pins but I am really short on time to test and reupload new firmware to see if it will finally let me read from the LCD SD reader.

github-actions[bot] commented 4 years ago

This issue has had no activity in the last 30 days. Please add a reply if you want to keep this issue active, otherwise it will be automatically closed within 7 days.

github-actions[bot] commented 3 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.