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

Learning- How G-Code and Firmware Interact

Scheduled Pinned Locked Moved
Firmware developers
learning firmware g-code custom
6
14
1.3k
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
    JRCL @alankilian
    last edited by 15 Dec 2021, 02:54

    @alankilian Thank you so much I'll make sure to start looking into all of these!

    1 Reply Last reply Reply Quote 0
    • undefined
      fcwilt @JRCL
      last edited by 15 Dec 2021, 03:29

      @jrcl said in Learning- How G-Code and Firmware Interact:

      When you say "establish additional axes using Gcode and control them with Gcode to a limited degree" do you mean with just manual modification of gcode from a printer slicer or entirely making your own command set to operate only once.

      These additional axes shouldn't have to do anything during the actual printing, just after.

      That sort of thing you can do. For example, I retro-fitted one of my printers with a removable Z probe just to try it out. Because of the limited space on the printer I had to install a small stepper controlled linear guide (50 mm travel) to move a needed part into place as needed and out of the way as needed. Since it had nothing to do with printing I was able to create a pair of files with the need gcode commands to control the stepper motor as needed.

      50mm mini guide.png

      Frederick

      Printers: a small Utilmaker style, a small CoreXY and a E3D MS/TC setup. Various hotends. Using Duet 3 hardware running 3.4.6

      1 Reply Last reply Reply Quote 1
      • undefined
        dc42 administrators @JRCL
        last edited by dc42 15 Dec 2021, 09:27

        @jrcl can you tell us more about what else you want the machine to do? Adding additional axes is easy using the M584 command, as long as all axes are expected to move in sync when multiple axes are moving at the same time.

        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

        undefined 1 Reply Last reply 15 Dec 2021, 23:44 Reply Quote 1
        • undefined
          rjenkinsgb
          last edited by rjenkinsgb 15 Dec 2021, 09:37

          The firmware is a "G Code interpreter" that in principle reads a line at a time and performs whatever function or movement that line requires.

          Re. other commands and axes;
          You can have additional motors linked to extra "axis name" letters, that can be commanded to move when needed.

          You can also have on/off switching outputs and access many other hardware functions on the Duet board, by commands in the G Code program.

          If there you need complex combinations from a single instruction, you can define macros (G code subroutines) triggered by spare M codes or called by name.

          For adding functions in during printing, look at the custom G Code sections available in such as Prusa Slicer.
          You can have custom commands run at the start of the program, the end of the program, at any layer change, extruder change etc. etc.

          And the Duet has a "Demon" facility, a file that can be auto executed at regular intervals to monitor or control additional hardware totally independently (within reason) while the printer is running.

          If you give full details of what you are trying to achieve, there is a good chance it can be done just with the appropriate configuration of the machine and slicer.

          Robert J.

          Printers: Overlord pro, Kossel XL+ with Duet 6HC and "Frankentron", TronXY X5SA Pro converted to E3D toolchange with Duet 6HC and 1LC toolboards.

          1 Reply Last reply Reply Quote 1
          • undefined
            JRCL @dc42
            last edited by 15 Dec 2021, 23:44

            @dc42 @rjenkinsgb

            In short, I'm attempting to operate a thermoform "onto" the print bed once the print is done. So once a print is done the print head moves out of the way and a heater heats up a thermoplastic sheet held by a carriage that moves parallel to the Z-Axis, via belt connected steppers, so the sheet can be pulled over the bed. Then the vacuum turns on. So in summary:

            1. I need an additional axis to rotate the print head out of the way
            2. I need an additional axis for the steppers driving the carriage, but moves linearly from the belts
            3. I need to setup a PID controller for the additional heating element via a relay as I'm using a an 120VAC load with a 3-32VDC control signal. Thinking PWM pins or GPIO pins for this?
            4. I need to control the vacuum, which I would like to just do with the GPIO pins

            Thank you so much for your time and willingness to dive further into it with me!

            undefined undefined 2 Replies Last reply 15 Dec 2021, 23:53 Reply Quote 0
            • undefined
              fcwilt @JRCL
              last edited by 15 Dec 2021, 23:53

              @jrcl said in Learning- How G-Code and Firmware Interact:

              1. I need an additional axis to rotate the print head out of the way

              Would it not be enough to simply lower the bed far enough down to provide the clearance need to move the carriage into place over the model?

              1. I need an additional axis for the steppers driving the carriage, but moves linearly from the belts

              That's easy.

              1. I need to setup a PID controller for the additional heating element via a relay as I'm using a an 120VAC load with a 3-32VDC control signal. Thinking PWM pins or GPIO pins for this?

              That's easy.

              1. I need to control the vacuum, which I would like to just do with the GPIO pins

              That's easy.

              Frederick

              Printers: a small Utilmaker style, a small CoreXY and a E3D MS/TC setup. Various hotends. Using Duet 3 hardware running 3.4.6

              undefined 1 Reply Last reply 16 Dec 2021, 00:29 Reply Quote 1
              • undefined
                JRCL @fcwilt
                last edited by 16 Dec 2021, 00:29

                @fcwilt Unfortunately due to the dynamics of the machine and some other physical constraints I have to rotate it entirely away.

                Happy to hear everything else is easy to do. I assume you mean routinely and not just adding a bunch of raw g-code to the end of the sliced model file.

                undefined undefined 2 Replies Last reply 16 Dec 2021, 00:33 Reply Quote 0
                • undefined
                  engikeneer @JRCL
                  last edited by engikeneer 16 Dec 2021, 00:33

                  @jrcl well you'll need gcode lines in your config to define your motors, axes, heaters etc (all standard but you'll just have more of them). You'll then need some extra gcode to run at the end of a print file do the motions you require (e.g. rotate axis A by 90deg, move axis B 100mm etc.) That could all be in a macro on the printer, then the print file just needs to call that macro e.g. M98 P"doSomeCleverStuff.g"

                  E3D TC with D3Mini and Toolboards.
                  Home-built CoreXY, Duet Wifi, Chimera direct drive, 2x BMG, 300x300x300 build volume
                  i3 clone with a bunch of mods

                  1 Reply Last reply Reply Quote 1
                  • undefined
                    fcwilt @JRCL
                    last edited by 16 Dec 2021, 01:05

                    @jrcl said in Learning- How G-Code and Firmware Interact:

                    @fcwilt Unfortunately due to the dynamics of the machine and some other physical constraints I have to rotate it entirely away.

                    That is going to make it hard and likely expensive. How about a setup where the bed is moved to a different location out from under the print head? That's easy.

                    Happy to hear everything else is easy to do. I assume you mean routinely and not just adding a bunch of raw g-code to the end of the sliced model file.

                    Slicers have the ability to call custom gcode on the printer at the start of the print, at the end of the printer and during certain events during the print.

                    Frederick

                    Printers: a small Utilmaker style, a small CoreXY and a E3D MS/TC setup. Various hotends. Using Duet 3 hardware running 3.4.6

                    1 Reply Last reply Reply Quote 0
                    • undefined
                      rjenkinsgb @JRCL
                      last edited by 16 Dec 2021, 08:38

                      @jrcl said in Learning- How G-Code and Firmware Interact:

                      In short, I'm attempting to operate a thermoform "onto" the print bed once the print is done. So once a print is done the print head moves out of the way and a heater heats up a thermoplastic sheet held by a carriage that moves parallel to the Z-Axis, via belt connected steppers, so the sheet can be pulled over the bed. Then the vacuum turns on. So in summary:

                      As far as the controller & firmware etc., everything you want to do can be done just with correct configuration and adding a macro to run the extra mechanics; or add the full code to the slicer end code, either way.

                      Rotating the head away while still maintaining full accuracy seems difficult though; using a larger frame so the axes can move clear of the required area is likely cheaper.

                      The only high-accuracy possibility I can think of could be to use an E3D toolchanger system, with a hinge and servo added above the tool attachment point so when the tool is unclamped it can be swivelled up over the carriage, rather than left in a static carrier.

                      Still complex and expensive, possibly more so than just longer axis rails to move a normal head clear.

                      All the other motions are straightforward and controllable, with pretty much off-the-shelf mechanical parts.

                      Robert J.

                      Printers: Overlord pro, Kossel XL+ with Duet 6HC and "Frankentron", TronXY X5SA Pro converted to E3D toolchange with Duet 6HC and 1LC toolboards.

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