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.

renatoa
03/29/2024 1:55 AM
Soubriquet and kaicee18, welcome to forum

renatoa
03/25/2024 12:38 PM
coffee drink, Ramper?

allenb
03/24/2024 12:10 PM
Siam3D Welcome

renatoa
03/23/2024 3:02 PM
welcome cup, andrewg

allenb
03/21/2024 5:10 PM
TRH629 Welcome

In Memory Of Ginny
Donations

Latest Donations
dmccallum - 10.00
JackH - 25.00
snwcmpr - 10.00
Anonymous - 2.00
Anonymous - 5.00
Users Online
Guests Online: 3

Members Online: 0

Total Members: 8,167
Newest Member: Soubriquet

View Thread

Who is here? 1 guest(s)
 Print Thread
TC4 with aArtisanQ_PID
ChrisR
Indeed, I measured the voltage as you suggested and I read the correct voltage at DIO9. i do have an older TC4C.
Edited by ChrisR on 06/01/2018 8:16 AM
 
ChrisR

Quote

chaff wrote:

There's a transistor inverter shown for IO3's output on the circuit diagram. 100% PWM will result in the transistor 'on' all the time and the output will be low ( the load would be connected between +5v and the IO3 output ). Unless you put a pull-up resistor between 5v and the output pin your meter won't see the IO3 pin float to +5v when PWM is 0% output.


Did you mean OT1?
 
ChrisR
Looks like I need to connect to DI09 instead of OT1. I just checked the voltage at DI09 and the lowest voltages I get when I write a 1 to OT1 is .7V. This seems to be the drop between base and emittter on the Q1 transistor.
 
greencardigan
I think there is actually an issue with the faster frequencies on OT1 when using the PWM mode. The frequency is correct but the output is changing in large steps instead of smoothly. Eg. the voltage measured on DIO9 doesn't change between OT1,29 and OT1,42.

Not sure what is going on. This is occurring with all the faster PWM options (977Hz to 3.9kHz). There is a note in user.h from Jim saying these need testing. Also, it's doing the same thing using Jim's aArtisan sketch.
 
ChrisR
I think I'll switch to "CONFIG_PAC2_IO3HTR" config and use IO3 for the gas valve. I removed the L1 inductor and the resistor that connects DI09 to the Q1 transistor. However, I cannot linearly step through the voltages on Di09. IO3 seems to work very well in regards to linearly stepping through voltage from 0 to 5 V.
Edited by ChrisR on 06/02/2018 1:54 PM
 
greencardigan
Thank Chaff for the info. That does appear to be what is happening. I was trying to understand the pwm16 library code but couldn't fully understand it.

So do you know if there is a possibility to have 100 steps of resolution at around 3.9kHz? I was looking at this page but haven't tried anything yet. https://arduino-i...-Frequency

That still leaves the issue of having an open collector output for OT1.
I was trying a new CONFIG option with fast pwm output on digital pin 11. This pin uses the same timer as IO3 and is directly connected to a header pin on both the TC4C (on the ICSP port) and TC4 (on the digital pins header or the ICSP port on the arduino uno).

Any thoughts on this?
 
greencardigan
OK that sounds good. I was thinking it didn't suit ChrisR for some reason. An RC filter on the output would give a smoother DC output to connect to a gas valve driver.
 
allenb
I'm thrilled that this is being scrutinized and hopefully a best practice determined for anyone wanting to control a proportional solenoid gas valve (kelly or clippard) or proportional analog input SSR as this one:

https://www.mouse...egMA%3D%3D

The SSR would most likely require the RC filter on the PWM output.

The valves would most likely need a buffer circuit to not draw excessive current from the TC4 but can be easily done.

Keep the momentum!

Allen
1/2 lb and 1 lb drum, Siemens Sirocco fluidbed, presspot, chemex, cajun biggin brewer from the backwoods of Louisiana
 
ChrisR

Quote

greencardigan wrote:

OK that sounds good. I was thinking it didn't suit ChrisR for some reason. An RC filter on the output would give a smoother DC output to connect to a gas valve driver.


I agree, I need a pure PWM with 0V when the duty cycle is 0 and 5V when duty cycle is 100. Therefore the open collector config does not work for a gas valve, but connection to the Atmega pin would. Both the Clippard and Kelly valves have designated valve drivers and the valve drivers input impedance are high. The current draw from the Atmega pin would be minimal.
 
ChrisR

Quote

chaff wrote:

(

PWM16..cpp # 60: change to

// TCCR1B = _BV(WGM13) | _BV(WGM12) | _BV(CS11) | _BV(CS10);
TCCR1B = _BV(WGM13) | _BV(WGM12) | _BV(CS11) ; // prescale was 64 is now 8

user.h # 157 add new line ( comment all other selections ) :

#define TIME_BASE 514 // approx. 3.9kHz for prescale 8

Those two changes give you 3.89KHz pwm with at least 1% resolution by the looks but, of course, the other SSR is output; is that a problem ?

allenb, The 3904 transistor is a 200mW, 1/2amp device, I'll look at the relay's datasheet.


This works. I can step through the various voltages on DI09 and read the voltage on my voltmeter. I don't use SSRs, thus the other outputs are not an issue for my setting.
I already removed the resistor and the inductor connected to Q1, thus I connected directly to DI09.
Awesome.
Edited by ChrisR on 06/03/2018 5:01 PM
 
ChrisR

Quote

chaff wrote:

PWM16.cpp # 57 Change from :

// non inverting, fast PWM, TOP is in ICR1
//TCCR1A = _BV(COM1A1) | _BV(COM1B1) | _BV(WGM11);

to:
// inverting, fast PWM, TOP is in ICR1
TCCR1A = _BV(COM1A0) | _BV(COM1B0) | _BV(COM1A1) | _BV(COM1B1) |

To cause OT1 to have the right polarity; then a 10K resistor between the OT1 terminals would satisfy clippard's need wouldn't it ?

( Edit) PS for ACKS_ON:

cmndreader.cpp # 596:
#ifdef ACKS_ON
Serial.print(F("# PID setpoint = ")); Serial.println(SV); // SV was Setpoint
#endif

Chris_R, It looks like I've gone off on a tangent looking to alter OT1's Frequency and polarity. Was there a reason to move the gas valve from IO3 ? It seems like the gas should be on IO3: no open-collector inverter and a separate Timer/PWM control from OT1, OT2.
What's missing with CONFIG_PWM, Gas valve on IO3 ? Tks


To drive the gas valve with DI09 and use IO3 for the DC fan.
 
allenb

Quote


allenb, The 3904 transistor is a 200mW, 1/2amp device, I'll look at the relay's datasheet.


The Crydom proportional SSR I linked to earlier that includes 0-5, 0-10 VDC and 4-20 mA analog input options shows a 28.8 Kohm input impedance so no problem driving it.

The Kelly proportional valve I used with my roaster has a maximum input current of 180 mA at full open. Would be best to utilize either Kelly's or Clippards driver which provides a buffer plus the ability to set min/max settings .

Allen
1/2 lb and 1 lb drum, Siemens Sirocco fluidbed, presspot, chemex, cajun biggin brewer from the backwoods of Louisiana
 
greencardigan
Some others use a gas valve on IO3 with the CONFIG_PAC2_IO3HTR mode. This is good for those using an AC fan. I understand ChrisR wants to drive a gas valve and a DC fan thus requiring two fast pwm outputs. None of the existing modes can do this.

Thanks heaps Chaff for the code changes. I'll have a play and see if if I can get it working. I'm mindful of the fact that many use OT1 for slow 1Hz pwm and I'll have to keep both options working with compile directives maybe.
 
greencardigan
Also Chaff, can you point me to the part of the code that actually switches the OT1 Output? I cant see any digital write or analog write associated with OT1. Maybe it's happening in PWM16.OUT but I'm not seeing it.
Edit: Ahh, I see it's to do with the compare registers.
Edited by greencardigan on 06/03/2018 11:51 PM
 
greencardigan
I managed to get the inverted pwm working on OT1 and with a resistor across the OT1 pins I get a nice 0V to 5V.

However, I still think there is an issue with the open collector and resistor setup. When the Arduino is powering up or resetting, the pull up resistor is going to pull the output to 5V and turn the connected heater on full power! Or am I missing something?

Maybe it would be best to do non inverting output and connect directly to D09.
 
ChrisR

Quote

greencardigan wrote:

I managed to get the inverted pwm working on OT1 and with a resistor across the OT1 pins I get a nice 0V to 5V.

However, I still think there is an issue with the open collector and resistor setup. When the Arduino is powering up or resetting, the pull up resistor is going to pull the output to 5V and turn the connected heater on full power! Or am I missing something?

Maybe it would be best to do non inverting output and connect directly to D09.


Full gas power on at start up would be a concern, especially if someone wanted to drive the roaster in manual mode.
 
JackH
Jim made some changes to the OT1/OT2 circuit over the last few versions of TC4.

The original TC4 (V4.0) used VIN as a power source for the open collector pair (if you were using the Arduino external DC jack to power). VIN is the supply voltage from the Arduino DC input jack. In later versions of the TC4, Jim changed the voltage source to the +5v regulated line and changed base resistors R3 and 4 from 2KOhm to 1KOhm.

I am not sure if this applies to the TC4C as well.

We found that with the VIN source, the OC outputs would not fully swing to the desired 0/5V levels. We were seeing swings from 4.5V to 7.6V with VIN 9V used.

Something to keep in mind if you are using the older versions of the TC4.
---Jack

KKTO Roaster.
 
ChrisR
Thank you. I have an older version of the TC4C, I think it is 1.2, but I have v6 for TC4. I?ll test them both.
 
JackH
Looking at the TC4C schematic that Greencardigan posted looks like it is correct with +5V regulated going to the OT1/OT2 circuit and 1K resistors in place. If you also have TC4 shield V6 then I think you should be OK.

Originally, the OT1 output was meant to control a SSR with a PWM signal 0v to 5V. OT2 is the same but had a much higher frequency signal for a fan.

This may have changed with the different TC4 sketches.

I feel bad that there is no base support of this board. Brad is doing an excellent job of keeping it going.
Edited by JackH on 06/04/2018 6:16 PM
---Jack

KKTO Roaster.
 
dparham
Im new to Arduino and wanting to get this fabled TC4 but I cant find it anywhere and the references are of a ghost device! lol I have a fluid bed roaster i want to automate in artisan .. currently i do run profiles from my omron PID but its really difficult to change profiles but in my large gas drum roaster I use artisan and would be great for my little sample roaster to be able to be controlled since it is electric... i dont use it for comparing profiles with the gas roaster, its just for little roasts to mainly some beans here and there!
 
greencardigan
There are a few people on the forum here that have been making their own. If you have the skills or are willing to learn, it should not be too hard.
It's possible I may try to build/sell some in the future. I have recently ordered some parts to give it a go with a spare board that Will2 sent me. If that goes well, I may order some more boards.
 
ChrisR
Would it be difficult to set the IO3 frequency to higher than 3.9khz? Looks like the DC fan I?m getting requires 10-30 kHz PWM. Maybe it?s only a matter of changing the prescaler in PWM16.h?
 
greencardigan
The IO3 frequency is set in the setup part of the aArtisan_PID.ino file.


pwmio3.Setup( IO3_PCORPWM, IO3_PRESCALE_8 );


Changing the prescale here from IO3_PRESCALE_8 to IO3_PRESCALE_1 should give you 31kHz. If that's too fast you could change the first parameter to IO3_FASTPWM and leave the prescale at 8. That will give 7.8kHz. These are the closest two options.
 
ChrisR
Does it work in the CONFIG_PWM mode?
Never mind, I see that it should.
Edited by ChrisR on 06/18/2018 5:41 PM
 
ChrisR
I would like to use 2 digital pins for step and direction. What pins are still available?
 
Jump to Forum:

Similar Threads

Thread Forum Replies Last Post
aArtisanQ_PID and Arduino UNO R4 Dataloggers/Controllers/Rate of Rise Meters 2 03/01/2024 12:13 PM
Using aArtisanQ_PID with an old TC4 Dataloggers/Controllers/Rate of Rise Meters 12 02/14/2023 10:50 AM
How do I get the latest aArtisanQ_PID libraries? Dataloggers/Controllers/Rate of Rise Meters 3 02/06/2023 5:44 PM
aArtisanQ_PID thermocouple jumps when active PID channel Dataloggers/Controllers/Rate of Rise Meters 16 06/10/2021 9:57 AM
Loading aArtisanQ_PID in Arduino Dataloggers/Controllers/Rate of Rise Meters 14 05/28/2018 8:32 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 © 2024 PHP-Fusion Inc
Released as free software without warranties under GNU Affero GPL v3
Designed with by NetriX
Hosted by skpacman