Who is here? 1 guest(s)
 Print Thread
Setting up TC4 version 4
tony359
Hello all,

MANY years ago I came to this forum to discuss the TC4 as a electronic reflowing device. I eventually got the board but never used it, it was one of my "to do" projects which I never started, ops!

I'd like to try again. But I am struggling with the setup and I was hoping you could help me.

In particular, I believe Roastlogger is the only software available for Windows (correct? I could use a RPi if Artisan is much better) so I followed the instructions found here: https://homeroasters.org/forum/viewthread.php?thread_id=3564

But when I compile the sketch I receive a long error message:


Arduino: 1.8.13 (Windows 10), Board: "Arduino Uno"





















In file included from C:\Users\anton\Desktop\TC4\aArtisanQ_PID\RoastLoggerTC4_2.0a\RoastLoggerTC4\RoastLoggerTC4.ino:112:0:

C:\Program Files (x86)\Arduino\libraries\thermocouple/thermocouple.h:110:27: error: variable 'typeK::coeff_inv' must be const in order to be put into read-only section by means of '__attribute__((progmem))'

     static PROGMEM PFLOAT coeff_inv[10][3];

                           ^~~~~~~~~

C:\Program Files (x86)\Arduino\libraries\thermocouple/thermocouple.h:111:27: error: variable 'typeK::range_inv' must be const in order to be put into read-only section by means of '__attribute__((progmem))'

     static PROGMEM PFLOAT range_inv[2][3];

                           ^~~~~~~~~

C:\Program Files (x86)\Arduino\libraries\thermocouple/thermocouple.h:113:27: error: variable 'typeK::coeff_dir' must be const in order to be put into read-only section by means of '__attribute__((progmem))'

     static PROGMEM PFLOAT coeff_dir[11][2];

                           ^~~~~~~~~

C:\Program Files (x86)\Arduino\libraries\thermocouple/thermocouple.h:114:27: error: variable 'typeK::range_dir' must be const in order to be put into read-only section by means of '__attribute__((progmem))'

     static PROGMEM PFLOAT range_dir[2][2];

                           ^~~~~~~~~

C:\Program Files (x86)\Arduino\libraries\thermocouple/thermocouple.h:115:27: error: variable 'typeK::a' must be const in order to be put into read-only section by means of '__attribute__((progmem))'

     static PROGMEM PFLOAT a[3];

                           ^

C:\Program Files (x86)\Arduino\libraries\thermocouple/thermocouple.h:131:27: error: variable 'typeT::coeff_inv' must be const in order to be put into read-only section by means of '__attribute__((progmem))'

     static PROGMEM PFLOAT coeff_inv[8][2];

                           ^~~~~~~~~

C:\Program Files (x86)\Arduino\libraries\thermocouple/thermocouple.h:132:27: error: variable 'typeT::range_inv' must be const in order to be put into read-only section by means of '__attribute__((progmem))'

     static PROGMEM PFLOAT range_inv[2][2];

                           ^~~~~~~~~

C:\Program Files (x86)\Arduino\libraries\thermocouple/thermocouple.h:134:27: error: variable 'typeT::coeff_dir' must be const in order to be put into read-only section by means of '__attribute__((progmem))'

     static PROGMEM PFLOAT coeff_dir[15][2];

                           ^~~~~~~~~

C:\Program Files (x86)\Arduino\libraries\thermocouple/thermocouple.h:135:27: error: variable 'typeT::range_dir' must be const in order to be put into read-only section by means of '__attribute__((progmem))'

     static PROGMEM PFLOAT range_dir[2][2];

                           ^~~~~~~~~

C:\Program Files (x86)\Arduino\libraries\thermocouple/thermocouple.h:151:27: error: variable 'typeJ::coeff_inv' must be const in order to be put into read-only section by means of '__attribute__((progmem))'

     static PROGMEM PFLOAT coeff_inv[9][3];

                           ^~~~~~~~~

C:\Program Files (x86)\Arduino\libraries\thermocouple/thermocouple.h:152:27: error: variable 'typeJ::range_inv' must be const in order to be put into read-only section by means of '__attribute__((progmem))'

     static PROGMEM PFLOAT range_inv[2][3];

                           ^~~~~~~~~

C:\Program Files (x86)\Arduino\libraries\thermocouple/thermocouple.h:154:27: error: variable 'typeJ::coeff_dir' must be const in order to be put into read-only section by means of '__attribute__((progmem))'

     static PROGMEM PFLOAT coeff_dir[9][2];

                           ^~~~~~~~~

C:\Program Files (x86)\Arduino\libraries\thermocouple/thermocouple.h:155:27: error: variable 'typeJ::range_dir' must be const in order to be put into read-only section by means of '__attribute__((progmem))'

     static PROGMEM PFLOAT range_dir[2][2];

                           ^~~~~~~~~

exit status 1

Error compiling for board Arduino Uno.



This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.


Can someone point me to the right direction please?

Thanks!
 
renatoa
Artisan is also available for Windows.
 
renatoa
The libraries in archive is obsolete, get the latest thermocouple library from the project repository.

Or, edit the lines in error adding "const" as below :


    static PROGMEM const PFLOAT coeff_inv[10][3];
    static PROGMEM const PFLOAT range_inv[2][3];
    // direct coefficients
    static PROGMEM const PFLOAT coeff_dir[11][2];
    static PROGMEM const PFLOAT range_dir[2][2];
    static PROGMEM const PFLOAT a[3];


For me compiled fine with the latest thermocouple library and Arduino 1.8.13 .
 
tony359
Thank you!

Would you be able to point me to the project repository for both the artisan and the roastlogger please? I tried compiling the Artisan sketch earlier on following a guide I found on the artisan website but it ended up in lots of errors too.

https://github.com/greencardigan/TC4-shield/tree/master/applications/Artisan/aArtisan_PID/trunk/src/aArtisanQ_PID

I am a bit lost...

Edit: I think I found everything. I have got Artisan running and the termocouple showing! Thanks.

Latest version for the arduino is 3.11, right? What is the PID version?
Edited by tony359 on 10/26/2021 4:14 PM
 
renatoa
aArtisanQ_PID last version is 6.8
3.11 of... what ?
PID is 1.1 I guess, implementing Proportional on Measurement (P_ON_M).
 
tony359
Ahah sorry I got confused. Last version of the ARTISAN for Windows is 2.4.6! - the 6.8 I guess it’s the PID version of the arduino sketch to work with the artisan software? But on the above link I can only find 6.7.

What was 3.11 I don’t know, I think I got confused with an old link with old versions, sorry.

Let me try to understand: are there different versions, PID and non PID for the TC4 - both in HW and SW? And PID means that the TC4 itself is capable of elaborating how to drive a heating element and a fan to follow a profile temperature?

Do I need to install a specific firmware on my TC4?

Thanks!

Edit: I guess the "Firmware" I see mentioned on the Artisan website is the Arduino code? smile

Does Version 4.00 support external control of heating elements and fans? I see the latest version uses a zero cross detector (to do PWM and phase control I reckon?) - how do things work with version 4?
Edited by tony359 on 10/27/2021 11:00 AM
 
renatoa

Quote

are there different versions, PID and non PID for the TC4
...
Do I need to install a specific firmware on my TC4?

Yes, the branch/version featuring PID is here:
https://github.co...rtisan_PID

and the dedicated thread is here:
https://homeroast...post_43360

... all the others branches in the repository are supposedly non PID, too old, and not explored.

Quote

both in HW and SW

PID is a firmware/sketch/Arduino code feature, the TC4 board is the same, no additional hardware for PID is required.

Quote

And PID means that the TC4 itself is capable of elaborating how to drive a heating element and a fan to follow a profile temperature?

PID is used to reach and maintain a single setpoint, using the heater as the single control variable, fan is not handled by PID.
Following a profile is other story. Apparently all you have to do is to provide a set of points. For some it works, for others... depends on the pickiness level, and the machine inertia and thermal behavior.
Strictly theoretical, could be demonstrated that PID, as a control method, is not optimal for a process with a continuous moving setpoint.
PID is good for beer, or boilers, to catch and keep a temperature for hours, less for roasting coffee Grin
 
tony359
Interesting thanks! Yes, in the meantime I had found the 6.8 version on the thread you linked (the repository does not have it apparently).

So PID is an evolution of the software. It's not a hardware evolution, correct?

I have HW version 4, what features does my version 4 NOT have compared to the latest version?

Can version 4 handle a heater and a fan? Are there schematics around? I do not see IO/2 which should have the zero cross detection.

About the fan, is that then supported by running the PID via software on Artisan automatically? Or is that completely manual? I think I saw some options on Artisans about controlling the fans based on specific events.

I see your point about the moving setpoint. I'll give it a go if my version supports it.

So I think I am fully set. I am running 6.8 sketch on Arduino, I have the latest Artisan software, my thermocouple is correctly seen. And there is no firmware on the TC4 to update, correct?

My plan is to explore the software and set up a profile which I will then try to follow manually. Then, I will consider the idea of wiring the TC4 to the heater/fans - for manual or PID control.

Feedback from a newbie here: it would be worth creating a post with links at all the latest software/sketches/documents. A blocked sticky post. It's a nice project!

Thanks again!

Edit: one more question (Columbo mode ?). What am I doing wrong with my LCD? This is a parallel LCD if not mistaken, not I2C. I have selected the parallel one in the user.h file.


Edited by tony359 on 10/27/2021 2:56 PM
 
renatoa
My guess is you forgot to enable the 4x20 mode, and the display is used as a 2x16.
Check LCD_4x20 declare.
 
tony359
Thank you - I can double check but it should be set to 4x20 already.
 
tony359
I can confirm I have the correct LCD settings in the user.h file. Any ideas?


////////////////////
// LCD Options
// Choose ONE of the following LCD options if using an LCD
//#define LCDAPTER // if the I2C LCDapter board is to be used
//#define LCD_I2C // if using a $5 delivered Chinese LCD with I2C module
#define LCD_PARALLEL // if using a parallel LCD screen

#define LCD_4x20 // if using a 4x20 LCD instead of a 2x16

#define LCD_I2C_ADDRESS 0x27 // adjust I2C address for LCD if required. Try 0x3F, 0x20, 0x27. Not used for LCDapter.
 
tony359
any ideas?
 
greencardigan
I have never tested the LCD code with a parallel LCD. It predates my involvement in the code.

You could try getting an I2C LCD or get an I2C module to add to you current LCD.
 
renatoa
I would try to see if disabling 4x20 will produce a clean 2x16 readout.
 
timbarnes
I just tested a parallel interface LCD with an Arduino Uno and aArtisan PID version dated 20171004. It seems to work correctly.

The pin assignments can be found in aArtisanQ_PID.ino, but they are as follows:


#else // parallel interface, standard LiquidCrystal
  #define BACKLIGHT ;
  #define RS 2
  #define ENABLE 4
  #define D4 7
  #define D5 8
  #define D6 12
  #define D7 13
  LiquidCrystal lcd( RS, ENABLE, D4, D5, D6, D7 ); // standard 4-bit parallel interface

Note that D4 through D7 are named for the LCD, not the Arduino, so D4 for the display connects to D7 on the Arduino etc.
If your display board is plugged directly in as a shield, you may need to look for the documentation, and if necessary change the #define statements in the Arduino code.

The fact that your display is almost right suggests you are probably connected properly, though. Could you have a bad connection? Is the display stably incorrect, or does it do random things?

I think that's all I can suggest. I hope this helps.
 
tony359
interesting thanks - been looking for that schematic a while!

However my TC4 has an LCD terminal with D4, D5, D6, D7. I do not have D7, D8, D12 ane D13.

Any ideas? I guess the D7,8,12 and 13 may be accessible via the through connector but as there is an "LCD" terminal, I thought that would be the best option.

Also: my Arduino seems to be losing the program every time it's power cycled?

thanks again
 
timbarnes
Thinking about it a bit more, I am coming to the conclusion that your display must be wired correctly, because you are getting information transmitted to the display. The D4-D7 are on the LCD. They connect to pins D7, D8, D12 and D13 on the Arduino - in my case directly, in your case via the TC4 board.

So perhaps the next step is to check that you are running the latest version of the software. I just downloaded the 6.3 version of aArtisan PID yesterday, hooked up the display today using the parallel connections, and it works properly.

Regarding losing the program when you power cycle the Arduino, I have never seen that behavior and can't speak to it. You might want to try a different board if you have a spare.
 
timbarnes
I was able to reproduce exactly the odd scrolling behavior you showed in your video, in two different ways.
  1. By disconnecting the RS line - this causes the random scrolling.
  2. By selecting a non-PWM CONFIG in user.h. This is most likely the problem, because pin D2 is used by the phase angle software, and is also used by the parallel LCD software, leading to a conflict.

I was able to fix cause #2 by changing the line "#define RS 2" to "#define RS 5" in aArtisanQ_PID.ino, and re-routing the RS wire. If the display is connected to the Arduino via the TC4, this will require surgery, and I would suggest picking up an I2C display instead, if you need the phase control capability. I am using the CONFIG_PWM, which does not have this conflict.

EDIT: greencardigan pointed out (thank you!) that as all the Arduino lines are presented on the TC4 board, there's no "surgery" needed if you re-program aArtisanQ_PID to use a different pin for the RS line. I don't have a TC4 board on hand (it's on its way), and didn't think it through. But I gather the generally recommended approach now is to use the I2C connection anyway.
Edited by timbarnes on 11/09/2021 6:10 PM
 
BernardJ87
Good information.
 
tony359
yes indeed!
For £2.95 I have order an I2C adaptor but I will test timbarnes points later - it's the minimum I can do to say thanks for the time he's invested into this! smile
 
tony359
The I2C adaptor arrived promptly and it works like a charm. Indeed for £2.95 I save lots of wires! smile
 
timbarnes
That's great! Mine showed up as well and works as advertised. Now I'm waiting for my TC4+ and I should be able to start putting the whole system together.
 
Jump to Forum: