Duet3D Logo Duet3D
    • Tags
    • Documentation
    • Order
    • Register
    • Login

    Laser TTL via servo PWM on Duex

    Scheduled Pinned Locked Moved
    Duet Hardware and wiring
    3
    14
    2.6k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Mk_Nickundefined
      Mk_Nick
      last edited by

      Just got my Duex2 and want to use the servo connector to drive the TTL (5v signal) for a laser using the last heater (PWM5/E6_PWM).

      Let me know if this seems right.

      TTL controller + to Duex servo 5v
      TTL controller - to Duex servo PWM

      Use M307 H7 A-1 C-1 D-1 to disable the heater.

      From here, would I use M42 P7 S### (0-255) to control the PWM signal for the TTL controller?

      1 Reply Last reply Reply Quote 0
      • dc42undefined
        dc42 administrators
        last edited by

        I don't know the details of your laser controller, but I would expect it to be:

        TTL- to DueX servo ground
        TTL+ to DueX servo PWM

        M307/M42 commands are as you said.

        Duet WiFi hardware designer and firmware engineer
        Please do not ask me for Duet support via PM or email, use the forum
        http://www.escher3d.com, https://miscsolutions.wordpress.com

        1 Reply Last reply Reply Quote 0
        • Mk_Nickundefined
          Mk_Nick
          last edited by

          I'm waiting on a replacement TTL circuit (I think I killed mine).

          In the meantime, I tried putting the M307 line in the config.g custom gcode section, but I still get the pin not available message when I use M42 until I manually send the M307. Is there somewhere else I should be putting it or do I just have to manually send the M307 each time I want to use the laser?

          1 Reply Last reply Reply Quote 0
          • dc42undefined
            dc42 administrators
            last edited by

            Check that the format of the M307 command in config.g is correct. You don't need to send it more than once. Also make sure that you don't have any tools defined in M563 commands that use that heater.

            Duet WiFi hardware designer and firmware engineer
            Please do not ask me for Duet support via PM or email, use the forum
            http://www.escher3d.com, https://miscsolutions.wordpress.com

            1 Reply Last reply Reply Quote 0
            • Mk_Nickundefined
              Mk_Nick
              last edited by

              Don't have any tools assigned to H7 and I'm using the exact M307 as posted in the first post. Here's what my config.g looks like from the Tools section to the custom gcode.

              ; Tools
              M563 P0 D0 H1                                      ; Define tool 0
              G10 P0 X0 Y0 Z0                                    ; Set tool 0 axis offsets
              G10 P0 R0 S0                                       ; Set initial tool 0 active and standby temperatures to 0C
              M563 P1 D1 H1                                      ; Define tool 1
              G10 P1 X0 Y0 Z0                                    ; Set tool 1 axis offsets
              G10 P1 R0 S0                                       ; Set initial tool 1 active and standby temperatures to 0C
              M563 P2 D2 H1                                       ; Define tool 2
              G10 P2 X0 Y0 Z0                                    ; Set tool 2 axis offsets
              G10 P2 R0 S0                                       ; Set initial tool 2 active and standby temperatures to 0C
              
              ; Automatic power saving
              M911 S22 R23 P"M913 X0 Y0 G91 M83 G1 Z3 E-5 F1000" ; Set voltage thresholds and actions to run on power loss
              
              ; Custom settings
              M307 H7 A-1 C-1 D-1
              M207 S50.0 F5000
              
              1 Reply Last reply Reply Quote 0
              • dc42undefined
                dc42 administrators
                last edited by

                Do you have a M307 H7 command in config-override.g?

                Duet WiFi hardware designer and firmware engineer
                Please do not ask me for Duet support via PM or email, use the forum
                http://www.escher3d.com, https://miscsolutions.wordpress.com

                1 Reply Last reply Reply Quote 0
                • Mk_Nickundefined
                  Mk_Nick
                  last edited by

                  Never even looked at that file. There's a M307 H7 A340.0 C140.0 D5.5 S1.00 V0.0 B0 heater config there. Should I change it to M307 H7 A-1 C-1 D-1 or just delete it?

                  1 Reply Last reply Reply Quote 0
                  • dc42undefined
                    dc42 administrators
                    last edited by

                    You can just delete it. Sometime in the past you have run M500, when you didn't have the M307 H1 command in config.g, so it saved the default parameters to config-override.g.

                    Duet WiFi hardware designer and firmware engineer
                    Please do not ask me for Duet support via PM or email, use the forum
                    http://www.escher3d.com, https://miscsolutions.wordpress.com

                    1 Reply Last reply Reply Quote 0
                    • Mk_Nickundefined
                      Mk_Nick
                      last edited by

                      Sorry for the late update.

                      Deleting the M307 in the override fixed that issue.

                      My replacement TTL circuit arrived today and I just wanted to run the config by you before powering it up just to make sure I'm not doing anything obviously wrong.

                      In the picture below, you can see the green and black wires going from the Duex PWM header going to the TTL circuit (green->pwm ; black-> -- ) From what I understand, the TTL circuit uses 0v on signal, 5v off signal. I'm assuming that means that the logic for the pwm would be reversed (S0 being on and S255 being off)

                      The plug above the TTL header is 12v in from a buck converter and the two on the oppostie side are the fan and laser outputs.

                      0_1524479283508_IMG_2794.JPG

                      1 Reply Last reply Reply Quote 0
                      • dc42undefined
                        dc42 administrators
                        last edited by

                        That looks correct to me.

                        Duet WiFi hardware designer and firmware engineer
                        Please do not ask me for Duet support via PM or email, use the forum
                        http://www.escher3d.com, https://miscsolutions.wordpress.com

                        1 Reply Last reply Reply Quote 0
                        • Mk_Nickundefined
                          Mk_Nick
                          last edited by

                          I think I did something in a prior attempt that buggered the PWM on the one in the picture because I wasn't getting any voltage out of the header when I sent the M42 P7 S255 command. Switched to P5 and it's working beautifully.

                          Probably nothing that can be done about this, but it does ping the laser to full power for a fraction of a second when powered on. I'm guessing that's just the delay from reading the firmware. Mostly a non issue though as long as it isn't pointed in someone's face since it is such a short burst.

                          Thanks for the guidance!

                          1 Reply Last reply Reply Quote 0
                          • dc42undefined
                            dc42 administrators
                            last edited by

                            Because your TTL input is active low, the best option would be to use an open collector buffer or just an NPN transistor or N-channel MOSFET (e.g. 2N7000) between the servo output and the TTL input, to invert the signal.

                            It would be possible to use the PS_ON output to drive it directly, but the firmware doesn't yet support using PS_ON as GPIO.

                            Duet WiFi hardware designer and firmware engineer
                            Please do not ask me for Duet support via PM or email, use the forum
                            http://www.escher3d.com, https://miscsolutions.wordpress.com

                            1 Reply Last reply Reply Quote 0
                            • resamundefined
                              resam
                              last edited by

                              In this post, @dc42 recommended using a 74HCT02 as simple logic inverter.
                              Because all the PWM-output of the Duet are active-low, we need a hardware solution to prevent the laser from powering on during booting & parsing of config.g.
                              I have ordered a 74HCT02, but not received it yet. But for the reasons @dc42 outlined, this is the correct way to go.

                              Mk_Nickundefined 1 Reply Last reply Reply Quote 0
                              • Mk_Nickundefined
                                Mk_Nick @resam
                                last edited by

                                @dc42 I forgot to mention in that post that I was wrong about the TTL being active low. S255 is full power and S0 is off.

                                @resam I'm going to get a separate switch for the laser's power so it won't be powered until I'm ready to start a 'print'. That way when I power the laser on, the config will already be loaded and there shouldn't be a full power spike.
                                I should have one for other safety reasons anyway.

                                1 Reply Last reply Reply Quote 0
                                • First post
                                  Last post
                                Unless otherwise noted, all forum content is licensed under CC-BY-SA