Who is here? 1 guest(s)
 Print Thread
TC4ESP
renatoa
The profiles are stored in the 4M EEPROM, on the ESP board.
4096 bytes of this memory is available to the user via programming language.
A profile is 400 bytes, thus maximum 9 to store in this memory.
They aren't lost when program changes, IF... your Tools/Erase Flash option from Arduino is set to "Sketch Only" (default).

A default profile, index 1, is created at memory initialization, you can find the definition of this profile here:
https://github.co...Data.h#L76

To create other profile, you change the following below:


int16_t number = 1;
char name[40] = "Default profile \0";
char description[80] = "Automatically created when no profiles\0";
...
int16_t temp[50] = { 25,  78, 107, 130, 150, 166, 179, 190, 199, 206, 212, 218,   0 }; // average profile, 5:4:3



- number, to any 1...9 value,
- name, to your desired profile name, only first 20 chars will be shown on LCD
- description, to your desired profile desc, only first 40 chars will be shown on LCD
- temp, the temperatures array that describe the profile. If you want more points, then you need to change also the time array accordingly.

... and finally... reflash the sketch with the new profile block definition.

You can extract a profile data from an Artisan .alog roast file by looking for timex and time2 value lists, en excerpt is shown below:


'timex': [0.0499, 2.00732, 4.00739, 6.00743, 8.00754, 10.00763, 12.00863, 14.00871, 16.00874, 18.00891, 20.00899, ...
...
 'temp2': [24.0, 24.9, 27.3, 30.7, 34.7, 38.5, 41.9, 44.8, 47.4, 49.7, 51.8, 53.8, 55.7, 57.4, 59.0, 60.4, 61.8, 63.0, 64.1, 65.1, ...


...extract them into an excel sheet, and decimate to the desired time precision, but maximum 50 values for the entire roast !
This equates to 4 values per minute, every 15 seconds, for a 12 minutes roast. 4*12=48 points, plus an ambient temperature zero time starting point, and a final trailing point with zero values for both time and temp, that mark end of profile.
For longer than 12 minutes roasts, you can try 3 points per minute, thus every 20 seconds, allowing 16 minute roasts, or 2 points per minute, thus every 30 seconds, allowing maximum 24 minute roasts.

If you want to overwrite an existing profile slot, just change the name, even only one char, for example add a space at the end, if you want to preserve the profile, and change the data only.
Edited by renatoa on 11/17/2021 2:49 AM
 
Will2
Before I can work with the profiles stored in eeprom on the tc4ESP board, it must first resolve the button issues.

Quote

renatoa wrote:
...
Will check what is different in the archives above and come back.
....


Quote

Will2 wrote:
...
In addition, I'm not sure if the buttons work properly. Or it's not entirely clear to me how the buttons should work.
...


How important is defining Brad buttons in user.h?
Did I buy the wrong button board? It is connected to 3.3V.

The "UNUSED" button now works as a "MODE " button (for example as a toggle for UP/DOWN buttons target).
The "ENTER" key sometimes works the same as the "UP" key.
Long press the "DOWN" button at the Fan target to turn off the HTR.
(ok, user.h: HTR_CUTOFF_FAN_VAL 20)
Short pressing the "DOWN" key does not decrease the values.
And the tact in all sorts of ways is impossible to describe.

Most likely I'm using the wrong combination of .ino file and libraries.

up.picr.de/42453452uu.jpg
Edited by Will2 on 11/17/2021 9:11 AM
Viliam
 
renatoa
If the buttons board looks like in the project doc, and board orientation is "portrait" as in photography, i.e. the four buttons cross up, and the "unused" button down, then it should behave ok. 3.3V is ok.
If owning a multimeter, you can check the board output voltages, according to:
https://github.co...n.cpp#L215

MODE/SETUP is same button, multiple roles/meanings. Could be also CANCEL in some scenarios.
Same for ENTER, it has also SELECT meaning.
 
Will2
Thank you Renato, I'm glad an explanation was found.

This means that the same boards with different resistance ladders are sold.

voltage values should be:
0 = UP, 0.45V = Enter, 1V = Settings, 1.6V = DOWN

my resistance ladder generates voltage values:
0 = UP, 0.10V = Enter, 0.28V = Settings, 0.53V = DOWN, 1.10v Unused, 3.0V Unpressed

up.picr.de/42459076cz.jpg

Surely the best way would be to have the resistance values of a ladder that works measured. Will it be possible?
Viliam
 
renatoa
Great find !
The values are (somewhat) public... because they are copied by chinese from the Adafruit LCD/buttons shield, whose schematic is attached.

The only difference you should be aware is that my code is for board above rotated 90 degrees clockwise.
So the buttons from the schematic and picture above have other meanings:
LEFT - is UP for me
UP - is ENTER/SELECT
DOWN - is MODE/SETUP
RIGHT - is DOWN

rightmost SW5 - SELECT in the schematic - is the unused button
renatoa attached the following image:
adafruit_lcd_buttons_shield.jpeg
 
Will2
Renato You were faster,
I just measured the resistances on my board and drew a diagram.
3k3, 1k, 1020, 330, they agree.
instead of 2k i have 10k, so just replace 1 resistor and it will work.
Viliam
 
renatoa
Yes, this was my guess too, your values are ok as proportions, just scaled down due to that wrong pull-up resistor.
One change fix all !

Meanwhile, thinking more about this orientation confusion, did some quick additions to the buttons library, and now it can be used in both landscape and portrait mode !
Not posted yet, to not amplify the versions mess, if you want I can post here for you to test.
 
Will2

Quote

renatoa wrote:
... if you want I can post here for you to test.


I'd rather use the landscape button mode, you can post here, or send me an e-mail.

Yesterday I added another pull-up resistor 2k5, so together it's 2k,
the buttons now work normally.
Today I bought a SMD 0805 2k, so I will exchange a 10k resistor for 2k.
Viliam
 
renatoa
Attached...
You just have to un-comment the
// #define LANDSCAPE
at line 196 in adcButton.cpp
...
renatoa attached the following file:
adcbutton.zip [5.5kB / 255 Downloads]
 
Will2

Quote

renatoa wrote:
... because they are copied by chinese from the Adafruit ...


But the Chinese probably don't care if he puts 2001 or 1002 there:

up.picr.de/42472516mg.jpg
Viliam
 
renatoa
Lol Grin
 
CamMor89
Hi Renatoa. Is it possible to use max31865 (pt100 tc)? I can't seem to find any AD8495, and I already have 3x max31865 laying around (from when I tried to make a esp32 controller).
 
renatoa
Yes, I am aware about the issue, until April they seems gone, unobtainium at any price...
You have the choice to disable their usage though, and use the MCP3424 ADC standalone, as in the classic TC4.

The changes required are the following:
- first disable TC amp usage here:
https://github.co...cADC.h#L64
- then choose your TC type here, K or whatever:
https://github.co...uple.h#L58
... and don't forget to disable Pt sensor usage
- and finally, update the thermocouple variables here:
https://github.co...user.h#L68
and here...
https://github.co...D.ino#L302

Regarding using max31865 or MAX31856, that was been previously discussed here in this thread, there is a hardware limitation: not enough pins.
They both are using SPI, whose pins are already busy with I2C of LCD display, so is a matter of ... or-or, exclusive, display or SPI sensor(s)
If you agree using the setup without UI, then I can add the MAX chips library somewhere after holidays.

There is a third choice though... using TL amp board for Pt sensors, with analog output and the current ADC. This is a new feature added to TC4ESP, announced some months ago, in the first page of the thread.
Not sure if you are familiar with these amp boards, they are widely used in 3d printing, this model:
https://www.go-3d...d-printer/
 
Jump to Forum: