I'm having trouble with the PID settings and the new MK5 extruder.
I'm currently using the PID settings that worked great with my "MK4"
(an upgraded MK3): 7, 0.36, 36
With the MK5, driven by a relay board (more on that in another thread)
I'm getting temp swings of +8/-13 degrees C of the target temp.
Does anyone have suggestions for how to approach tuning these
parameters? Or PID settings for the MK5 that they're happy with?
Thanks,
Marty
Charles Edward Pax
blog: http://charlespax.com/
twitter: http://twitter.com/charlespax
> --
> You received this message because you are subscribed to the Google Groups "MakerBot Operators" group.
> To post to this group, send email to make...@googlegroups.com.
> To unsubscribe from this group, send email to makerbot+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/makerbot?hl=en.
>
>
Temp graph: http://static.creatingwithcode.com.s3.amazonaws.com/mk5-temp-swings-2010-08-29.png
I've upgraded to the latest version of the extruder firmware on GitHub
(compiled from source). This improved the relay "singing" a bit, but
I still hearing some buzzing as it PWMs the relay from on-to-off as
the heater crosses target temp.
Oddly, I can also hear that the heater doesn't turn off until the
temperature has already overshot by about 3 degrees or so. Similarly,
the heater doesn't turn back on until the temp has already dropped a
few degrees below target.
I would expect it to anticipate the target-temp crossing and turn the
heater on/off early. Is anyone else seeing this behavior?
Thanks,
Marty
guess : maybe the reason it overshoots by 3 degrees is that is it
using PWM and the duty cycle doesn't get large enough until its
substantially out of range ? that doesn't really seem plausible, but
maybe ?
This is *really* experimental (haven't tried it myself), but I've just created http://wiki.makerbot.com/pid-controller-tuning outlining the Ziegler-Nichels control system tuning method and embedded three Wolfram-Alpha widgets to do the calculations.
Using a T=60 and L=10.286 I was able to generate KP=7.0, KI=0.34 and KD=36.
I had to set T=30 and L=7.2 to get KP=5.0 and KI=0.35, which sets KD=18.
If I set T=55 and L=12, I get KP=5.5, KI=0.23 and KD=33. I'd suggest using these as a starting point since lowering both KP and KI should make for a more stable controller.
- If this has the opposite effect of taking too long to reach temperature or settling the wrong temperature (steady-state error), try decreasing the Delay Time (L) value in 0.1 decrements from that L=12 value. That will have the greatest influence on increasing the KI term.
Andrew.
--
"The future is already here. It's just not very evenly distributed" -- William Gibson
Charles Edward Pax
blog: http://charlespax.com/
twitter: http://twitter.com/charlespax
Using Wolfram|Alpha's a bit of a moving target, being beta and all. If you keep the equations relatively simple they seem to survive better, hence the splitting up the PID term calculations into three separate widgets.
Andrew.
Thanks for making the tuning page!
I've tried going through several sets of values, taking the time
constant all the way down to 30 and up to 90 (from the original 60),
and adjusting the delay time to bring the Kp value into the 5.0 - 7.0
range.
These changes seem to produce some changes in the relay buzzing.
Higher time constant values led to shorter periods of buzzing as the
PWM transitioned from 0 - 255 (or back). Lower time constants
produced longer periods of buzzing, with a slower transition from 0 -
255 (or back).
However, none of the sets of values I tried actually led to a stable
temperature. At best, the heater would only begin to change state at
about 3degC too late. At worst, it would get 10degC too high or low
before attempting to switch the heater off.
It seems like only a few people are experiencing this behavior. I was
wondering if folks with successful MK5 setups could describe their
configuration in detail. I'm interested in knowing:
* How your MK5 is connected
* Whether you have an HBP and whether it is powered through the relay board
* What firmware versions do you have on the motherboard and extruder controller
* What PID settings you're using
Sorry to keep pushing on this thread, but I am at a loss to explain
why I am seeing this behavior with my 'bot. If I recall correctly,
part of the point of PID is that the proportional control will predict
and compensate for overshoot, so the behavior of waiting until after
the target temp has been crossed before reacting seems pathological.
Thanks,
Marty
> * How your MK5 is connected
- I have the MK5 connected directly to my extruder controller board. I
am on an experimental Gen4 extruder controller using a thermocouple.
> * Whether you have an HBP and whether it is powered through the relay board
I have an HBP connected directly to my extruder controller board.
Again, an experimental Gen4 board.
> * What firmware versions do you have on the motherboard and extruder controller
I'm not sure. My bot is on loan, so I can't check. However, I am
entirely confident that I am running whatever is most recent.
> * What PID settings you're using
PID = 7, 0.35, 36
Thanks for sharing your MK5 info.
I was wondering last night whether the thermistor values would
contribute to this problem. I've got a "thermocouple kit" from
Adafruit on the way so I can get the right calibration values for the
thermistor, which should be good, regardless.
My gut (probably incorrectly) tells me that no matter how off my
thermistor values are, the extruder should be able to reach a steady
state for whatever it "thinks" is the target temperature. However,
I'm sure that is a misleading intuition, so I want to go ahead and
remove that variable. :)
Thanks,
Marty
I just thought of something you could try. Instead of driving both resistors in parallel using a relay, break the parallel connection and drive one 5 Ohm resistor with the main Heater channel and the other 5 Ohm with the Valve or Fan channel.
You'll have to check to see what the steady-state temperature is when the Valve/Fan-connected resistor is on. If it's lower than your target extrusion temperature it should be trivial to add activate and deactivate commands to your skeinforge start and finish gcode. Then all the Heater-connected resistor has to do is heat the difference as required.
Be prepare to add heatsinks and/or an always-on fan to the FETs to keep them cool.
Andrew.
--
Installed relay board, used RepG 18, set PID using the values here.
Tons of buzzing on the relay as temperatures approached 220.
WILD swings in temperature from 235 down to 209, which usually means
the proportional constant is off
Relay fried on the relay board. Totally dead, and it died in the
stuck on position .. head reached a temp of 245 before I shut it down.
PWM + Relay is just a stupid idea. Relays just aren't meant to be
driven by high speed PWM.
I'm either going to design and use a board with power FET's which
-are- designed to take the beating of PWM .. or I'm going to switch
PWM off entirely.
-Martin
Charles Edward Pax
blog: http://charlespax.com/
twitter: http://twitter.com/charlespax
jordan
-Martin
http://github.com/makerbot/G3Firmware/commit/a26e3035c149b49465edcdc159c34a178636073d
I have managed to build it, but I'm not at home so I can't try it on
my bot, yet.
To build it, you'll need to have avr-gcc, etc. installed, according to
the build instructions on the wiki:
http://wiki.makerbot.com/v2-firmware
Basically, once you have that stuff compiling, you can compile the
relay-friendlier version with:
$ cd G3Firmware/v2
$ scons -f SConstruct.extruder relays=true
Plug your FTDI cable into your extruder controller and then upload with:
$ scons -f SConstruct.extruder port=/dev/NAME_OF_YOUR_SERIAL_DEVICE upload
Those instructions should work for OS X/Linux peeps
I'll try to report on how this works as soon as I can, but it will
probably be tomorrow. If anyone gets it working, please drop us a
note here!
Thanks,
Marty
Make sure your path includes /usr/local/CrossPack-AVR/bin
I think it includes instructions for this part.
-Rob
Check /usr/local/avr/etc/ for a avrdude.conf and then copy (or symlink) that to /usr/local/etc/
regards,
Koen
--Marty
I applied Rob's "#define MOTOR_DIR_PIN HB1_DIR_PIN" fix, to avoid
later problems. :)
Turns out you have to pass the "relays=true" directive when you
upload, or everything gets re-compiled without it. So, with my USB
cable plugged into the extruder, I ran:
$ cd G3Firmware/v2/
$ scons -f SConstruct.extruder port=/dev/<USB port> relays=true upload
With that done, I went back to the old PID settings of P=7, I=0.36,
D=35 and was still getting wild temp swings.
Using Andrew's awesome PID tuning page
(http://wiki.makerbot.com/pid-controller-tuning) I started playing
with the time and delay constants keeping a couple of things in mind,
as he suggests:
Initial Values:
T=60, L=10.286 => P=7,I=0.36,D=35
These are the values that Charles Pax is using. Resulted in temp
swings of greater than +/-10degC for me.
First Try:
T=90, L=18 => P=7, I=0.164, D=54
Much improved. Temp swings of +/-4degC.
RepG temp graph:
http://static.creatingwithcode.com.s3.amazonaws.com/temps_2010-09-03_+4-4_p7_i0.164_d54_eda5071.png
This was much better, so I went ahead and increased the constant values further.
Second Try:
T=180, L=42 => P=5.143, I=0.0612, D=108
Improved again. Still had max swings of +/-4degC, but stayed at those
extremes for much less time, keeping a lower error rate.
RepG temp graph:
http://static.creatingwithcode.com.s3.amazonaws.com/temps_2010-09-03_+4-4_p5.143_i0.0612_d108_eda5071.png
This could probably be pushed even further, but I think it's holding
the target temperature well enough to start playing with calibration
and actually running plastic through. My thermocouple kit has
arrived, so I want to go ahead and calibrate my thermistor to make
sure that the temp it's holding is the one I actually want. I'll post
an update here when I finish that up, but it might not be until next
week.
Hopefully this is useful to someone in the meantime!
--Marty
Here are the real RepG images:
First settings change, T=90, L=18 => P=7, I=0.164, D=54:
http://static.creatingwithcode.com.s3.amazonaws.com/temps_2010-09-03_p4m4_p7_i0.164_d54_eda5071.png
Second settings change, T=180, L=42 => P=5.143, I=0.0612, D=108:
http://static.creatingwithcode.com.s3.amazonaws.com/temps_2010-09-03_p4m4_p5.143_i0.0612_d108_eda5071.png
Thanks,
Marty
e.g.
T=55, L=12 => P=5.5, I=0.23, D=33
T=54, L=12.6 => P=5.143, I=0.204, D=32.4
T=56, L=13.1 => P=5.13, I=0.196, D=33.6
I always get nervous when I see integer multiples come up (i.e. T=60 -> T=90 -> T=180). If you get the chance to try, I'd be curious to know how the above PID triples fair in your setup.
Andrew.
--
I thought my method was a bit screwy at first, as well.
Initially, I was doing exactly as you suggested - lowering the time
constant (T) while increasing delay time (L) to lower P and I (while
keeping P between 5 and 7).
Working all the way down to T=30, D=7 => P=5.143, I=0.367, D=18, I
found that the temp-keeping behavior was getting incrementally worse.
Specifically, for most settings I was still seeing pathological
overheating behavior where the relay would stay on well past target
temp (around +5) before starting to back off (click/click,
click/click) and finally turn off the relay altogether, with temps
usually ending up about +10 - +15 of target. The system also
continued to undershoot in a similar way, not activating the heater
until temp had dropped to around -5 below target.
So, I got it in my head to try increasing the time constant, instead,
and to make the big jump from T=60 to T=90. I was surprised to find
how much better those settings were at maintaining temp, and so jumped
up to T=120. T=120 and T=90 seemed pretty much the same, so I jumped
to T=180, seeing only a small improvement.
It takes a good bit of time to go through the whole process of
generating these graphs, so for now I've only tried the the first two
of your settings, below:
T=55, L=12 => P=5.5, I=0.23, D=33
Temp swings of +10/-9, with the first click/clicking of proportional
compensation happening around 1 degree before target temp, but with
the relay not staying on or off until ~5 degrees past target temp.
RepG temp graph:
http://static.creatingwithcode.com.s3.amazonaws.com/temps_2010-09-02_p10m9_p5.5_i0.23_d33_eda507.png
T=54, L=12.6 => P=5.143, I=0.204, D=32.4
Temp swings of +9/-9, with the first click/clicking of proportional
compensation happening around 1 degree before target temp, but with
the relay not staying on or off until ~5 degrees past target temp.
RepG temp graph:
http://static.creatingwithcode.com.s3.amazonaws.com/temps_2010-09-02_p9m9_p5.143_i0.204_d32.4_eda507.png
Thanks,
Marty
I use /dev/tty.usbserial-* but that's me.
-Rob
I've added a "Preliminary Plastruder MK5 PID Settings" subsection at http://wiki.makerbot.com/tips-and-tricks#toc7 and mentioned MK4 vs MK5 starting points at http://wiki.makerbot.com/pid-controller-tuning
Hopefully that saves future (ab)users some grief.
Andrew.
> For more options, visit this group at http://groups.google.com/group/makerbot?hl=en.
To unsubscribe from this group, send email to makerbot+u...@googlegroups.com.