Custom PID Controller
-
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?
-
@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. -
@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? -
@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.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 -
@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? -
@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. -
@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?