<p>I am trying to control a laser with the fan (D9) and ran into problems.
So I tried P44, no good then P6 also not good.\
What my problem is I am trying to "burn" a group of vertical lines spaced about 0.75" apart, and randomly the drive to the laser power supply is either "skipping" (missing the control pulse) or stretching the pulse.
This results in missed burns and/or "streaks" where the laser does not turn off.
I am using Marlin 1.1.4 on a RAMPS 1.4 board (clone) on an Arduino close also.
When I am not printing, the pulses are perfect and I can control the pulse width with M42 P6(or 44) S0 (to 255) and it follows just fine.
It is ONLY while I am printing and the steppers are moving that things go south.
This also occurs on D9 (fan) and that is why I am trying these other outputs.
These other outputs use different timers in the 2560 as well.
I have tried all sorts and combinations of firmware settings, different USB cable and different USB ports on my computer, with no change.
What might I be missing?</p>

[{'answer_id': 4373, 'author': 'markshancock', 'author_id': 6417, 'author_profile': 'https://3dprinting.stackexchange.com/users/6417', 'pm_score': 2, 'selected': False, 'text': '<p><strong>Have you checked the supply voltage?</strong>  With everything turned on (steppers stepping, laser on, etc) you may be pulling too much current and the supply voltage is drooping.  </p>\n\n<p>Use DVM to measure the DC voltage.  Also you will need to check for supply ripple. \nFor that, either an oscilloscope or use DVM set for AC voltage.</p>\n'}, {'answer_id': 4384, 'author': 'Greenonline', 'author_id': 4762, 'author_profile': 'https://3dprinting.stackexchange.com/users/4762', 'pm_score': 0, 'selected': False, 'text': '<p>This is a stab in the dark but maybe the Arduino (clone or genuine) and RAMPS1.4 combination is not powerful enough to handle the calculations required to control the laser and printing simultaneously (although I can\'t really see why the additional processing to control a laser would be over taxing the processor. However your comment about slowing the printing seems to help alleviate the issue, does back up the hypothesis). I have read that the ATmega256, and lesser AVR microcontrollers, can be working at its limits, when controlling a 3D printer and having to deal with arcs, or something that requires complex calculations. </p>\n\n<p>Some printer control boards, such as the Smoothie, use different processors (ARM?) in order to supersede these issues. From <a href="http://hackaday.com/2013/09/06/3d-printering-electronics-boards/" rel="nofollow noreferrer">3D Printering: Electronics boards</a>. </p>\n\n<blockquote>\n  <p>The above boards use AVR microcontrollers. While they work for what they’re intended to do, there are a few limitations. Arcs and circles are a little weird to program, and using these boards for something other than a cartesian 3D printer – a CNC machine, or a laser cutter, for example – is a bit out of the ordinary. The Smoothie board\xa0is the solution to these problems.</p>\n</blockquote>\n\n<p>So, if you have discounted power issues, it could be due to computing power and it <em>may</em> be worth considering using a different, more powerful, controller?</p>\n'}, {'answer_id': 4393, 'author': 'Tom van der Zanden', 'author_id': 26, 'author_profile': 'https://3dprinting.stackexchange.com/users/26', 'pm_score': 1, 'selected': False, 'text': '<p>You should insert <code>M400</code> commands before each and every <code>M42</code> command. The reason is that <code>M42</code> skip the normal command queue. Each <code>M42</code> command is processed as soon as it is read, and may be executed well before the G-code (moves) preceding it have actually been executed. Inserting <code>M400</code> before <code>M42</code> will ensure that the printer finishes all moves before <code>M42</code> changes the pin state.</p>\n\n<p>The long "streaks" you\'re seeing correspond to the printer processing a laser-on command too early, and the missed pulses correspond to processing a laser-off command too early.</p>\n'}, {'answer_id': 4409, 'author': 'Pomonaill220', 'author_id': 7752, 'author_profile': 'https://3dprinting.stackexchange.com/users/7752', 'pm_score': 3, 'selected': False, 'text': '<p>Thank you all for your suggestions and help.</p>\n\n<p>It appears that I was just running the printer too fast and slowing it down to about 10% of my original speed "fixed" my problem.\nI don\'t know where i got the rediculous speed from, but 1200 mm/min is WAY too fast.\nMore like 150 to maybe 200 mm/min is what it should have been.</p>\n\n<p>Oh well.. comes under the heading "pay attention" I guess!</p>\n'}]
['https://3dprinting.stackexchange.com/questions/4368', 'https://3dprinting.stackexchange.com', 'https://3dprinting.stackexchange.com/users/7752/']