Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

MK5 PID tuning?

558 views
Skip to first unread message

Marty McGuire

unread,
Aug 27, 2010, 7:56:02 PM8/27/10
to make...@googlegroups.com
Hi folks,

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

Nate True

unread,
Aug 28, 2010, 11:53:58 AM8/28/10
to MakerBot Operators
The MK5 has an entirely different thermal landscape from the MK4 -
more metal to heat and higher distance between the heater elements and
thermistor mean it takes a lot longer for heat from the resistors to
get to the thermistor, which make the PID settings for MK4 much
different. I get a thermal swing of more like +2/-15 degrees but it
doesn't seem to affect printing much at all. I am looking to move to
a MOSFET board instead of a relay board to drive the heater, and that
should reduce the thermal swings some. I should also re-tune the PID
but I have no experience dealing with the proportional-integral-
derivative coefficients. I think the derivative coefficient should be
the one that helps to mute the temperature swings but I'm not really
sure.

Brendan

unread,
Aug 29, 2010, 3:46:28 PM8/29/10
to MakerBot Operators
mmm mmm
mm m m mm
mm m mm
mm m mm


The M represents the giant spotlight I am shining in the clouds above
my city to attract the attention of MakerBot Industries so they will
tell us the PID settings they have been using with the MK5.

Too bad it's daytime and no one can see it. Maybe tonight they will
see it and help us.

HELP!

Brendan

Charles Edward Pax

unread,
Aug 29, 2010, 6:10:11 PM8/29/10
to make...@googlegroups.com
I have been using PID of 7, 0.35, 36 respectively.

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.
>
>

Marty McGuire

unread,
Aug 29, 2010, 8:29:49 PM8/29/10
to make...@googlegroups.com
My settings were close, at 5,0.35,36. Using Charles' settings of
7,0.35,36, I still end up with greater than +/-10 degree Celsius
swings:

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

M.Rule

unread,
Aug 29, 2010, 8:39:48 PM8/29/10
to make...@googlegroups.com
dirty hack : hook up the extruder as if it were a heated build plate ?
I'm driving a HBP with relay, and its not humming so I assume its not
PWM'd.

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 ?

Brendan

unread,
Aug 29, 2010, 9:07:58 PM8/29/10
to MakerBot Operators
I'm getting same behavior and temp ranges. Got both MK5 and HBP
through relay. Updated to RepG18, MB at 2.2, Ex Control at 2.3.

You can watch the leds on the extruder board to see when it cuts off
current to the relay and it's 3 degrees above target easy. The temp
then continues to drift to >10 degree overshoot on low temps (<100C).
At higher temps (230) it starts to cut out at 3 degrees above, then
led is fully off by 235. (OK, so that PWM business is apparent in
brightness of the LED, but I don't get the relay noise). Then, on the
way back down, the led kicked on, not full brightness, two degrees
below. Didn't hit full brightness till 10 degrees below or so and
temp continues to drift down at that point (bottomed at 213 at a 230
setpoint for me).

PID is now 7, 0.347, 36
Beta = 4066, TR = 10000, base temp = 25

I've played with a few different PID settings but nothing good yet.
Since it's 5 degrees above and 15 degrees below at the temps we care
about, I'm going with 235 as a target so the range is 220-240. Still,
it's pretty disturbing since the MK4 never drifted more than a degree
or two out and this supposedly has more mass and should be more temp
stable.

Brendan

M.Rule

unread,
Aug 29, 2010, 9:11:25 PM8/29/10
to make...@googlegroups.com
hmm... it sounds like PWM is not only questionable for noise/relay
lifetime problems, but is also confusing the firmware's model for
stabilizing temperature. I feel like this could be fixed easily by
changing the temperature control on the extruder to something that
more closely resembles that used on the HBP. Unfortunately, I am not
familiar with the software, don't have a MK5 extruder, and am feeling
too lazy to dig through the source code. I guess I'll hold off on
trying to upgrade until this gets patched.

Andrew Plumb

unread,
Aug 29, 2010, 11:59:20 PM8/29/10
to make...@googlegroups.com
Hi Marty,

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

Me: http://clothbot.com/wiki/

Charles Edward Pax

unread,
Aug 30, 2010, 9:27:04 AM8/30/10
to make...@googlegroups.com
Wow, Andrew, that looks really good. I didn't know about the embeds.

Charles Edward Pax
 blog: http://charlespax.com/
 twitter: http://twitter.com/charlespax

Andrew Plumb

unread,
Aug 30, 2010, 9:36:33 AM8/30/10
to make...@googlegroups.com
Thanks! We (Tony Buser and I) used them in the http://wiki.makerbot.com/adjusting-the-thermistor-settings page as well.

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.

Marty McGuire

unread,
Aug 30, 2010, 4:19:52 PM8/30/10
to make...@googlegroups.com
Hi 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

Charles Edward Pax

unread,
Aug 30, 2010, 4:51:24 PM8/30/10
to make...@googlegroups.com
Marty, I think you should consider that your thermistor values may be
a contributing factor.

> * 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

Marty McGuire

unread,
Aug 30, 2010, 5:15:17 PM8/30/10
to make...@googlegroups.com
Hi Charles,

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

Andrew Plumb

unread,
Aug 30, 2010, 9:37:59 PM8/30/10
to make...@googlegroups.com
Hi 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.

--

Graham

unread,
Aug 30, 2010, 11:31:07 PM8/30/10
to MakerBot Operators
well i don't have a successful MK5 setup, but i'll go ahead and share

* How your MK5 is connected
thru relay w/ thermistor installed per MK5 instructions

* Whether you have an HBP and whether it is powered through the relay
board
yes, powered thru relay

* What firmware versions do you have on the motherboard and extruder
controller
mobo fw 2.2 (mobo v1.2), extruder fw v2.3 (extruder v2.2) [batch 15]

* What PID settings you're using
default were:
5 / 0.1 / 5; then tried - sinusoidal from 208-229 (220 target)
7 / 0.35 / 36 - same result

went ahead and did some other target temps:
160 (sinusoidal from 152-174)
250 (sinusoidal from 239-255 [255 might be a false low value, looked
flat, maybe a detection threshold)

whether the HBP was on or off made no difference. was a little
surprised changing the PID settings made no difference -- reset the
extruder, powered off and on the whole machine -- and the PID settings
were saved -- still made no difference.

brief "behavioral analysis":

at 212 going down - buzz, click, buzz
209 down to 208 and back - quiet
210-220 - pulsating buzz
220 - click
224 - click
229 - ting noise
228-212 - quiet

hope this helps someone who has a clue!

-g

Martin Bogomolni

unread,
Aug 31, 2010, 12:41:57 AM8/31/10
to make...@googlegroups.com
MK5 experience:

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

Brendan

unread,
Aug 31, 2010, 10:02:03 AM8/31/10
to MakerBot Operators
In the thread titled "Status of Plastruder MK5 or MK6 or???", Zach
said

the heater is going to be 2.5 ohms. at 12v that pulls 4.8A
for a total of 57.6W of heater action. there's a bigger thing to heat
up.
chances are that the current mosfets will not be able to handle this.
the
gen4 extruder controller will have much better mosfets that are
designed
with this in mind.
of course you could use a smaller heater or only run one of the
resistors or
use 2 mosfets, or a couple other hacks to get it working using stock
parts.

It's possible/likely the MakerBot folks who've been field testing the
MK5 have done so on the Gen4 extruder controller. If no one can find
operable PID settings that work through the relay, this may become a
discussion of what's the easiest or best hack that'll work till gen4
electronics are out.

I was thinking of soldering the contacts of two of the mosfets on the
extruder controller together then joining wires on the outputs as a
way of sharing load across them. I know very little electronics --
could someone who knows more comment if this is likely to work?

Brendan

Charles Edward Pax

unread,
Aug 31, 2010, 10:12:02 AM8/31/10
to make...@googlegroups.com
My electrical engineer friend noted that while what you suggest is
possible, you should not attempt it given you limited EE knowledge.
You would have to do more than just put them in parallel.

Charles Edward Pax
 blog: http://charlespax.com/
 twitter: http://twitter.com/charlespax

Brendan

unread,
Aug 31, 2010, 10:28:32 AM8/31/10
to MakerBot Operators
Thanks for the quick response. I was very tempted to try this before
leaving for work (soldering iron was warming up). You saved my board.

Brendan

Jordan Miller

unread,
Aug 31, 2010, 4:43:28 PM8/31/10
to make...@googlegroups.com
mosfets on the extruder board can only safely handle a 5 ohm resistor or higher resistance. 2.5 ohm will definitely fry the mosfet.

jordan

Martin Bogomolni

unread,
Aug 31, 2010, 11:26:31 PM8/31/10
to make...@googlegroups.com
I've got a PCB milling now, based on a speed controller for an model
aircraft motor of all things. It has six power FET's running in
parallel, with the gates tied together. Should be able to handle 12V
5A with ease, and be PWM-a-ble. Soldering it will have to wait for
the weekend, but I'll post the results on flickr and here.

-Martin

Graham

unread,
Sep 2, 2010, 8:01:03 PM9/2/10
to MakerBot Operators
so the oscillations are definitely attributable to the relay as i
plugged in my mk4 and ran it through the relay and got a similar
behavior -- though its oscillation period is much shorter (yeah, i'm
sure this isn't shocking but it was nice to confirm).

also had issues with setting my PID values back to their defaults
after switching back to the MK4:
1) P parameter wouldn't "stick" to what i set (0.1 becomes 0.09765625)
2) temperature would hold at ~-7C below target -- raising P to 0.2
(becomes 0.19921875) brought the temp up to target
-- hope this isn't any sort of death knell, can anyone put my mind at
ease?

Marty McGuire

unread,
Sep 2, 2010, 8:41:17 PM9/2/10
to make...@googlegroups.com
Looks like Adam just committed a relay fix to the v2 version software
of the extruder controller v2.2 (which most of us have).

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

Rob Giseburt

unread,
Sep 2, 2010, 10:55:30 PM9/2/10
to make...@googlegroups.com
It appears to still have the non-stepper motor reversal bug. I meant to submit a patch for that!

Here's the fix:

In the file v2 / src / Extruder / boards / ecv22 / Configuration.hh

(Sorry about the extra formatting, copy&paste on my phone doesn't let me remove those)

Change line 76 (?) from:

#define MOTOR_DIR_PIN HB2_ENABLE_PIN

To:

#define MOTOR_DIR_PIN HB1_DIR_PIN

  -Rob

Rob Giseburt

unread,
Sep 2, 2010, 11:45:51 PM9/2/10
to Rob Giseburt
Submitted as Issue: 52


I consider this proof that nobody that can commit to the repo (IOW, Makerbot, + a few) is running this code with a non-stepper motor. Hmm, what stepper are they using, since a MK5 doesn’t have a stepper?

;-)

  -Rob
MakerBot Operator
Member of CCCKC Hackerspace
Member of KC Fabricators Google Group

Brendan

unread,
Sep 3, 2010, 2:52:42 AM9/3/10
to MakerBot Operators
Dang. Failed before uploading.

I got macAVR installed, Xcode (oh yeah, I was starting from scratch),
MacPorts, and scons all installed OK. Downloaded the code, it
compiled OK (scons returned a done building targets without error
after running the command with the relay=true switch). Realized I had
to plug the usb.serial cable into the extruder board. I thought I was
on a roll.

But, when I tried to upload to the board, it gave this error:

/usr/local/avr/bin/avrdude -V -F -patmega168 -P /dev/tty-usbserial-
FTES209A -c stk500v1 -b 19200 -U flash:w:build_extruder/EC-ecv22-
v2.03.3.hex
avrdude: can't open config file "/usr/local/etc/avrdude.conf": No such
file or directory
avrdude: error reading system wide configuration file "/usr/local/etc/
avrdude.conf"
scons: *** [upload] Error 1
scons: building terminated because of errors.

I ran the which command that returned this:
Brendans-MacBook:~ BHeffernan$ which avrdude
/usr/local/avr/bin/avrdude
But when I went there and tried to go into avrdude to see the
avrdude.conf file, it wasn't there. I did this:
Brendans-MacBook:bin BHeffernan$ type avrdude
avrdude is /usr/local/avr/bin/avrdude
Do I need to change that file name from avrdude to avrdude.conf?

The macAVR package I downloaded includes avrdude and it looks like it
used to be separate so maybe some config has changed as a result of
that. These are newbie mistakes I fear but it's what tripped me up.
I look forward to other's comments.

Brendan

Rob Giseburt

unread,
Sep 3, 2010, 3:01:25 AM9/3/10
to make...@googlegroups.com
I use Crosspack-AVR:
http://www.obdev.at/products/crosspack/index.html

Make sure your path includes /usr/local/CrossPack-AVR/bin

I think it includes instructions for this part.

-Rob

Koen Kooi

unread,
Sep 3, 2010, 3:14:25 AM9/3/10
to make...@googlegroups.com

Check /usr/local/avr/etc/ for a avrdude.conf and then copy (or symlink) that to /usr/local/etc/

regards,

Koen

Marty McGuire

unread,
Sep 3, 2010, 3:27:42 AM9/3/10
to make...@googlegroups.com
Also, make sure you're using "relays=true". Relays, plural. It took
me a little while to realize that "relay=true" does nothing, but
"relays=true" correctly adds the compile flag. :)

--Marty

Marty McGuire

unread,
Sep 3, 2010, 2:20:08 PM9/3/10
to make...@googlegroups.com
Alright! I found some time to play with the new firmware w/ extruder
heater relay support.

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

Marty McGuire

unread,
Sep 3, 2010, 2:24:38 PM9/3/10
to make...@googlegroups.com
Argh! Amazon S3 didn't like the "+" characters in those image URLs.

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

Andrew Plumb

unread,
Sep 3, 2010, 3:06:40 PM9/3/10
to make...@googlegroups.com
Heh. You were actually supposed to lower the Time Constant (T) and increase the Delay Time (L) to get both P and I to decrease.

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.

--

Marty McGuire

unread,
Sep 3, 2010, 4:36:24 PM9/3/10
to make...@googlegroups.com
Hi 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

Brendan

unread,
Sep 4, 2010, 4:23:17 PM9/4/10
to MakerBot Operators
I'm still in the doldrums...

Fixed the "avrdude: can't open config file "/usr/local/etc/
avrdude.conf": No such
file or directory" error by following Koen's instructions.

But, now, the "scons -f SConstruct.extruder port=/dev/tty.usbserial-
FTES209A relays=true upload" command returns "avrdude: ser_open():
can't open device "/dev/tty.usbserial-FTES209A": No such file or
directory". The /dev/tty.usbserial-FTES209A directory does exist
inside /dev. When I issue the same scons command except with port=/
dev/cu.usbserial-FTES209A, it works, shows a progress bar that uploads
to that port, and the command ends successfully but that port doesn't
actually communicate to the board. (Idea from here:
http://www.ladyada.net/learn/avr/avrdude.html).

RepG sees the cu.usbserial-FTES209A port but it won't use it. So I'm
guessing that for some reason avrdude has an issue with the driver
that is associated with the /dev/tty.usbserial-FTES209A port. Maybe
that means using decoupling the upload from scons and using the
CrosspackAVR as recommended. But, if anyone has any ideas, I'd
appreciate. Sorry I'm stuck in basic unixville.

Brendan

Rob Giseburt

unread,
Sep 4, 2010, 4:26:50 PM9/4/10
to make...@googlegroups.com
Try 'sudo scons ...'. (IOW, add 'sudo' to the beginning of the command.)

I use /dev/tty.usbserial-* but that's me.

-Rob

Brendan

unread,
Sep 4, 2010, 6:07:17 PM9/4/10
to MakerBot Operators
Thanks Rob. This helped.

I used sudo (had tried it a few times last night but think it had
timed out) and used the /dev/tty.usbserial-*. It works in terminal.
Have not successfully uploaded yet. It sometimes just errors out and
says "avrdude: stk500_recv(): programmer is not responding", sometimes
it starts writing and dies before completion (55% is furthest so
far). It may be timing or perhaps my communication parameters aren't
set quite right. Baby steps.

Brendan

Tom Cawkwell

unread,
Sep 4, 2010, 6:23:12 PM9/4/10
to MakerBot Operators
Great thread - I had exactly the same problem - thanks for solving it.

The settings that work best for me are:
P=5.143, I=0.0612, D=108

This holds the temps 0 to 4 degrees below target temp but this is
stable enough to perform well - at least until the Gen 4 electronics
show up.

Thanks,
Tom
> RepG temp graph:http://static.creatingwithcode.com.s3.amazonaws.com/temps_2010-09-02_...
>
> 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_...
> >>http://static.creatingwithcode.com.s3.amazonaws.com/temps_2010-09-03_...
>
> >> 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_...
>
> >> 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
>
> >> On Fri, Sep 3, 2010 at 3:27 AM, Marty McGuire <schmartiss...@gmail.com> wrote:
> >>> Also, make sure you're using "relays=true".  Relays, plural.  It took
> >>> me a little while to realize that "relay=true" does nothing, but
> >>> "relays=true" correctly adds the compile flag. :)
>
> >>> --Marty
>
> >>>> For more options, visit this group athttp://groups.google.com/group/makerbot?hl=en.
>
> >> --
> >> 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 athttp://groups.google.com/group/makerbot?hl=en.

Brendan

unread,
Sep 4, 2010, 6:27:54 PM9/4/10
to MakerBot Operators
Got it. +/- 2 degrees.

Thank you all very much for the help. I really appreciate the
expertise here. I'll post a summary of my steps later.

Brendan

Andrew Plumb

unread,
Sep 5, 2010, 12:42:27 AM9/5/10
to make...@googlegroups.com
Thanks Tom, Marty and Brendan for confirming P=5.143, I=0.0612, D=108 as the best set of values to date.

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.

Brendan

unread,
Sep 8, 2010, 12:54:04 AM9/8/10
to MakerBot Operators
What follows is a summary of how to do the steps above. It's my
account of how a relative newbie got his MK5 to hold temps within +/-4
degrees of setpoint (and +/-2 most of the time). My stats: new MK5,
batch 14 bot, HPB and MK5 both running through relay, Macbook running
10.6.3, RepG 18, MB v2.2, Extruder firmware v2.3, SkeinFox 1.5.

First, install a development environment on the Mac
1) Install XCode from your mac startup disk
2) Follow this page http://wiki.makerbot.com/v2-firmware to install
MacAVR, then MacPorts (requires XCode)
3) Build SCons by opening a terminal window and running "sudo port
install scons" as per the wiki page on v2-firmware.
The sudo command runs that command as a root user so you will be
prompted for your mac password. I believe the default timeout for
sudo is 5 minutes, so you'll be a root user for about that long.
There were a few commands during this process which require root
access to run and if you leave your computer for awhile may fail
unless you put sudo before them again.

Next, still following that same wiki page, get the code update that
fixes the problem.
1) Install git (I had done this already but basically, you download it
and install it)
2) Run the provided git command "git clone git://github.com/makerbot/G3Firmware.git"
-- this gets the updated code

Now, build the firmware that you will upload to your extruder
controller.
1) Change to the directory where git downloaded the new code "cd
G3Firmware/v2"
2) Build the firmware with this "scons -f SConstruct.extruder
relays=true"
3) Turn off your bot, and plug your usb-to-ribbon cable directly into
the Extruder board. Read the board to make sure orientation is
correct.
4) Prep to upload the firmware: I got an avrdude error at first, fixed
by following Koen's post and copying /usr/local/avr/etc/avrdude.conf
to usr/local/etc/ In other words "cd /usr/local/avr/etc", "ls" to
see if avrdude.conf is in there, then "cp avrdude.conf usr/local/etc/
avrdude.conf"

Finally, upload firmware like this:
a) "cd G3Firmware/v2/"
b) "sudo scons -f SConstruct.extruder port=/dev/tty.usbserial-*
relays=true upload"
Note that command is preceded with sudo, because mine returned an
error until I did so. So, the first time you run it you will be
prompted for your password. Don't worry, you'll run it a million
times. "tty.usbserial-*" is the serial port I'm using. My RepG uses /
dev/tty.usbserial-FTES209A, the -* is a wildcard as recommended by
Rob, but insert the name of your serial port here.
c) Now, run this command 50 times trying to get the timing of when
to press the Extruder controller reset button exactly right. The
extruder board can only load new firmware just after a reset, so
avrdude which is responsible for uploading the firmware must handshake
and start writing at just the right time. I would press reset, pause
a beat, then press enter on the command in the terminal window.
Several times it started writing and died 20%-50% through, but it
finally wrote all the way to 100%.

OK, hard part is done. Now, change your PID settings per Marty's
recommendation, power cycle, check that you're running off the new PID
settings and test. My PID settings are: P = 5.140625, I = 0.05859375,
D = 108.0

I didn't do the bug fix to stop problems with feed motor reversing.
And, it happened to me. As a workaround, I rolled my motor wires.

Thanks to this forum for getting me through this. I hope this write-
up helps someone.
Brendan

Chris Gray

unread,
Sep 11, 2010, 5:15:26 PM9/11/10
to MakerBot Operators
where could I get a binary drop of this firmware update?

On Sep 2, 5:41 pm, Marty McGuire <schmartiss...@gmail.com> wrote:
> Looks like Adam just committed a relay fix to the v2 version software
> of the extruder controller v2.2 (which most of us have).
>
> http://github.com/makerbot/G3Firmware/commit/a26e3035c149b49465edcdc1...
> > For more options, visit this group athttp://groups.google.com/group/makerbot?hl=en.- Hide quoted text -
>
> - Show quoted text -

flseidel

unread,
Sep 15, 2010, 6:34:39 PM9/15/10
to MakerBot Operators
Even with the new firmware and the pid changes, my MK5 hovers around
200º when I set it to 220º. Also, it changes 5.143 to 5.140625, and
0.0612 to 0.05859375, but it leaves 108 unaltered.
> > > also had issues with setting myPIDvalues back to their defaults
> > > after switching back to the MK4:
> > > 1) P parameter wouldn't "stick" to what i set (0.1 becomes 0.09765625)
> > > 2) temperature would hold at ~-7C below target -- raising P to 0.2
> > > (becomes 0.19921875) brought the temp up to target
> > > -- hope this isn't any sort of death knell, can anyone put my mind at
> > > ease?
>
> > > --
> > > 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 athttp://groups.google.com/group/makerbot?hl=en.-Hide quoted text -

Zach Smith

unread,
Sep 15, 2010, 7:30:13 PM9/15/10
to make...@googlegroups.com
have you insulated the heater block?  its a bit unwieldy, but it definitely helps keep the energy/heat in.  even if you just wrap it once with the white ceramic tape, that should do it.
--
Zach Smith
Director of R&D
MakerBot Industries

flseidel

unread,
Sep 16, 2010, 6:18:29 PM9/16/10
to MakerBot Operators
After insulating the heater block, my Plastruder held its temperature
to within 4º of the target. My PID settings are the ones recommended
on the firmware update screen in ReplicatorG 0019. Thanks for the
help.
> > makerbot+u...@googlegroups.com<makerbot%2Bunsubscribe@googlegroups.c om>
> > .
> > > > > For more options, visit this group athttp://
> > groups.google.com/group/makerbot?hl=en.-Hide quoted text -
>
> > > > - Show quoted text -
>
> > --
> > 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<makerbot%2Bunsubscribe@googlegroups.c om>
> > .

Achilles Boiser

unread,
Sep 16, 2010, 7:05:32 PM9/16/10
to make...@googlegroups.com
19?  I just started using 18!

To unsubscribe from this group, send email to makerbot+u...@googlegroups.com.

flseidel

unread,
Sep 17, 2010, 4:56:26 PM9/17/10
to MakerBot Operators
0019 was released on September 14.
> > <makerbot%2Bunsubscr...@googlegroups.c om>
> > > > .
> > > > > > > For more options, visit this group athttp://
> > > > groups.google.com/group/makerbot?hl=en.-Hide quoted text -
>
> > > > > > - Show quoted text -
>
> > > > --
> > > > 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<makerbot%2Bunsubscribe@googlegroups.c om>
> > <makerbot%2Bunsubscr...@googlegroups.c om>
Reply all
Reply to author
Forward
0 new messages