I am adding a laser to my MPCNC with Arduino Mega 2560 with Ramps 1.4. To do this I am attempting to remap D9 fan to pin 44 (pin 7 of Aux2) for PWM control of the laser. I was running Marlin 1.0.1 and read that this had bugs in it. I have since updated to Marlin 1.1.8 which is supposed to be the latest and greatest. It is compiling and loading OK but my D9 is still active and pin 44 seems to be sitting around 2 VDC all the time regardless of what I have the fan set to.
Any tips on how to fix this? Is there a better pin for me to map to?
I don’t think he changed anything other than the one line “#define RAMPS_D9_PIN” Not sure exactly which version of Marlin he was working in, but it worked for me in the suggested version in the software download section here and on the new dual endstop version. Are you using the download from this site? Made other changes to the code? Maybe re-download Marlin and start fresh?
Grasping at straws, but my setup uses the full graphic controller and I had to install the library for it, but I doubt that would have anything to do with this.
#ifndef RAMPS_D9_PIN
#define RAMPS_D9_PIN 44 //remapped 9 to 44
#endif
That might not be active, if someone has set RAMPS_D9_PIN somewhere else. You can put in a message, to see if it’s being compiled:
#ifndef RAMPS_D9_PIN
#define RAMPS_D9_PIN 44 //remapped 9 to 44
#error Good news everyone the code is reaching this location
#endif
If you don’t see that error message when compiling, then it’s being set somewhere else. It doesn’t have to be that exact sentence, but it does have to be a futurama reference.
I’m looking closer at this fan code, and I’m not sure I like it at all. I think there might be a bug in it (said every software engineer about every piece of code, ever).
What about just setting the laser with M42?
M42 P44 S255
M42 P44 S0
You should be able to put that in your CAM software or gcode tools to control the laser instead, right? Is there something I don’t understand about the magic of the fan pin?
Some Old Guy Coding did that, but per his re-wiring video, M42 is an immediate command and would turn on the laser before it reached its intended start point, M106 and M107 are buffered so the on/off can happen in its intended locations.
Thanks everybody. I tried everybody’s suggestions to no avail. I went ahead and ordered a new ramps board and will try again when I get it. I can only assume at this point that that part of my board is bad.
Grettings, I have purchased 2 new Arduino/Ramps board combos since my last post, one had a defective Arduino and the other setups smoked when I applied power so they were non starters.
I brought home and O-Scope from work and found that on my original setup there is no PWM on either the D9 Pin or the remapped pin 44 which explains whey I can’t drive the laser. Its still possible that something is wrong with the Ramps board.
Question: Is there any other setups that I should worry about to enable PWM?
Question: Is there another hardware combo other than the Arduino/Ramps that I could use to drive the MPCNC with a laser?
Thanks Ryan. Pleas excuse my questioning, I have been messing with for a month and am fairly frustrated. With the mini Rambo 1.3, what LCD’s does it support? Can I still use the same LCD I used on my Ramps wish SD support?
Do you have a version of firmware already setup for Laser TTL PWM? Instructions for wiring?
Understandable, Imagine that times a few hundred boards / customers. Yes all the same LCD’s.
I don’t have a laser firmware for any board. The instructions should link to the mini-rambo edits. If they are not on linked on the laser page let me know and I can find them after shipping this evening.