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.

her63
Offline
· 06/02/2020 9:10 AM
keep healthy bro, love roaster form home

pisanoal
Offline
· 05/27/2020 10:14 AM
Anyone else have issues seeing the whole window of a thread when accessing from a mobile phone? Any fixes?

allenb
OfflineAdmin
· 04/02/2020 4:50 AM
Morning Ed, I haven't done any green coffee hoarding yet but am hoping the supplies don't end up like the toilet paper isles!

snwcmpr
Offline
· 03/31/2020 2:53 PM
Hey Ed. Thanks. roar

homeroaster
Offline
· 03/31/2020 11:21 AM
Hey quarantined home roasters! I hope you have great coffee! If they have a run on coffee, I hope you're set with your great home roast! Find me on Facebook! Ed Needham

Users Online
Guests Online: 3

Members Online: 0

Total Members: 6,593
Newest Member: goat4hooves
In Memory Of Ginny
Donations

Latest Donations
Anonymous - 5.00
Anonymous - 5.00
renatoa - 2.00
JitterzZ - 2.01
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.
 
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



                    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

Quote

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

Quote

Gullygossner wrote:

Quote

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.com/elkayem/CoffeeRoaster. 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
Kaldi Fortis and Artisan ROASTING SOFTWARE APPS 3 05/27/2020 11:38 AM
Min specifications to run Artisan ROASTING SOFTWARE APPS 4 05/12/2020 6:02 AM
Behmor 1600 question Roasting Coffee 9 05/11/2020 5:37 PM
TC4/Artisan showing "-1" Dataloggers/Controllers/Rate of Rise Meters 29 03/23/2020 3:37 PM
need artisan help Roasting Profiles 9 03/22/2020 4:35 PM
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 © 2002 - 2020 by Nick Jones.
Released as free software without warranties under GNU Affero GPL v3.
Designed with by NetriX