@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?