Who is here? 1 guest(s)
 Print Thread
TC4 with aArtisanQ_PID
greencardigan
Hi All,

This post is to help clarify what my aArtisanQ_PID code does and how it differs from the standard aArtisan code.

Like the base aArtisan code, aArtisanQ_PID supports the Artisan Visual Scope application for logging and control of a coffee roaster.

Here's a few points I put together some time ago when I was documenting the differences between the starndard aArtisan code and my aArtisanQ_PID code. There may be further differences but this should cover the major ones.

aArtisanQ_PID is a variation of aArtisan and has these additional features:

- Integral Cycle Control on OT1 (requires zero cross detector connected to IO3)
- Phase angle control on OT2 (requires zero cross detector connected to IO3)
- Analogue control of OT1 and OT2 (optional)
- Support for 4x20 LCDs
- Support for logging OT1 and OT2 power levels in Artisan
- Rate of Rise displayed on LCD
- PID control on OT1 (optional) including multiple roast profile storage on EEPROM and PID parameters adjustable on the fly
- Support for pBourbon Processing software

Currently (this may eventually change) I have my roast profiles stored on my laptop in a seperate Arduino sketch. When I want to change or add a profile I upload the sketch to the Arduino. The arduino will run the sketch and store the new profiles in the TC4 EEPROM. Once they are stored in the TC4 EEPROM I have to upload the aArtisanQ_PID code to the Arduino again.

The above profile loading only needs to be done if you are adding or updating profiles. Once they are in the EEPROM my aArduino code lets you select a profile using the optional TC4 buttons or by sending a serial command from Artisan. Otherwise it will use the first profile stored in the EEPROM which may be fine for some users.

I'll continue to update this thead if further developments are made.
 
allenb
Wow, you've put some major time and effort into this upgrade of Artisan! I didn't know you had added this many features to it.

So, before the work you did, there was no profile storing and running in any of the Artisan versions?

Also, can the TC4 with aArtisanQ_PID roast coffee via PID and run profiles without being connected to your computer?

Thanks for posting this update. greenman

Allen
1/2 lb and 1 lb drum, Siemens Sirocco fluidbed, presspot, chemex, cajun biggin brewer from the backwoods of Louisiana
 
allenb
Greencardigan wrote in a different thread:

"My current setup is doing phase angle control of my blower rather than the heater. But it is definitely possible to control the heater elements using phase angle control with my current set up. I'm just not sure if I could control both the heater and blower with phase control simultaneously. "


Being able to have the option of running the heat via phase angle control or regular duty cycling would be a nice feature.

I'm assuming this would require some additional code writing.

Allen
Edited by allenb on 05/30/2013 11:38 PM
1/2 lb and 1 lb drum, Siemens Sirocco fluidbed, presspot, chemex, cajun biggin brewer from the backwoods of Louisiana
 
greencardigan

Quote

So, before the work you did, there was no profile storing and running in any of the Artisan versions?

That is correct. None of the other versions of aArtisan currently support PID control and profiles. And it should be noted that Jim did all the phase angle control code. I just borrowed the best bits from all his other versions and added the PID and profile code. I have also expanded Jim's serial command set to allow better integration with Artisan.

The only other code for the TC4 that supported profiles is Kona which was written from the scratch. I have tried hard to keep aArtisanQ_PID based on aArtisan. When Jim does updates to aArtisan I try to bring those changes across to mine.

I hope someday that my changes can be incorporated back into the base aArtisan code so there is the option for PID control and profiles without the phase angle control and associated zero-cross circuitry for those who don't want to go down that path.


Quote

Also, can the TC4 with aArtisanQ_PID roast coffee via PID and run profiles without being connected to your computer?

Yes, a computer connection is not necessary. There are currently 3 options.

1. Computer running Artisan or other software that can send serial data to the TC4.

2. An LCD using the LCDapter and the input buttons. I can use the buttons to activate the PID, select profiles etc.

3. A smart phone (Android) with a bluetooth connection. This is how I am currently roasting.

I have started developing an Android application that allows me to control my roaster from my phone and I hope to start a new thread about this sometime. I just need to sort out an issue with the data being recieved back from the TC4.


Quote

Being able to have the option of running the heat via phase angle control or regular duty cycling would be a nice feature.

I'm assuming this would require some additional code writing.

I think I kind of covered this above. It will either require either rolling my changes back into aArtisan or combining the two and letting the user specify what control method to use when uploading to the Arduino.
Edited by greencardigan on 05/30/2013 11:57 PM
 
greencardigan
Also it would be good to hear from Jim as to whether we can have both outputs running with phase control simultaneously.
 
greencardigan
I have updated my code to include support for Roastlogger.

The Roastlogger mode isn't active by default but will become activated when it receives the LOAD command from Roastlogger. Otherwise the code can be tweaked to make it start in Roastlogger mode each time.

https://drive.goo...sp=sharing

See the first post in the thread for other features.
 
robschwieb
I've been doing tons of searching and reading the past few days trying to understand the PID function in conjunction with Artisan. I'm waiting for all my parts to arrive before I can tinker and figure it out myself so I figured I'd just ask.

It seems that the PID function is completely separate from Artisan program if I understand correctly? I just can't seem to find any documentation or guides on how the temperature set point is actually set. I remember reading something about it coming from an EEPROM value?

So, how do I go about setting it? Also, I would like to avoid a physical button enabling the PID control. Is there anyway to set the button in Artisan over serial? With that thought in mind, is it possible to create a button/s that increases and decreases the PID set point?

Thanks for any help or guidance!
 
greencardigan
Yes, the PID functionality is built into the Arduino code.

The roast profiles (times and setpoints) are stored on the TC4's EEPROM. There is a small Arduino sketch (called Profile_Loader) included with my aArtisanQ_PID package that you load onto the Arduino. This little sketch will load a profile onto the EEPROM. Then the aArtisanQ_PID sketch is reloaded and can use the profile stored on the EEPROM. This is probably not the most elegant way to load a profile onto the TC4 but that's all I've implemented at this stage.

You can set up a button in Artisan to turn the PID on and off over the serial connection. You need to send one of the PID commands. The PID set of commands includes:
PID;ON - Turns PID on
PID;OFF - Turns PID off
PID;GO - Resets TC4 Timer and turns PID on
PID;STOP - Turns PID off, turns OT1 off and sets OT2 to auto cool level
PID;Px - Selects profile x
PID;T;p;i;d - Sets PID parameters p, i and d. This command needs a slight adjustment to the standard TC4 library.

At this stage the setpoint can't be adjusted from Artisan. I had discussions with the Artisan team some time ago about this but it was not implemented.

As I mentioned in a previous post, my code is now compatible with Roastlogger which can do it's own PID calculation and send a calculated heater output to the TC4.
 
robschwieb
Thanks for all the useful information! I knew I had to be missing something obvious and sure enough, I was. I wish Artisan would focus a bit more on the control side of things seeing as the datalogging is practically perfect IMO.
 
brennn
Did anyone get the 'PID' does not name a type error when they went to compile this code?
 
brennn
Is there a library for aArtisan_PID that I forgot to include?
 
greencardigan
You do need to have the PID_V1 library in with the other TC4 libraries.
 
robschwieb
Have there been any known issues with receiving serial prints? For example, I can send READ and get the values back in the serial monitor. When I send UNITS;F I don't get a response like the sketch indicates I should but when I send READ I can see that it did actually change the units.

Am I once again missing something obvious or do I not have something setup correctly?
 
JimG
In user.h, ACKS_ON is undefined by default. If you want to change the default behavior and receive responses to commands, uncomment the line in user.h to enable ACKS_ON.

Jim

PS - Brad: fantastic work on this code!! Please add the appropriate attributions in the code so people won't mistakenly expect similar quality from me in the future ;-)
 
robschwieb
Thank you. I feel like such an idiot! I think I've been spending too much time reading up on this stuff that I've been forgetting my coffee intake...
 
greencardigan
I seem to recall that I could not get the ACKS_ON code to work. I think it was causing my code to lock up or something but I never tried to debug.

Welcome back Jim!
 
robschwieb
Yeah, I tried with the ACKS_ON and the Arduino was completely unresponsive. So I tried commenting out all the #ifdef ACKS_ON and corresponding #endif's while leaving ACKS off and it still was unresponsive.
 
greencardigan
Try leaving ACKS OFF and only comment out the #ifdef ACKS_ON for the ones you need.
 
robschwieb
That's what I tried, it kept freezing up though. Not a big deal at the moment but I'll probably continue to play with it when I get the larger aspects taken care of.
 
greencardigan
I'll try to look into it if I get a chance.
 
robschwieb
Is there a newer version of your code than 3.7? I ask because I can't seem to find PID;GO or STOP in the code that I have?
 
greencardigan
There is a version 4 that I linked to earlier in this thread.

The google code site no longer allows downloads to be created so the latest version can be downloaded here. It is version 4_1.

https://drive.goo...sp=sharing

Note that my aArtisanQ_PID code is still being developed and has not been widely used and tested.
 
greencardigan
Looks like I must have broken the Artisan code when I added the Roastlogger support. Version 4_0 and onwards breaks when receiving the READ command.

I will investigate.
 
greencardigan
I have made a little change and created a download for version 4_2. If the READ command could be tested with this version that would be appreciated. It seems to be working for me.

https://drive.goo...sp=sharing
 
greencardigan
Another update.

This version should fix the Artisan READ command issue. Also, I have changed the code so the logging software needs to be defined in user.h. Currently the options are Artisan, Roastlogger and pBourbon.

aArtisanQ_PID version 4_3

https://drive.goo...sp=sharing
 
Jump to Forum: