Re-ARM Ramps Dual Endstop Firmware

I recently built a Dual Endstop MPCNC and it has been working great (using Ramps V1.4). I recently bought a laser etcher and figured out how to control it with PWM from pin 44 (M106 P1 S255, etc.). However when trying to raster grayscale images (256 resolution) with the laser, it often slows down and the pwm control of the laser does not seem to be able to keep up. Most of the time, after I hit print on the LCD, the LCD does not go back to the status screen. I assume this is due to the processor using 100% of its time to control the laser.

Therefore, I looked into faster boards to run the MPCNC and laser. I found the Re-ARM 32 bit board. I bought one and am trying to install the MPCNC pre-configured dual-endstop firmware with PlatformIO (VSCode extension) on the Re-ARM. I successfully got a barebones Marlin 2.0 Bugfix config to load, but always get errors with the MPCNC configuration. I understand now that it is probably due to how the pins are reconfigured to allow for dual endstops. I was wondering if someone could show me all the files and code of the Marlin Firmware that need to be changed to work with the Re-ARM board as I know things were changed all over the place. (Or a list of all that was changed from stock to make it work for the standard Ramps v1.4 config). Or, better yet, if someone could just create a pre-configured version and make it available to everyone.

I appreciate all the help. Thanks!!

It’s really not all over the place. Just the pins file, and configuration_adv.h. There are a lot of other changes, but they are located in Configuration.h and Configuration_adv.h. The other changes are just due to the other software updates between versions.

In the pins file, the E0 is always the extruder, but since we never even enable it, the pins are just set to something that isn’t used (70 on the ramps board). Then E1 can be switched to use the E0 pins and it will end up as X2. Then we make a new E2 and set the pins to the E1 values, and that gets used for Y2. You need to find the pins file for your board and do that. At some point, setting the number of extruders to 0 will make this step go away, but that has been creating other bugs.

In the Configuration_adv.h, you also set Dual motors and dual endstops for x and y.

1 Like

Thanks for the reply jeffeb3. I used your advice and started from a base configuration and built it up and it was able to compile finally. However, the Re-ARM uses a single SPI bus for the LCD and SD (a known issue documented on reprap.) I’m not sure if this is the problem or something else, but when setting the SD card to use the one attached to the LCD Full Graphics Smart Controller, I can’t access any of the media. The LCD indicates when media is inserted or removed, but the menu always shows “No Media”. No Init Media or Refresh are accessible from the menu like normal. Any idea what could be causing this? I tried changing pins for the E0 Extruder, but it did not affect this. Everything else is working (Moving all axises, homing all axises with dual endstops, etc.)

 

 

pins_RAMPS_RE_ARM.h (16 KB)

That’s great! Nice work.

I don’t know what’s wrong with the sd card. It might be something other than the spi issue. That sounds like it manifests in some garbage on the screen, not sdcard issues. I don’t use mine, but there was some rule about putting a folder on it, or putting at least one file outside a folder or something… Maybe someone else can chime in. I think it needs to be formatted FAT32.

So I solved the SD card issue. I switched the Re-ARM out with the Mega and the SD card was still not working. Then I realized that I had also added longer ribbon cable to the LCD when I added the Re-ARM, so I switched them back to the shorter cables and they work fine. I tried to isolate one of the cables, but they didn’t make any difference. I tested continuity of the longer cables and they were about 0.7 ohms compared with 0.5 ohms. Also, I verified, the pinouts of the connectors were the same, so I’m not sure what the issue was.

Now however I am having another major problem. My laser module requires a pwm input to drive it, which was working fine with the Mega. I was able to reassign one of the servo outputs to a fan1 output in the same manner, but the frequency is only 50hz, not nearly enough to get a smooth laser output (Mega is 490Hz). I then enabled fast_pwm_fan in the configuration file. It increased the frequency to 200Hz, but it is a very noisy signal and not very square at all. It won’t even drive the laser module lower than about 80% duty cycle. Let me know if you have any insight as to how to get a clean, fast pwm output from the Re-ARM.

Thanks