Problem about M3 command

edited December 2017 in Repetier-Firmware

Hi, everyone. I am new to Repetier and 3D printing.
In recent days, I am building my 3D printer by using Arduino Mega2560 + Ramps 1.4 + laser source. All the setting and steps are easy except the problem of LASER PIN SIGNAL. Based on the configuration tool of Repetier Host, I set the LASER PIN as D9. After uploading the firmware and working for a while, I found that the laser was not working. Then I tried to use multimeter and oscilloscope to check the signal on D9, there had no signal. Also, M3 Command was used in Repetier Host, however, the result was the same.

================================================================================

/*Other tools may use M3 and M5 to enable/disable laser. Here G1/G2/G3 moves have laser enabled
and G0 moves have it disables.

In any case, laser only enables while moving. At the end of a move it gets
automatically disabled.
*/

#define SUPPORT_LASER 1
#define LASER_PIN ORIG_FAN_PIN
#define LASER_ON_HIGH 0 

=================================================================================
Could anyone give some help? Thanks

Comments

  • RAMPS has D9 for many functions like fan or second heater as well, so you probably have selected to have a fan so that will overwrite it.

    Are you sure your laser needs 12V from D9? My laser has power input plus a signal input (5V TTL) to tell if it should be enabled. Be careful with laser and use your special glasses and be close to reset/power at first tries.
  • Repetier said:
    RAMPS has D9 for many functions like fan or second heater as well, so you probably have selected to have a fan so that will overwrite it.

    Are you sure your laser needs 12V from D9? My laser has power input plus a signal input (5V TTL) to tell if it should be enabled. Be careful with laser and use your special glasses and be close to reset/power at first tries.
    Thanks for your reply.
    Yes, that`s true, D9 has many functions.
    Acutally, my laser also uses 5V-TTL to control it. Because this is my first time to use laser, I am confused by some references on website. Now I am clear. Thanks.
    But I have another question. Today I tried Z_MAX_PIN (Z MAX ENDSTOP) as the control port for the laser. Similarly, M3 command was used to try to turn on the laser. In my eyes, the TTL signal is like PWM which can be used to control some chips such as MOSFET or Transistors. However, after trying, the same result was obtained, i.e., there had no signal on Z_MAX_PIN. 

    Did I miss something? And how can I control my laser by using M3/M5? Thank you.

    ===========================I tried these settings=============================

    ------------------------------------------------------------------------------------------------------------------------------------------

    --------------------------------------------------------------------------------------------------------------------------------------------

  • YOu can use the z man pin as output, but that does not mean you have to enable z max endstop. In fact, that is just what prevents it from being used correctly. Making it an endstop pin means setting it as input, while oyu need it as output. So simple set no z max endstop (or at leats not for that pin) and leave the laser pin as it is. Then it will switch the laser TTL pin as expected.
  • Repetier said:
    YOu can use the z man pin as output, but that does not mean you have to enable z max endstop. In fact, that is just what prevents it from being used correctly. Making it an endstop pin means setting it as input, while oyu need it as output. So simple set no z max endstop (or at leats not for that pin) and leave the laser pin as it is. Then it will switch the laser TTL pin as expected.
    Hi.
    Actually, I tried the setting (the 2nd picture above) as you said "simple set no Z max endstop". After the setting, I tested the signal in two ways. 1) idle the machine to check the signal on "Z max endstop pin"; 2) and run the machine to check it. Unfortunately, the result was the same --- there had no signal. Also, to eliminate the hardware problem, I made some simple code to check laser TTL pin which I expect to use. And no hardware problem was found yet. Moreover, I tried another main board and Ramps. Once again, no signal. So I guess the problem should be the settings.

    To solve this problem, I will talk more about my machine. 
    a). Arduino mega2560 + Ramps 1.4
    b). Classic Cartesian Coordinates machine;
    c). Used motors: X-1; Y-1; Z-2; Extra for powder-1 (using E0 motor pin to drive)
    d). Endstops: X - X_MAX; Y - Y_MIN; Z - Z_MIN
    e). Use laser source

    And the detailed settings about my 3D printer are shown in the attached file. Could you check it and we discuss? Thank you.
  • edited December 2017
    seems you overlooked that laser only gets activated when moving.
    so the M3 command has to be followed by G1 command.

    for example:

    M3
    G1 X100 Y100 F500 //here Laser is ON
    G0 X0 Y0 //here Laser is OFF


    Laser is only switched on during G1 , G2 and G3 commands

    if you use Zmax pin set:



  • RAyWB said:
    seems you overlooked that laser only gets activated when moving.
    so the M3 command has to be followed by G1 command.

    for example:

    M3
    G1 X100 Y100 F500 //here Laser is ON
    G0 X0 Y0 //here Laser is OFF


    Laser is only switched on during G1 , G2 and G3 commands

    if you use Zmax pin set:



    Ok. Thanks for your reply. I will try what you said. 
    --------------------------------------------------------------------------------------------------------------
    Because I want to solve this problem as soon as possible, if someone has other methods, please let me know. Thanks.
  • edited December 2017
    Thank you RAyWB and Repetier.Now it works. 
    But a new problem comes out. Because the power of my laser is low, the powders cannot be sintered well. For this, I slowed down the speed of motors during printing. When the 2nd layer was printering, huge deviation happened. I guess the problem resulted from the slowed down speed of motors. Do you agree?
    ================================================

  • sorry, i have no experience with that, i use laser for engraving
  • Make sure to have same speed for all layers. First layer is often handled differently by slicers and print with lower speed. What you want is slic3r with fixed set extrusion width = laser width and constant low speed matching the power you need. Jerk of printer should be 2 * speed so you can print without acceleration. Works of course only with slow moves.
Sign In or Register to comment.