Jump to content
Sign in to follow this  
drayson

Strange behavior of GCode M140 @ UMO ??

Recommended Posts

Posted · Strange behavior of GCode M140 @ UMO ??

It seems that M140 has no effect on my UMO...

The display does not show any temperature set nor any clicking of my relais using the M140 command.

I´ll try to use this commands for switching on/off a laser attachement via M140 S100 and M140 S0.

Here is a code snip for a 100x100mm square that I generated via an modified postprocessor for testing purposes:

;HEADER

G21 ;metric values

G90 ;absolute positioning

G28 X0 Y0 ;move X/Y to min endstops

G28 Z0 ;move Z to min endstops

M106 ;heatsink assistance - fan ON

;RAPID MOVE

M104 S0 ;laser off

G0 X49.960 Y49.960 Z8.000

;Plunge Move

M140 S0 ;laser off

G1 Z1.000

;FIRST_FEED_MOVE

M140 S100 ;laser on

G1 Y150.040

;FEED_MOVE

G1 X150.040

;FEED_MOVE

G1 Y49.960

;FEED_MOVE

G1 X49.960

;Plunge Move

M140 S0 ;laser off

G1 Z0.000

;FIRST_FEED_MOVE

M140 S100 ;laser on

G1 Y150.040

;FEED_MOVE

G1 X150.040

;FEED_MOVE

G1 Y49.960

;FEED_MOVE

G1 X49.960

;Retract Move

M140 S0 ;laser off

G1 Z8.000

;FOOTER

M140 S0 ;laser off

;FOOTER

M140 S0 ;laser off

G91 ;relative positioning

G1 Z+5 X-20 Y-20 ;move Z up a bit aside

G28 X0 Y0 ;move X/Y to min endstops, so the head is out of the way

G90 ;absolute positioning

G0 Z80 ;move platform down

M107 ;heatsing assistance - fan OFF

M84 ;steppers off

Does anybody have an idea??

Any hints/advices???

 

Share this post


Link to post
Share on other sites
Posted · Strange behavior of GCode M140 @ UMO ??

I think you are using the heated bed circuitry. Did you also install heated bed firmware?

Share this post


Link to post
Share on other sites
Posted · Strange behavior of GCode M140 @ UMO ??

Japp, sure, I place a switch in my heated bed wiring to change between heated bed and laser depending on the task.

Nevertheless, it seems that M140 has no effect...

I think, I should see at least the temperature change at the display.

Did a further trial today but honestly, my knowledge ends rapidly... :sad:

 

Share this post


Link to post
Share on other sites
Posted · Strange behavior of GCode M140 @ UMO ??

Ok, today I made a new attempt - soldered a few LEDs to the UMO to see what happens...

It seems that the M140 command switches the HB with a delay of a few seconds and that´s too slow for controlling the a laser on/off.

Don´t know why...

Next trial was to set a Pause between the M140´s and there at least the Ulticontroller acted as expected - again, the output was too slow to follow...

So, seems that good advice is absolutely needed... but unfortunately something rare...

Any hints appreciated !!

 

Share this post


Link to post
Share on other sites
Posted · Strange behavior of GCode M140 @ UMO ??

Strange that it does that. If I were you, I would look at using one of the unused I/O pins and manipulate it via M42

Just know that some pins are "protected". Typically, they are the ones in use.

 

Share this post


Link to post
Share on other sites
Posted · Strange behavior of GCode M140 @ UMO ??

That might be worth trying... But afaik this is only a 5V supply and I thought connecting my laser directly at 19V...

Pin13 should be easy to use. I'll try...

Share this post


Link to post
Share on other sites
Posted · Strange behavior of GCode M140 @ UMO ??

HAHAAAAA.... it was so simple but took a loooooot of time figure it out.

Finally I tried it with the unused Pin10 and the M42 command as anon recommended - but also nothing happened....

After a lot of research and trial&error (mostly error) I found out that M42 commands are not buffered (ref to https://github.com/ErikZalm/Marlin/issues/666), therefore it seems that nothing happens when switching on/off - but it happens, just too fast.

Solution: place an M400 "wait for the buffer to clear" before the M42 and Marlin will first perform all the remaining steps in the buffer and then move forward to perform the M42...

Tadaa... swiching my dummy led on and off the right time for "cutting"...

Unfortunately it does not work with M140, but with M42.

NOTE: Workarroud without any warranty - but it seems to work...

Thought it might be helpfull for somebody else...

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Our picks

    • Ultimaker Cura 4.0 | Stable available!
      Ultimaker Cura 4.0 is mainly focused on the improved user interface and cloud integration.
      As always, we want to collect your user feedback for this release. If there are any improvements you can think of, feel free to mention it here and help us to shape the next release.
      • 98 replies
×
×
  • Create New...

Important Information

Welcome to the Ultimaker Community of 3D printing experts. Visit the following links to read more about our Terms of Use or our Privacy Policy. Thank you!