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

    Custom PID Controller

    Scheduled Pinned Locked Moved Unsolved
    General Discussion
    3
    7
    341
    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.
    • Oliver_Briggsundefined
      Oliver_Briggs
      last edited by

      Is it possible to set up a custom PID controller on the duet board? I know that you can run a heater PID but I want to control a custom power supply board, which is used to control the power supply of a MIG welder with a current feedback loop, and want to apply a PID on it. Is this possible directly on the duet or do I have to use an external controller?

      1 Reply Last reply Reply Quote 0
      • OwenDundefined
        OwenD
        last edited by

        @Oliver_Briggs
        M951 would likely allow you to create such a PID control.
        Are you trying to set up a height controller?
        The two control values on a mig are voltage and wire speed.
        The current will vary depending on contact tip to work distance (CTWD), so trying to use it as a reference to control the welder output isn't of much use unless you're trying to implement a penetration stabilising function. That is to say that if the controller senses a current drop due to changes in CTWD (which causes reduced penetration), the it increases wire speed to compensate.
        M594 & M951 may be helpful in devising a height controller although you'd have to convert the current reading into a reference voltage that M951 can use.

        1 Reply Last reply Reply Quote 0
        • Oliver_Briggsundefined
          Oliver_Briggs
          last edited by

          @OwenD Thanks for the response! The M951 command looks like exactly the one. We want to control the current through the voltage without adjusting the height. We've designed a current limiter board, but we want to implement a closed loop controller on the gate voltage to adjust the current.
          Goal is: put a voltage on the gate of a power transistor through a custom gate driver, pass the ground wire through a current transformer, transform that current to a voltage to read into the duet. Use that voltage and compare it to the expected voltage (therefore the current), and use a closed loop controller to adjust the gate voltage until the desired welding current is achieved.
          Unsure about the electronics for now - there are a few potential solutions in the works. The key thing is to figure out whether we can implement a PID controller on the duet or whether it would require an external board. It says the default sample and correction frequency is 5Hz - do you know what the maximum frequency for this is?

          OwenDundefined dc42undefined 2 Replies Last reply Reply Quote 0
          • OwenDundefined
            OwenD @Oliver_Briggs
            last edited by

            @Oliver_Briggs
            I have no idea what the max frequency of M951 would be. @DC42 may be able to provide input.

            I wouldn't expect you'll require a higher frequency just to just adjust voltage, but you'll probably have to do quite a bit of filtering and smoothing.

            What material and weld process are you using?
            Unless you're welding quite large pieces, you'll likely be running in dip transfer mode.
            This will likely increase the signal noise.
            There are any number of Hall effect sensors available to sample the current.

            https://au.element14.com/honeywell/csla2el/current-sensor-transducer/dp/1703966?gclid=Cj0KCQiA7YyCBhD_ARIsALkj54qciwMG0uyZRwWlmnqnyqQJ_IBpmyzHGTy0zadNpefWWJQoMvFhNZ4aAhl_EALw_wcB&mckv=_dm|pcrid|501152839127|pkw||pmt||slid||product|1703966|pgrid|123988903131|ptaid|pla-293946777986|&CMP=KNC-GAU-GEN-SMART-SHOPPING

            The "norm" these days in robotic welding is to store all weld parameters in a job on the welder.
            The PLC simply selects the job at the start of the weld.
            There is not a lot of need to skits parameters "on the fly" but the weld jobs typically have an allowable variation limit.
            Modern power sources have a calibration function which measures the resistance in the weld circuit and applies correction if the set value and measured value differ.
            Such power sources also have interfaces available to handle reading and adjusting weld parameters.

            Trying to use a basic mig may seem attractive , but you'll probably find the time and money invested in trying to create peripheral equipment outweighs the capital investment on a power source that already does all the work.
            Additionally such power sources may have specialised weld processes specifically for highly controlled short circuit welding required for WAAM

            1 Reply Last reply Reply Quote 0
            • Oliver_Briggsundefined
              Oliver_Briggs
              last edited by

              @OwenD We're doing a university WAAM research project, where there is some variation in settings during the print, and unfortunately we got no say in welder choice, so we're stuck with what we've got. For the most part the goal involves modifying the power supply, so our current welder gets the job done. Unfortunately I have not yet been able to find any welders that are able to do what we need them to do either. Apologies for being vague, there are details of the design I can't post on here.

              Good find on the current sensor, I've been trying to look for hall effect sensors but I think I need to work on my googling!

              I hadn't considered the signal noise yet. The noise is going to make it quite difficult to control, but I'll cross that bridge when I get to it with some kind of filtering. It will be easier to design once I see a waveform on a screen.
              Why do you say unless welding quite large pieces? Is that in relation to the welding current? or the duty cycle of the welder?

              OwenDundefined 1 Reply Last reply Reply Quote 0
              • OwenDundefined
                OwenD @Oliver_Briggs
                last edited by OwenD

                @Oliver_Briggs said in Custom PID Controller:

                Why do you say unless welding quite large pieces? Is that in relation to the welding current? or the duty cycle of the welder?

                No, I was thinking more about the likely weld voltage and the process transfer range that will put you in.
                In very rough terms < about 18v weld voltage will be dip transfer. Between 18 & 28v you'll be in globular transfer & > than 28 you'll be in spray transfer.
                I'd expect the first two transfer modes to give more noise due to the resistance changes between when the wire is short circuiting and when it's not.
                The bead size you'd get in spray transfer would be too large unless you're working on very large pieces.
                I'm assuming you're not using pulse.
                Commercial WAAM systems typically use CMT ( Cold metal transfer) process which is is a very specialised short circuit process.

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

                  @Oliver_Briggs said in Custom PID Controller:

                  @OwenD Thanks for the response! The M951 command looks like exactly the one. We want to control the current through the voltage without adjusting the height. We've designed a current limiter board, but we want to implement a closed loop controller on the gate voltage to adjust the current.
                  Goal is: put a voltage on the gate of a power transistor through a custom gate driver, pass the ground wire through a current transformer, transform that current to a voltage to read into the duet. Use that voltage and compare it to the expected voltage (therefore the current), and use a closed loop controller to adjust the gate voltage until the desired welding current is achieved.
                  Unsure about the electronics for now - there are a few potential solutions in the works. The key thing is to figure out whether we can implement a PID controller on the duet or whether it would require an external board. It says the default sample and correction frequency is 5Hz - do you know what the maximum frequency for this is?

                  Current transformers only work on AC, whereas I think the current produced by a MIG welder is DC. You can measure the current using a Hall effect current sensor. Most of them have 0-5V outputs, so you can step down the output to 0-3.3V and feed it into a thermistor input configured as a Linear Analog Sensor.

                  Whatever mechanism you use for passing a control signal from the Duet to the MIG welder should be optically isolated. Does the MIG unit provide an input for controlling the current?

                  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
                  • First post
                    Last post
                  Unless otherwise noted, all forum content is licensed under CC-BY-SA