greencardigan / TC4-shield

78 stars 71 forks source link

Can you please add functionality for a second DC fan? #12

Open arash-ops opened 1 year ago

arash-ops commented 1 year ago

Hi, I've redesigned a TC4 type of shield which includes two DC fan outputs and ESP01 wifi module. Everything else stays the same as the current TC4 shield. I need the second DC fan capability for exhaust setup on my DIY coffee roaster using Artisan. Any chance you are able to update your code to add functionality for the second DC fan please? I can try to figure out the ESP01 wifi module programming separately myself. Thank you for all your work on this code

GRIMORIO commented 1 year ago

tc4 is obsolete, I replaced it with phidgets

arash-ops commented 1 year ago

I meant I’ve designed a board similar to TC4+ (by artisanal) except it has two dc fan motors. How much work would it be to add a second dc fan into your code?

MAKOMO commented 1 year ago

The TC4 protocol does not support two fans, but only one fan and one heater. We have no intention to extend that protocol any further or change its implementation on the Artisan side. Either use the heater data for your second fan or use a different protocol like MODBUS.

renatoa commented 1 year ago

tc4 is obsolete, I replaced it with phidgets

This was your choice, but this not make TC4 obsolete.
An open source project lives as long as his users decide. You can't write code for phidgets, for TC4 it's possible. Added a lot of additional hardware to my TC4, for example support for Pt sensors, and pressure measurement, are the most noticeable I remember atm. Even a second fan is possible, there are examples of a second IO3 channel addition in the HRO forum, coded by me and others.

renatoa commented 1 year ago

The TC4 protocol does not support two fans, but only one fan and one heater. We have no intention to extend that protocol any further or change its implementation on the Artisan side. Either use the heater data for your second fan or use a different protocol like MODBUS.

He didn't asked for Artisan support, but for TC4. Many people roast with TC4 alone, un-tethered to a computer. Some code additions can bring roasting process with TC4 at a level of features that Artisan lacks currently... and probably have no intention to add.

greencardigan commented 1 year ago

Correct, control of a second fan can be added to the TC4 code. You can even have it work with serial commands sent from Artisan to control it. You just can't plot the additional fan value on the Artisan graph unless you do a work around like Marko mentioned.

It wouldn't take long to add some basic control of a second fan, but I do not have the time available to do it for you unfortunately.

arash-ops commented 1 year ago

Ok thanks all for the comments. @renatoa - can you send a link to the HRO forum you are referring to please? Also I’m curious, do you use pt sensors for coffee roasting?

@greencardigan - I’m not looking to plot the second fan in Artisan. I just need to be able to operate it from artisan. Do you have any general guidance on what I need to update in the code? I can have a go and see if I can get it to work. I have basic enough knowledge to be able to have a go at it if I have some direction and with a lot of google help!

greencardigan commented 1 year ago

@arash-ops - If you're using CONFIG_PAC2 mode, then you might already be able to use a second fan on the IO3 output and use the IO3;xxx serial command in Artisan.

Otherwise you would have to modify the code for an existing command (in cmndreader.cpp) or create a new command to do an analogWrite.

Edit: I just remembered that there is already an AWRITE;ppp;ddd command which should let you do PWM output on a spare arduino PWM pin.

renatoa commented 1 year ago

Ok thanks all for the comments. @renatoa - can you send a link to the HRO forum you are referring to please?

@greencardigan is right, you can use IO3 for a DC fan, additional to the fan controlled via OT2. To connect an A/C fan on IO3 requires a special control board though...

If you still want an additional control (fourth), please ask @timbarnes here: https://homeroasters.org/forum/viewthread.php?thread_id=6683&highlight=IO4&pid=74502#post_74502 ...if no reply will send you my (untested) code

Also I’m curious, do you use pt sensors for coffee roasting?

Yes, Pt support was been added for a coffee roaster, to replace TC, in a setup where TC don't perform very well. But this was been done on aTC4 fork for ESP platform, plenty of memory, not sure if Uno is capable of this performance.

arash-ops commented 1 year ago

Ok thanks all for the comments. @renatoa - can you send a link to the HRO forum you are referring to please?

@greencardigan is right, you can use IO3 for a DC fan, additional to the fan controlled via OT2. To connect an A/C fan on IO3 requires a special control board though...

If you still want an additional control (fourth), please ask @timbarnes here: https://homeroasters.org/forum/viewthread.php?thread_id=6683&highlight=IO4&pid=74502#post_74502 ...if no reply will send you my (untested) code

Also I’m curious, do you use pt sensors for coffee roasting?

Yes, Pt support was been added for a coffee roaster, to replace TC, in a setup where TC don't perform very well. But this was been done on aTC4 fork for ESP platform, plenty of memory, not sure if Uno is capable of this performance.

Thanks, I’ll send a response on the forum. Yea every day I’m leaning more towards just upgrading to an ESP32 setup with more memory. I’ll get around to it at some point this year. I’m thinking of integrating an induction circuit into it too so hopefully I can do both at the same time or have separate controls if easier.

arash-ops commented 1 year ago

@arash-ops - If you're using CONFIG_PAC2 mode, then you might already be able to use a second fan on the IO3 output and use the IO3;xxx serial command in Artisan.

Otherwise you would have to modify the code for an existing command (in cmndreader.cpp) or create a new command to do an analogWrite.

Edit: I just remembered that there is already an AWRITE;ppp;ddd command which should let you do PWM output on a spare arduino PWM pin.

@greencardigan - I am using the Config_pwm mode. Would I still be able to use AWRITE;ppp;ddd command with this for a second DC fan?

greencardigan commented 1 year ago

@arash-ops I think so. The AWRITE command should just be doing a standard arduino analogwrite to the chosen arduino pin.

renatoa commented 1 year ago

@arash-ops, sent you a PM with a solution on HR forum, noticed ?

arash-ops commented 1 year ago

@renatoa - only got an email this morning from you. It didn't send me a notification when you send the PM, sorry. Let me see if I can change my email preferences on there.