Skywalker, the AL... | [263] |
War on Farmers by... | [53] |
Green coffee reviews | [10] |
Help and recommen... | [10] |
TC4 with aArtisanQ_PID
|
|
ChrisR |
Posted on 06/01/2018 8:07 AM
|
Newbie Posts: 49 Joined: October 17, 2017 |
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 |
Posted on 06/01/2018 8:31 AM
|
Newbie Posts: 49 Joined: October 17, 2017 |
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 |
Posted on 06/01/2018 3:58 PM
|
Newbie Posts: 49 Joined: October 17, 2017 |
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 |
Posted on 06/01/2018 9:46 PM
|
1 1/2 Pounder Posts: 1185 Joined: November 21, 2010 |
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 |
Posted on 06/02/2018 12:52 PM
|
Newbie Posts: 49 Joined: October 17, 2017 |
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 |
Posted on 06/03/2018 6:46 AM
|
1 1/2 Pounder Posts: 1185 Joined: November 21, 2010 |
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 |
Posted on 06/03/2018 7:22 AM
|
1 1/2 Pounder Posts: 1185 Joined: November 21, 2010 |
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 |
Posted on 06/03/2018 7:37 AM
|
Administrator Posts: 3884 Joined: February 23, 2010 |
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 |
Posted on 06/03/2018 8:13 AM
|
Newbie Posts: 49 Joined: October 17, 2017 |
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 |
Posted on 06/03/2018 3:06 PM
|
Newbie Posts: 49 Joined: October 17, 2017 |
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 |
Posted on 06/03/2018 3:08 PM
|
Newbie Posts: 49 Joined: October 17, 2017 |
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 |
Posted on 06/03/2018 6:41 PM
|
Administrator Posts: 3884 Joined: February 23, 2010 |
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 |
Posted on 06/03/2018 6:53 PM
|
1 1/2 Pounder Posts: 1185 Joined: November 21, 2010 |
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 |
Posted on 06/03/2018 9:00 PM
|
1 1/2 Pounder Posts: 1185 Joined: November 21, 2010 |
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 |
Posted on 06/04/2018 7:38 AM
|
1 1/2 Pounder Posts: 1185 Joined: November 21, 2010 |
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 |
Posted on 06/04/2018 8:29 AM
|
Newbie Posts: 49 Joined: October 17, 2017 |
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 |
Posted on 06/04/2018 12:32 PM
|
Administrator Posts: 1809 Joined: May 10, 2011 |
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 |
Posted on 06/04/2018 2:35 PM
|
Newbie Posts: 49 Joined: October 17, 2017 |
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 |
Posted on 06/04/2018 6:10 PM
|
Administrator Posts: 1809 Joined: May 10, 2011 |
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 |
Posted on 06/17/2018 8:44 AM
|
Newbie Posts: 5 Joined: December 09, 2005 |
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 |
Posted on 06/17/2018 6:50 PM
|
1 1/2 Pounder Posts: 1185 Joined: November 21, 2010 |
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 |
Posted on 06/18/2018 3:48 PM
|
Newbie Posts: 49 Joined: October 17, 2017 |
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 |
Posted on 06/18/2018 5:07 PM
|
1 1/2 Pounder Posts: 1185 Joined: November 21, 2010 |
The IO3 frequency is set in the setup part of the aArtisan_PID.ino file. Code Download source 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 |
Posted on 06/18/2018 5:23 PM
|
Newbie Posts: 49 Joined: October 17, 2017 |
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 |
Posted on 06/19/2018 9:50 AM
|
Newbie Posts: 49 Joined: October 17, 2017 |
I would like to use 2 digital pins for step and direction. What pins are still available? |
|
Jump to Forum: |