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

Signal names for VFD "PWM" port

Scheduled Pinned Locked Moved
Laser Cutters
4
8
280
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.
  • undefined
    FlashPackets
    last edited by 21 Aug 2024, 03:58

    The MB6XD with 3.5.12 firmware has 4 I/O ports at the top of the board adjacent to the I/O power input connector. On a LitePlacer Pick & Place machine I use
    M42 P0 S1/0 to enable a vacuum pump and M42 P1 S1/0 for the vacuum solenoid
    and M42 "P2" S1/0 to supply 12 volts to a 20 watt 450 nm diode laser.

    For debug the laser was replaced with a hobby servo allowing supplying 5V power via the PWM port.

    It is not clear at all what this port should be called ... "P2" did not work nor OUT3, VFD since it is a string does it even matter?

    What are the commands that will give a mid position of the servo arm?

    Should I expect that there is no functional difference between running a pwm vs a laser? Given the absolute safety of using a servo for debug vs wearing safety goggles during a laser setup.

    Where is the signal naming convention of the MB6XD defined?

    undefined undefined undefined 3 Replies Last reply 21 Aug 2024, 05:37 Reply Quote 0
    • undefined
      dc42 administrators @FlashPackets
      last edited by 21 Aug 2024, 05:37

      @FlashPackets said in Signal names for VFD "PWM" port:

      Where is the signal naming convention of the MB6XD defined?

      In the page for that product in this wiki. https://docs.duet3d.com/Duet3D_hardware/Duet_3_family/Duet_3_Mainboard_6XD_Hardware_Overview#pin-names

      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
      • undefined
        infiniteloop @FlashPackets
        last edited by 21 Aug 2024, 10:45

        @FlashPackets

        What are the commands that will give a mid position of the servo arm?

        That depends on your servo: what angle it covers, how the arm is mounted. Read Connecting hobby servos and DC motors. In the section Firmware configuration, you can find some sample code. You’ll have to check yourself what angle translates to the mid position of your specific servo.

        1 Reply Last reply Reply Quote 0
        • undefined
          droftarts administrators @FlashPackets
          last edited by 21 Aug 2024, 12:01

          @FlashPackets By default, RepRapFirmware has no defined ports, or pins defined as ports (except for stepper driver outputs). Ports and pins need to be defined, usually in the config.g file at startup, by M950 commands.

          In each M950 command, the 'C' parameter defines the pin the port is to use. Ports can be set as different types, ie 'H' for heaters, 'F' for fans, 'J' for inputs, 'P' for general purpose outputs, 'S' for servos, 'R' for spindles, 'E' for LEDs. Each of these then need a unique port number, so they can be referred to, ie you could define H1, H2, H3, F1, F2, J1, P1, P2, S3 (P and S have to be unique from each other). Then other commands use this reference to control the port, eg M42 P2 S1.

          So look for the M950 P2 C... command in config.g, which will define where the laser is connected. You can change this (presumably it's using one of the OUT pins running at 12V) to 5V PWM pin which is named 'laser' or 'vfd', ie M950 P2 C"vfd" and it can be controlled using M42. If you prefer to use servo angles with M280, change the 'P2' to 'S2'.
          Alternatively, create a new port with M950 P3 C"vfd", and use it referring to 'P3', ie M42 P3 S1.

          Finally, as @infiniteloop says, be careful when setting servo angles. Most servos can't go to 0 degrees, and often their range of motion is more like 10 to 170 degrees. Trying to force the motor to 0 degrees causes a servo to stall, and to draw maximum current as it tries to get to the position commanded, possibly damaging the Duet's 5V regulator.

          Ian

          Bed-slinger - Mini5+ WiFi/1LC | RRP Fisher v1 - D2 WiFi | Polargraph - D2 WiFi | TronXY X5S - 6HC/Roto | CNC router - 6HC | Tractus3D T1250 - D2 Eth

          1 Reply Last reply Reply Quote 0
          • undefined
            FlashPackets
            last edited by 22 Aug 2024, 03:47

            Man that blue light is bright! Even with my safety goggles that turn blue painters tape black.

            My objective is to melt or vaporize the 0.05mm cover tape on surface mount component carrier tape.

            This code will produce a beam:
            with config.g
            M950 P3 C"laser"

            macro LASE
            M42 P3 S1
            G4 P100
            M42 P3 S0

            This code does not work
            config.g
            M452 C"laser" R255 F500
            Macro LASE
            M42 P3 S1
            G4 P100
            M42 P3 S0

            For RRF 3.5.2 the notes suggest running "if I've read the notes correctly"
            something like
            config.g
            M950 P3 C"!laser" Q1000

            macro LASE
            G1 Y250 F1000 S100:20:40:60:80:10

            Does not work

            The M42 notes suggest inverting the laser in M950 P3 C"!laser" Q1000
            I think this is a bad idea as it leaves the laser enabled, then when power is activated via P2 that supplies 12V thereby violating a safety protocol. The beam should only be active by command.

            I'm sure that was not the intent of the comment, perhaps the note needs additional clarification.

            Any suggestion on how to spice up the secret sauce to make the G1 command functional?

            undefined 1 Reply Last reply 22 Aug 2024, 09:59 Reply Quote 0
            • undefined
              droftarts administrators @FlashPackets
              last edited by 22 Aug 2024, 09:59

              @FlashPackets

              The M42 notes suggest inverting the laser in M950 P3 C"!laser" Q1000

              Can you post a link to where it says this? I pretty sure we don't suggest inverting a laser as a starting point. It does say you can invert the output here https://docs.duet3d.com/User_manual/Reference/Gcodes#m42-switch-io-pin, but doesn't say to do it for lasers specifically!

              If you configure your laser using M950, you are configuring a 'general purpose input/output', which is switched by M42. This is not specific to laser; it may be driving a spindle, an actuator, pump, or pretty much anything that needs a PWM or on/off input. Yes, it can be inverted, to allow for devices that expect an inverted signal to operate. No, it doesn't work with G1 S..., because it's not recognised specifically as a laser, just as something to be switched on and off. So it is up to the user to configure and use it sensibly.

              If you use M452, ie laser device mode, that's different. The laser will only be activated by G1 S... commands, not M42 commands. There are various workarounds to get it to fire without moving, but generally you only want to do this for focussing. How to use M452 is written up here: https://docs.duet3d.com/en/User_manual/Machine_configuration/Configuration_laser

              Ian

              Bed-slinger - Mini5+ WiFi/1LC | RRP Fisher v1 - D2 WiFi | Polargraph - D2 WiFi | TronXY X5S - 6HC/Roto | CNC router - 6HC | Tractus3D T1250 - D2 Eth

              1 Reply Last reply Reply Quote 0
              • undefined
                FlashPackets
                last edited by 22 Aug 2024, 23:48

                Here is what finally worked.

                config.g
                ;Lasers
                M452 C"laser" S0 R255 F500 ;

                0:macros/LASE

                M42 P2 S1 ; Activate the 12 V power source
                G4 1000 ; Wait 1 second for the fan to spin up
                M3 S255 ; Specify the range of the PWM from 0 to 255
                G1 X80 ; Move the laser head where there is a test object to burn
                ; Make sure that you have homed the machine if not then you will curse yourself in the
                ; next step, otherwise it will burn up from where it thinks 0,0 is, not where you think 0,0 is.
                G1 X110 Y200 S255 F1000 ; RTFM again until everything is clear 🙂
                M5 ; Shut down the laser
                ; Absolute magic!

                Thanks to the admins and their elves for their patience.

                ; next step
                undefined 1 Reply Last reply 23 Aug 2024, 00:32 Reply Quote 0
                • undefined
                  droftarts administrators @FlashPackets
                  last edited by 23 Aug 2024, 00:32

                  @FlashPackets I don't think the M3 and M5 commands will be doing anything, as you are using M452 S0 (non-sticky mode). If you want to use them, see https://docs.duet3d.com/en/User_manual/Reference/Gcodes#m3-spindle-on-clockwise

                  Ian

                  Bed-slinger - Mini5+ WiFi/1LC | RRP Fisher v1 - D2 WiFi | Polargraph - D2 WiFi | TronXY X5S - 6HC/Roto | CNC router - 6HC | Tractus3D T1250 - D2 Eth

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