Jump to content

Strange behavior of GCode M140 @ UMO ??


drayson

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???

 

  • 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:

     

  • 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 !!

     

  • 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.

     

  • 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...

  • Link to post
    Share on other sites

    Posted · Strange behavior of GCode M140 @ UMO ??

    Yes, those are 5V pins and can't sink/source a lot of current so you will need some kind of high capacity drive like a MOSFET / transistor depending on what you are driving like http://www.instructables.com/id/Connecting-a-12V-Relay-to-Arduino/

     

  • 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...

     

  • Link to post
    Share on other sites

    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now
    • Our picks

      • UltiMaker Cura 5.7 stable released
        Cura 5.7 is here and it brings a handy new workflow improvement when using Thingiverse and Cura together, as well as additional capabilities for Method series printers, and a powerful way of sharing print settings using new printer-agnostic project files! Read on to find out about all of these improvements and more. 
         
          • Like
        • 18 replies
      • S-Line Firmware 8.3.0 was released Nov. 20th on the "Latest" firmware branch.
        (Sorry, was out of office when this released)

        This update is for...
        All UltiMaker S series  
        New features
         
        Temperature status. During print preparation, the temperatures of the print cores and build plate will be shown on the display. This gives a better indication of the progress and remaining wait time. Save log files in paused state. It is now possible to save the printer's log files to USB if the currently active print job is paused. Previously, the Dump logs to USB option was only enabled if the printer was in idle state. Confirm print removal via Digital Factory. If the printer is connected to the Digital Factory, it is now possible to confirm the removal of a previous print job via the Digital Factory interface. This is useful in situations where the build plate is clear, but the operator forgot to select Confirm removal on the printer’s display. Visit this page for more information about this feature.
          • Like
        • 0 replies
    ×
    ×
    • Create New...