Remap Pin D9 to Pin 44 for Laser PWM

I received my mini Rambo last night. Thanks for getting this to me so quickly! Nice board.

I flashed the code with the following modifications:

#define Z_MIN_PIN 23 //10

#define Z_MAX_PIN -1 //23

#define FAN_PIN 10 //8

Question: when I measure the voltages at both +/- for z min and z max I am seeing +5VDC. Should I see the +5VDC go away on the Z Max due to the -1 pin assignment? Also I am still not getting any control over the laser with varying the fan parameters. Is there a parameter I need to adjust that I have missed?

1 Like

The + pin is 5V and does not change. The pin should be referring to referring to the Signal pin.

Ā 

You test from signal to negative, If you touch that + pin there is a 99% chance of destroying your board. Use the utmost care.

Thanks for all your help. the signal was the secret sauce to get it to work. I dug out my O-Scope and sure enough I had PWM. The next trick was to wire the laser properly. There were no instructions with it, only pictures. Grrr.

So when the pins are remapped for the PWM, do I use straight up M106/M107 for fan on and of or the M108 or M113 for the extruder fan?

Ā 

Wellā€¦ I got it to the point where I can control the laser via the display-> fan1 setting. this is a fantastic start

Butā€¦ I can not control it with software. 3dpBurner, 3dpBurner Sender and repetier host are all a fail. I have even tried running GCode directly from the SD card. Nothing. I can only assume that I am using the wrong GCode for the mapping.

Any ideas anybody? I am using the Mini Rambo with my PWM on the z_MIN

Ā 

Does my focusing test script work?

I donā€™t know what that is

Ā 

Link to the code in the description, from the info, how-to page, https://www.youtube.com/watch?v=yUk8ttJmpz4

1 Like

Thanks Ryan! Your Script worked really well. I manipulated the power intensities and was able to get really good results. At this point I can run gcode from the SD card and control the laser. Now I just need to figure out why I canā€™t control the laser from a computer and software.

Ā 

The laser script uses M106 S255 to turn the laser to full power. Then M107 to turn it off. Can you send these commands via the console in repetier?

Also, Ryanā€™s script adjusts speeds, but sets the laser to full power (255). You will still need to verify that you can adjust the power with different values M106 S200, for example.

I have tried sending commands with both repetier host and 3dpBurner Sender and nothing. I am using the 106 cmds.

Ā 

Okay at least we have a reference point now with my code.

It only works with a S255? If you can change my code to different intensities we are making progress if not the pin is not PWM capable and we need to find a better pin. I have not verified that pin it was another user and the two pin shuffle has me worried.

Unfortunately I am out for the day (sometimes I do take a day off). I do have my laser out and can do some testing this evening if yā€™all havenā€™t solved this by then.

Something isnā€™t making sense. Can you send this exactly:

M106 S255

And tell us what it does?

Just to make sure you are sending things right, can you move it with a G01 X10 ?

Running it from the SD card and GCode files I created works fine.

When I attempt M106 S255 from within Repetier Host with easy Mode turned off it does nothing.

Likewise if I use 3dpBurner Sender it does nothing. With it connected to the com port and hitting the laser on, off, power level or even custom code like M106 S255 it does nothing.

Sounds like you are not actually connected. Can you move it from repetier? The button being green doesnā€™t actually indicate a connection for some reason, What temp is show for the hotend?

is this not the sames as gerbil 1.1 and only turn the laser on while in motion?

I have found a solution to the original problem, so I thought I would share it with anyone else trying to Remap pin D9 to Pin 44.

The solution is not elegant but worked.

Short Answer

Solution: I added the following line of code right before the #endif // CONFIGURATION_H at to the end of the Marlin Configuration.h tab in Arduino IDE:

//Change FAN PIN to 44
#define RAMPS_D9_PIN 44 //Was 9

Long Answer

I tried to change this in the pins_RAMPS.h file, but as was mentioned in this thread it did not seem to work.

I enabled #define PINS_DEBUGGING in Configuration_adv.h and checked the pin mapping with M43 to find out if anything changed. Each time I found pin 44 mapped to E_MUX2_PIN and 1 other pin, but not the FAN. I tried commenting these pins out in the pins_RAMPS.h file but each time they showed that they were still mapped to Pin 44.

After adding the #define RAMPS_D9_PIN 44to Configuration.h I found the FAN mapped to pin 44 with M43.

After hooking the TTL input of the laser to GND and Pin 44 the laser functioned as expected.

Hope this can help someone else.

1 Like

Hi Travis or anyone

Just to check one thing.

Did you make any other adjustments to the Marlin firmware? Say pins_RAMPS_h ?

At the end of Confiduration.h I have

#endif

#endif //CONFIGURATION_H

Do I add your code between the two #endif or before the first?

Ā 

kindest regards for your assistance

Ā 

regards

Ā 

regards

Hello all,

This is the first time posting. Iā€™ve been reading the forums for awhile now and have had some luck.

My setup is a MPCNC running on a Rambo V1.4 board with dual end stops. Its approximately 900 X 900 mm. I have it set up with a Dewalt 660 and a laser. Iā€™m actually on my second laser. I had the first laser working with PWM with out any problems other then not enough power. For some reason when I changed lasers I lost control of the laser.

By back tracking and troubleshooting I was able to get control of the PWM back but without the Dual End Stops. When I load the Dual End Stop it stops working.

If i Load "MPCNC813FullRAmbo_GLCD_T8 "and modify the pins_RAMPS.h on line 156 as described in this thread it works from both the LCD controller using FAN2 speed and through Repeater Host.

When I load the Dual End Stop program ā€œMarlin-MPCNC_Rambo_T8_16T_LCD_DualEndstopā€ it stops working.

With the pins_debug enabled this is the results that I get for the working and not working

15:50:19.237: PIN: 44 Port: L5 FAN1_PIN protected ---- Working

16:02:02.791: PIN: 44 Port: L5 RAMPS_D9_PIN Input = 0 TIMER5C PWM: 0 WGM: 1 COM5C: 0 CS: 3 TCCR5A: 1 TCCR5B: 3 TIMSK5: 0 ---- Not Working

Ā 

Any help is appreciated.

I found a solution to my issue and maybe others that use RAMBo V1.4.

RAMBo V1.4 has a connector that is labeled X32 PWM Extension. It is located between the main chip and fan/heater connectors. It is 6 pin straight. One of the pins on this connector is FAN-2. This is the line prior to it going to the mosfet and is 5 volt TTl PWM capable.

[attachment file=ā€œX34 Header.jpgā€]

[attachment file=ā€œPWM Extension.jpgā€]

As shown pin 1 is on the left.

Pin 1 is 5 VDC

Pin 2 is GND

Pin 4 is FAN-2

I connected pin 2 to TTL/PWM- of the laser control module and pin 4 to TTl/PWM +.

Ā 

To turn the laser on I use M106 P2 Sxxx and to turn it off M106 P2 S0 or M107 P2.

P2 specifies which fan to control. P2 is FAN-2.

Ā