topbanner.gif
Login
Username

Password




Not a member yet?
Click here to register.

Forgotten your password?
Request a new one here.
Shoutbox
You must login to post a message.

snwcmpr
09/18/2019 4:09 AM
JavaBob ... You will get more response if you post a question on the forum rather than the shoutbox.

Mathew
09/17/2019 5:50 AM
check out the Hive Roaster!

JavaBob
09/16/2019 4:03 PM
Has anyone used a Leister hot air blower to roast coffee and if so, which model did you use? What was your experience like?

JavaBob
09/16/2019 3:53 PM
Source for customable borosilicate glass cylinders for use as a roasting chamber?

shoron
09/06/2019 7:25 AM
how to make medium raw colored beans to dark ?

Users Online
Guests Online: 2

Members Online: 0

Total Members: 6,138
Newest Member: Clavilux
In Memory Of Ginny
Donations

Latest Donations
renatoa - 2.00
allenb - 25.00
snwcmpr - 10.00
Groveland Hill Roas... - 25.00
renatoa - 2.00

View Thread

Who is here? 1 guest(s)
 Print Thread
Artisan -> TC4 PID commands question
elkayem
I have a question about the Artisan commands to the TC4. I would like use the TC4 commands in my own design, but struggling to get Artisan to send any of the PID commands (e.g., PID,ON or PID,OFF or PID,SV,vvv).

I am currently running Artisan 1.5.0. In my setup, I have selected TC4 in the Device Assignment, and have both the "Control" and "PID Firmware" checkboxes ticked. (Yes, my microcontroller is running it's own PID loop.) The COM port and baud are both correct, and when I press the "ON" button, Artisan is sending READ commands and receiving temperature, heater, and fan duty cycle data in reply. After that, when I press "START", I am able to log data from my microcontroller.

When I press the "Control" button in Artisan, I get a PID Control dialog, which I think should allow me to send the PID serial commands. I expect that when I press the On button in this dialog then Artisan should send a PID, ON command. And I expect that I should be able to use the same dialog to send PID, SV, vvv commands in manual mode.

However, when I watch the Serial Log in Artisan, all I see going out are READ commands. I can't get the PID Control dialog to send any other type of TC4 command.

I feel like there is something basic I am missing here.

Anyone with any tips?
 
greencardigan
Yes, clicking 'On' from the control dialog should send a PID;ON command.

Then if you have selected manual mode for the PID, you need to update SV field (set variable) and click 'Set' so Artisan sends the PID;SV;vvv command.

I don't think the serial log in Artisan shows all the the serial data. It might be only the read command and returned data.
 
elkayem
Thank you! I hadn’t realized that the Serial Log only showed READ commands. If the PID commands are going out, then the problem almost certainly lies with my parsing code. I think I spot the problem already. I see you are using a semicolon as the separator, while I had assumed it was a comma.

Also, thank you for your fantastic work on the Artisan TC4 PID software. It is an inspiration for my own efforts, and something to aspire to. I don’t have a TC4, but instead am working on something similar in the spirit of DIY.
 
greencardigan
The TC4 code accepts a few different delimiters including comma and semi colon. However the Artisan code will send commands using a semi colon delimiter.
 
Want to Help?
By donating you can ensure that HR will continue to be open for years to come. Expenses are 100% transparent and can be viewed publicly at all times. You can find more information on donations and why we request them by reading up on the forum topic here. Thank you.

elkayem
Hmm, it is something else... I am printing out all of the Serial messages from Artisan on an OLED screen, and the only messages I ever see are "CHAN; 1234" and "READ". There are no additional messages when I press the On or Off buttons on the PID Control dialog, or press the Set button to manually set the SV.

I do have the "PID Firmware" box checked in the Device Assignment dialog, but is there something else Artisan requires in order to send PID commands? Is there some kind of Serial message Artisan is looking for to confirm there is a TC4 with a PID controller on the other end?
 
renatoa
CHAN, then UNITS, then FILT, then you can start with READs

Download source  Code

                    command = "CHAN;" + et_channel + bt_channel + "00"
...
                    result = self.SP.readline().decode('utf-8')[:-2]  #read
                    if (not len(result) == 0 and not result.startswith("#")):
                        raise Exception(QApplication.translate("Error Message","Arduino could not set channels",None))
                    elif result.startswith("#"):
                        #OK. NOW SET UNITS
...
                        command = "UNITS;" + aw.qmc.mode + "\n"   #Set units
                        self.SP.write(str2cmd(command))
...
                        result = self.SP.readline().decode('utf-8')[:-2]
                        if (not len(result) == 0 and not result.startswith("#")):
                            raise Exception(QApplication.translate("Error Message","Arduino could not set temperature unit",None))
                        else:
                            #OK. NOW SET FILTER
...
                            command = "FILT;" + filt + "\n"   #Set filters
                            self.SP.write(str2cmd(command))
...
                            result = self.SP.readline().decode('utf-8')[:-2]
                            if (not len(result) == 0 and not result.startswith("#")):
                                raise Exception(QApplication.translate("Error Message","Arduino could not set filters",None))
                            else:
                                ### EVERYTHING OK  ###
                                self.ArduinoIsInitialized = 1
                #READ TEMPERATURE
                command = "READ\n"  #Read command.
...
                self.SP.write(str2cmd(command))





Having ArduinoIsInitialized set to 1 is mandatory for access to other features.
And this happens only after this commands sequence ... you can check further sections of the code, for "if aw.ser.ArduinoIsInitialized:" to find you have no access to PID features if not true.
 
greencardigan
Thanks Renatoa, that code reminded me that Artisan is expecting a response to the CHAN command.

When the CHAN;1200 command is received, your code needs to respond with a string starting with #. It doesn't matter what the rest of the string is as long as the first character is a #.
 
renatoa
As for all other commands following CHAN.
 
elkayem
That did it, thank you! Responding to CHAN with # cleared the logjam, and now I am able to send PID ON/OFF commands, as well as set the SV and DCFAN speed. This is exactly what I was hoping to do.

Renatoa, thank you for sending the code snip. That cleared everything up. Now why didn't I think of just digging into the Artisan code?!

As written in the code, the only thing required is the # response to the CHAN command, since the other readline() calls will time out and the code drops to the ArduinoIsInitialized = 1 line. I've confirmed that is the way it works. However, it does appear that the author intended to require a # response to the UNITS and FILT commands as well. To be on the safe side, I'm going to add a # response to those messages as well, just in case the code is ever updated to be more strict.
 
Gullygossner
elkayem wrote:

I don’t have a TC4, but instead am working on something similar in the spirit of DIY.


Out of curiosity what hardware are you using to achieve something similar to the tc4 setup?
 
elkayem
Gullygossner wrote:

elkayem wrote:

I don’t have a TC4, but instead am working on something similar in the spirit of DIY.


Out of curiosity what hardware are you using to achieve something similar to the tc4 setup?


I am using a Teensy 3.5 dev board mounted to a custom PCB. I’ve published the code and schematics here: https://github.co...feeRoaster. No photos of the board there yet, but I should be able to post some by the weekend.
 
Gullygossner
Very nice build!
 
elkayem
Thank you! It’s a work in progress, and probably always will be.
 
Jump to Forum:

Similar Threads

Thread Forum Replies Last Post
Artisan to Arduino set up help Drum Roaster (Store Bought and Commercial) 8 04/22/2019 3:57 PM
Newbie question - Buttons on Artisan Dataloggers/Controllers/Rate of Rise Meters 3 04/12/2019 10:08 AM
Artisan Roasting to the Nth degree? Other Roasters 3 03/13/2019 6:06 AM
Arduino MAX31855 to Artisan Dataloggers/Controllers/Rate of Rise Meters 19 03/04/2019 8:48 AM
Using TC4C with Artisan Dataloggers/Controllers/Rate of Rise Meters 18 02/14/2019 11:39 AM
Homeroasters Association Logo, and all Content, Images, and Icons © 2005-2016 Homeroasters Association - Logos are the property of their respective owners.
Powered by PHP-Fusion Copyright © 2019 PHP-Fusion Inc
Released as free software without warranties under GNU Affero GPL v3
Designed with by NetriX