Who is here? 1 guest(s)
 Print Thread
Spontaneous Exceptions in Artisan with TC4+

I recently added TC4+ to my build and now able to track roasts with Artisan.
For unknown reason I'm getting the following error from time to time:

Exception: sample() list index out of range@line 13435

Sometimes I can roast 5-6 times in a row, but usually I can't even start roasting due to this issue.
In the beginning of the process once On button clicked, when I try to increase Fan the result is either ok or it throws out this error.
When the error appears there's no more data updates on LCDs and graphs.
And sometimes there's no issue at all, so I can just start roast.

I can't figure out what's the root cause. I already re-flashed the TC4+ several times, checked the wirings, re-installed the Artisan and re-configured it from scratch.

Could someone please point me where to look? I wish I could find what parameter in particular is out of range, but I couldn't even find any file with 13435 lines in it.
rk27 attached the following image:

Edited by rk27 on 11/22/2020 4:34 AM
This happens only right when you increase the fan speed? What kind of fan are you using, how is it connected to the TC4+, and (if it's a DC fan) what kind of power supply are you using?

Are you connecting the TC4+ via USB or bluetooth?
Please check your additional devices list, if you have there the ArduinoTC4_56 device remove it.
For an unknown reason, the TC4 packet seems too short for me, so an attempt to extract data for the device above should raise the list index out of range error.
My guess... can't dig more because the line above 13435 does not match a relevant line of code from the V2.4.2 source. Maybe the author will find more.


mg512 wrote:

This happens only right when you increase the fan speed? What kind of fan are you using, how is it connected to the TC4+, and (if it's a DC fan) what kind of power supply are you using?

Are you connecting the TC4+ via USB or bluetooth?

TC4+ connected via bluetooth. I'm using DC fan with its own driver board, so I only take PWM signal and 5V from the TC4+ board, and I can control it with IO3 command.

This error throws up also when I try to control the heater with OT1 command.

I also noticed that when at the beginning LCDs show '-1' for heater and fan, it means that the issue will take place. If there are zeros then it's fine.

I'm trying once again to do a factory reset in Artisan now, and will try to enable option by option.
I am pretty sure it is a configuration issue, and not something specific to TC4+, so thread title could be misleading.

The excerpt below, from the stream you are receiving...


Rx = ['32.2', '21.9', '23.5', '0', '11', '0']

is decoded as this list of values:


Ts= 21.90, 23.50, -1.00, -1.00, 0.00, 11.00

whose meaning are:

ET = 21.90, BT = 23.50, T3=-1.00(missing sensor on ch3), T4=-1.00, Power=0.00, FAN=11.00

Is FAN value accurate ? If 11 is not a Fan value, but heater... then we have a possible problem...

The fact that power is zero, and you claim this happens when you try send an OT1 could led you perhaps to a command syntax error in Events/Sliders dialog...

But the "list index out of range" error tell me that Artisan thinks it should have more than 6 values in the received stream, and try to access a value past the end of the received values list.
This sounds as a configuration issue in Artisan, not TC4. Extra devices that should not be selected maybe.
hey renatoa,
thanks for your suggestions!
You're right that it doesn't look like TC4+ issue. I hope I didn't offend anyone.

I tried to delete ArduinoTC4_56 and it did help.

I also spent another hour re-configuring Artisan and found the affecting setting. It is Curves>Filters>Input Filter Limits. When Limits setting is on I get this error 100% of time. (I'm wondering how it was working previously as I don't think I did any changes to this setting).

Fan and heater values are correct. When I increase Fan by 11 or any other value it works as expected, same for heater.

Regarding Rx and Ts decoded values, I'm not sure I can fully understand the mapping between them.
According to the read command spec:

Rx = ['32.2', '21.9', '23.5', '0', '11', '0']
two zeroes here are for heater and SV, which is correct.

And once decoded
Ts= 21.90, 23.50, -1.00, -1.00, 0.00, 11.00
you also noted T3 (ch3?), T4 and Power. Do you know if there's a proper docs to understand the meaning of these?
rk27 attached the following image:
By Power I meant heater. Can be labelled also as Burner for a gas setup.

I am not aware about such documentation, other than the text document with TC4 commands syntax, and internal programmer notes.
I know TC4 source by heart, and some parts of Artisan that were of interest for me, this is the source of knowledge.

T3 and T4 are channels 3 and 4 indeed, not allocated.
When initializing link with TC4, Artisan sends a CHAN command, that looks like CHAN;1200 or CHAN;2100, depending which channels order is selected for BT/ET.
The two zeroes from CHAN command means the channels 3 and 4 are unused, not present in the received stream, thus not subject of decoding, simply set to -1.
What if you want to read an additional 3rd temperature ? You add an extra device type choosing "ArduinoTC4_34".
There is also another extra device called "ArduinoTC4_56" for Heater (OT1) and Fan.
Finally, "ArduinoTC4_78" is used for the PID SV and ambient temperature (first value in the Rx stream).
Ambient is actually TC4 internal temperature, if mounted in a not well vented case it could be very erroneous far from the real ambient. Seems your case, AT is 10 degrees more than BT/ET, not so right Grin
Edited by renatoa on 11/22/2020 6:38 AM
Huh, interesting. My first guess would have been that the inrush current from the motor overloads the power supply, but clearly that would have been way off!

If this does happen again, you could also try removing the BT_RESET jumper on the TC4+, or even try USB. With Bluetooth Artisan doesn't always seem to detect if the device or connection isn't ready yet, and sometimes sends commands before the Arduino is able to receive them. I wonder if there is a "chan" command getting lost here, that could be the root cause of the issue.
No chance to lose commands without being notified.
If Artisan don't get an ack reply from TC4, for any of the first three commands (CHAN, UNITS and FILT), sent in sequence at the beginning of a roast, an error is issued (""Arduino could not set ..."), can be seen in Errors dialog.
Then, after a break, the three commands are attempted again.
If you see the temperatures, this means all three initialization commands were acknowledged, and READ commands are sent to acquire temperatures.
Edited by renatoa on 11/24/2020 1:52 AM
Jump to Forum: