Configuring Artisan PID

Discuss roast levels and profiles for espresso, equipment for roasting coffee.
taildraggin

#1: Post by taildraggin »

Hi: I've put together a Poppery 1 with a TC4C, Artisan 0.8.0 and the aArtisanQ_PID 4.3 sketch. Manual control works great through Artisan. The problem is with setting up the PID.



I've checked that profile_loader adds my values to the eeprom, but it appears that aArtisanQ_PID clears or overwrites them when I subsequently upload it. Any idea how to keep the profile_loader values?

Also, can't Artisan drive the PID functions through its "Control" button/settings? I've haven't sorted that out and can't find any docs. I think I'm missing something simple. Any assistance appreciated!

-TD

User avatar
MaKoMo

#2: Post by MaKoMo »

Dear Charlie,

Nice setup! Let me give you some background on that first (as far as I am aware of it). The aArtisanQ_PID sketch for the TC4 is a fork of the regular aArtisan sketch by Brad to control his roaster using the popular Arduino PID library by Brett. More recently Jim, the original author of the TC4 and aArtisan sketch decided (by being pushed a bit) to join in that fork into the regular aArtisan development. As result, the actual aArtisan v3.00 (ready for download from the main TC4 page on GoogleCode) sketch integrates most of Brad's work on from aArtisanQ.

As a consequence of the aArtisan integration of the PID functionality, the Artisan support for the TC4 was extended by a GUI to configure this PID. Note however, that Artisan assumes the aArtisan v3.00 sketch loaded on the TC4 and not the aArtisanQ_PID (also they have some things in common).

Using this GUI, you can set the p-i-d parameters and change the SV (set value) of that PID. While the p-i-d parameters are configured using value boxes and a "Set" button, the SV can also be set by a similar means. However, it can also be set via an additional row of buttons (similar to those of the Fuji PID support in Artisan), an extra SV slider, a system of ramp-soak patterns (as available in most PIDs like the Fuji's) or a background-follow mode (incl. an time offset/lookahead). In contrast to the Fuji ramp-soak system, this one is computed on the Artisan side (essentially sending corresponding SV settings to the TC4 at regular intervals). However, the PID function itself is always computed on the TC4. The PID can also be turned on and off using buttons or by a cmd-click to the "Control" button.

Additionally, Artisan v0.8 has been extended by additional TC4 extra device channels (ArduinoTC4_56 and ArduinoTC4_78) to enable the logging of the heater % and SVs. However, this extension require an extension of the current published v3.00 sketch of aArtisan and Jim not yet integrated support for this. This is why all this is not yet documented as it waits since half a year for completion and testing. Hope Jim will soon come around with this.

So all this is a bit experimental and not widely used, but works for me on my Hottop/TC4.

Please note also that the serial speed of aArtisan v3.00 is 115200 baud (the new default in Artisan v0.8 for the TC4), while aArtisan v2.00 communicated at 19.200.

Best,
Marko

User avatar
MaKoMo

#3: Post by MaKoMo »

One thing I forgot. You can select any of the 4 channels of the TC4 to be used for control via the source popup.

taildraggin

#4: Post by taildraggin »

Marko:

Great clarification. These are all the functions I'd like to access. Since we have a bit of doc gap (and my code reading skills are limited), I must ask you about a few more details. Still struggling to get the PID to fire off.
  • - Moved the aArtisan v3.00 libs to /arduino/libraries and uploaded the v3.00 sketch to the arduino.
    - Configured the "Control" GUI elements: PID (5-.15-0), mode "Manual", created SV slider and buttons and selected "Start PID on Charge".
    - Hit PID "On" and Artisan status line (upper right) acknowledges PID ON.
What's left to start the control?

(Also, it seems I lost the ZCD control to the -10 SSR for the fan.)

Thank you for your help.

User avatar
MaKoMo

#5: Post by MaKoMo »

Not sure what is missing. That setup works out of the box for controlling a TC4-equipped Hottop. All this GUI does is to send the commands
PID;OFF
PID;ON
PID;T;kp;ki;kd
PID;SV;n
to the aArtisan running on the TC4. Might be that there is another difference between the aArtisan v3.00 and the aArtisanQ_PID sketch that I am not aware. Here you either need to take a look into those sketches or ask Jim and Brad for support. It might be possible to run Artisan v0.8 with the aArtisanQ_PID sketch too as this implements similar serial commands as far as I know. Please ask the authors of those sketches for details.

As noted before, this PID control is some unfinished work that requires the coordination of three busy people and got stuck at one point. In an ideal world all those pieces would grow together making most setups to work out of the box. We are not there yet. Sorry.

User avatar
slickrock

#6: Post by slickrock »

taildraggin wrote:Marko:
(Also, it seems I lost the ZCD control to the -10 SSR for the fan.)
Been out the fray for awhile and missed this interesting thread. So, were you able to get Artisan 0.8 correctly controlling the PID on the TC4? What final sketch did you end up using?

Marko,
Are you sure about aArtisan v3.0 having PID command support? I went through the entire sketch and include files and found no such support with the version that can be downloaded from the main TC4 page on GoogleCode. Perhaps you were referring to another branch version from v.30? Where can I get the sketch you are referring to in this thread?

Thanks ahead of time.
07/11/1991, 08/21/2017, 04/08/2024, 08/12/2045

User avatar
MaKoMo

#7: Post by MaKoMo »

slickrock wrote:Marko,
Are you sure about aArtisan v3.0 having PID command support? I went through the entire sketch and include files and found no such support with the version that can be downloaded from the main TC4 page on GoogleCode. Perhaps you were referring to another branch version from v.30? Where can I get the sketch you are referring to in this thread?
Sorry, it is the trunk version of aArtisan on GoogleCode I should have referred to. Still waiting for JimG, how is the author of this, to add above extension in some form and release this as a new version of aArtisan. However, I did not hear back from him since weeks.

Marko

User avatar
slickrock

#8: Post by slickrock »

MaKoMo wrote:
Additionally, Artisan v0.8 has been extended by additional TC4 extra device channels (ArduinoTC4_56 and ArduinoTC4_78) to enable the logging of the heater % and SVs. However, this extension require an extension of the current published v3.00 sketch of aArtisan and Jim not yet integrated support for this.
Marko,

I've got Artisan 0.8 and the April PID version of Jim's aArtisan sketch (i.e. the one with the integrated PID capability) loaded on the TC4 - both are integrated now and I must admit it's quite thrilling to see this all working, especially with background profile tracking in "action". I'm in the process of PID tuning and I have a few questions for you that would prove helpful for this activity:

1. How do I output T3 and T4 thermocouples for the TC4. I've added the extra device for ArduinoTC4_34 and set "Y3" and "Y4", but it doesn't seem to work... it only outputs 0.0 on the LCD.

2. When the PID is on, the READ command outputs a comma-delimited line of: thermocouple temp outputs (T1,T2,T3,T4) as well as the Heater% (OT1), Fan out (OT2), and SV. How can I get the Heater% value set by the PID outputted on the graph? I'm assuming I should added an "Extra Device". I've enabled ArduinoTC4_56 and set "Y5" and "Y6", but it doesn't seem to work... it only outputs 0.0 on the LCDs and no graphs, respectively. Show I use some other variable to denote heater%, Fan%, and SV's?

3. What does the LookAhead setting do in the PID dialog box? Does this allow to Artisan to set the SV value that is n-seconds ahead according to background or ramp/soak settings? If so, this could be quite useful since PID control works best when the SV remains stable for period of time as opposed to continually changing the value as the Artisan tracks the profile.

4. What does "AT Channel" setting (default is "none") when configuring the TC4 in the device settings?

Thanks ahead of time.
07/11/1991, 08/21/2017, 04/08/2024, 08/12/2045

User avatar
slickrock

#9: Post by slickrock »

MaKoMo wrote: The T3/T4 temperatures you should get by that extra device as you describe. No idea why it does not work for you.

The PID output you will receive using the _56 and _78 extra devices.

The lookAhead can be used in combination with the BackgroundFollow mode. The SV values are then taken from the corresponding background curve (if a background profile is loaded). This is to duplicate a previous roast. The lookAhead might be useful to compensate for the slow reaction of the PID.
Hi Marko,

Still having difficulty getting T3,T4, and Heater%/Fan% output onto the Artisan Graphs and LCDs, even then trying version 0.9 Artisan. Referring to attached snapshot of the Extra Devices Dialog below, Have I specified anything wrong here? Are the "Yn" expressions entered correctly?:
  • Y3=T3
    Y4=T4
    Y5=Heater%
    Y6=Fan%
    Y7=SV?
    Y8=ambient temp?


When using the Serial Log, and turning on the PID control, I got this output:

339 23:28:23.846 ArduinoTC4 :/dev/cu.HC-06-DevB,9600,8,N,1,1 || Tx = READ || Rx = [u'36.83', u'25.49', u'14.16', u'24.88', u'16.30', u'100', u'0', u'237.00']|| Ts= 25.49, 14.16, 24.88, 16.30, 100.00, 0.00


From what I can tell, it looks like the TC4 is returning 8 comma-separated values, as expected based on the Rx string: Ambient, T1,T2,T3,T4,Heater%,Fan%,SV. Is the Ts string a representation of the parsed values?... looks like its picking up values, except SV and Ambient. Even so, I get 0.0 on all the corresponding LCDs except for ET/BT.

By the way, I had to lower the baud rate since I'm using Bluetooth adapter at its default baud rate. I doubt this is causing any problems, since Artisan works fine wirelessly with TC4/Bluetooth setup during usual roast tracking operations.

Question: Can I use ArduinoTC4_56 without ArduinoTC4_34 (i.e. output heater % without having to extra thermo couples besides ET/BT)? If I using only ArduinoTC4_56, I get an index out of range error.

Based on your comments about lookahead, just need a confirmation that the seconds setting value (n) will make Artisan set the SV based on the background profile SV n-seconds further down the profile during the run? For example, lets say you have a background profile where ( at T=5:00, SV=150) and (at T=5:05, SV=160), does Artisan send PID,SV,160 to the TC4 at T=5:00 if the lookahead is set to 5s?

On an unrelated note, for version 0.9, I noticed that there are Filter settings edit boxes for each of the 4 T probes for the TC4 device setup. What is the purposed of this?

Assistance appreciated.
07/11/1991, 08/21/2017, 04/08/2024, 08/12/2045

User avatar
MaKoMo

#10: Post by MaKoMo »

Remove anything in the y1(x) and y2(x) fields and it should work as expected.

Marko