Who is here? 1 guest(s)
 Print Thread
TC4 with aArtisanQ_PID
No probs, I'm sure you'll get it sorted. Sounds like it's almost there.

How are you trying to change the fan speed? Do you have a POT connected to the Arduino or are you sending serial commands with the Artisan Roasting software?
Paul Varga
I tried both. I am using serial commands with artisan and i also tried the pots. Also the temps do not display on the lcd, they display on artisan though.
In the user.h for 6.2
Make sure you don't have Artisan commented out where you select your controller.
I you have the Pots, make sure define analog 1 and 2 are not commented out. If you don't have POTS, they should be commented out.
Line 176 should not be commented out "Define Triac motor
Line 177 should be commented out
Which I/O are you plugging the ZCD into, 2 or 3 ? Make sure you have the proper one selected for the I/O you are using, those are down around line 190
Make sure you have the proper frequency.

Not much of the other stuff usually gets messed with so if you've changed other things, you might want to start over again.

That's about the extent of my aArtisan knowledge
Edited by BenKeith on 02/09/2017 10:03 PM
Paul Varga
I have tryed it using IO 2 and 3, commenting out the one thats not being used. It did the same thing on both IO channels. When i Have the POTS hooked up analog 1 and 2 are not commented out. for now Im going to take them out and uncomment them so to create less confusion. I will just work with serial commands. I have noticed that some other versions of the QPID use IO2 so i swapped connections and had the same result. I will I really have not messed with anything in the user.h file. I will play with it tomorrow.
Greencardigan is the guru for the aArtisanQ_PID so I'm sure he can help you figure it out.
I don't use Artisan, and have just started messing with aArtisan so I'm not much help past the very basic.
Paul Varga
Well, any help is better then no help! I appreciate all the input I received so far. I want to roast some coffee!
And we're happy to help. Only problem is, it's difficult to sort these things out remotely.

I'd try connect to the Arduino using the Serial Monitor feature in the Arduino IDE. Sending commands from there will eliminate any possible setup issues with Artisan Roasting software.

Try this in the Arduino Serial Monitor and let us know the result.
- Set baud rate to match what is set in user.h
- Set line ending to NL
- send READ command. TC4 should respond with ambient, ch1, ch2 temps
- send PID;ON command
- send READ command again. TC4 should respond with ambient, ch1, ch2 temps and followed by heater duty, fan duty and PID set variable
- send OT2;50 to set fan duty to 50%
- send OT1;50 to set heater duty to 50%
- send READ command again to see if OT2 and OT1 commands worked and values are returned.
One other thing you can try that I know should work because I've just finished setting one up.

Do you have the LCD display, you will need that to know if this step works.

Comment out all the controller options so it's set for stand alone operation. Don't connect the computer or the roaster to it and just plug the power supply/battery in to power it up. Both heat and fan will be on zero when it first comes on. Once you turn the pots a few degrees turning the fan first, they will show the percentage of pot setting and moving the pots will change the percentage. If it doesn't change doing that, you have a problem with your configuration.

If you don't have a display, do you have it commented out? You may have commented too much out if so.

You can do the same stand alone test without a display by having it connected to the roaster and it should make the roaster come on, again, turning the fan first. Then you should be able to vary the fan or heat

I know this should work because I've just did it to verify it.
Edited by BenKeith on 02/09/2017 11:41 PM
Paul Varga
Hello, and good morning. I just read your guys posts, and I have tried sending the serial commands The commands are being sent and received. The fan says its at 50 but is running full blast, and the heater turns on but goes right back off. It does not stay on. It does display 50 in the serial read though. The temps are displayed as well when I do a serial READ command.

Also I did try using the POTS in stand alone mode and that did not work. It showed the percentages of the duty cycle but does not change the speed. I wonder if I can test this ZCD board some how to see if it is doing what it should do.
Paul Varga
This is how everything looks in the user.h file.

// user.h
// This file contains user definable compiler directives for aArtisanQ_PID

// *************************************************************************************
// NOTE TO USERS: the following parameters should be
// be reviewed to suit your preferences and hardware setup.
// First, load and edit this sketch in the Arduino IDE.
// Next compile the sketch and upload it to the Arduino.

// Version 1.10

#ifndef USER_H
#define USER_H

// Roasting software
// Comment out all if using TC4 stand alone
#define ARTISAN
//#define ANDROID

// Default control mode is Phase Angle Control for OT2 (AC fan) and ICC control for OT1 (heater)
// Comment out PHASE_ANGLE_CONTROL to get PWM control. Fast PWM (3.922kHz) for IO3 (DC fan) and slow PWM for OT1 (heater)
//#define IO3_HTR // use PWM (3.922kHz) out on IO3 for heater in PHASE ANGLE CONTROL mode

// LCD Options
// Comment out non required features
#define LCD // if output on an LCD screen is desired
#define LCDAPTER // if the I2C LCDapter board is to be used
//#define LCD_4x20 // if using a 4x20 LCD instead of a 2x16

// Temperature Unit
#define FAHREHNHEIT// controls only the initial conditions. Comment out for F.

// Analogue inputs
// Comment out if not required
//#define ANALOGUE1 // if POT connected on ANLG1
//#define ANALOGUE2 // if POT connected on ANLG2

// Duty Cycle Adjustment Increment
// Used for rounding/increment for analogue inputs and power UP/DOWN commands
#define DUTY_STEP 1 // Use 1, 2, 4, 5, or 10.

// physical input channel for RoR display on LCD
#define ROR_CHAN 0

// PID Control Options
#define PID_CONTROL // comment out to disable PID activation
#define PID_CHAN 2 // physical channel for PID input
#define CT 1000 // default cycle time for the PID, in ms
#define PRO 5.00 // initial proportional parameter
#define INT 0.15 // initial integral parameter
#define DER 0.00 // initial derivative parameter

#define NUM_PROFILES 2 // number of profiles stored in EEPROM

// Heater and Fan Limits/Options
#define MIN_OT1 0 // Set output % for lower limit for OT1. 0% power will always be available
#define MAX_OT1 100 // Set output % for upper limit for OT1

#define MIN_OT2 0 // Set output % for lower limit for OT2. 0% power will always be available
#define MAX_OT2 100 // Set output % for upper limit for OT2

#define MIN_IO3 0 // Set output % for lower limit for IO3. 0% power will always be available
#define MAX_IO3 100 // Set output % for upper limit for IO3

#define HTR_CUTOFF_FAN_VAL 10 // cut power to Heater if fan duty is less than HTR_CUTOFF_FAN_VAL (to protect heater in air roaster). Set to 0 for no cutoff

#define FAN_AUTO_COOL 13 // Set fan output duty for auto cool when using PID;STOP command

// Command Echo
//#define COMMAND_ECHO // Echo all serial commands to LCD

// BAUD Rate for serial communication
#define BAUD 19200

// Temperature Reading Filters
#define BT_FILTER 10 // filtering level (percent) for BT
#define ET_FILTER 10 // filtering level (percent) for ET
#define AMB_FILTER 70 // 70% filtering on ambient sensor readings

// use RISE_FILTER to adjust the sensitivity of the RoR calculation
// higher values will give a smoother RoR trace, but will also create more
// lag in the RoR value. A good starting point is 80%, but for air poppers
// or other roasters where BT might be jumpy, then a higher value of RISE_FILTER
// will be needed. Theoretical max. is 99%, but watch out for the lag when
// you get above 95%.
#define RISE_FILTER 85 // heavy filtering on non-displayed BT for RoR calculations
#define ROR_FILTER 80 // post-filtering for the computed RoR values

// Thermocouple Input Options
// TC type is selectable by input channel
// permissable options: typeT, typeK, typeJ
#define TC_TYPE1 typeK // thermocouple on TC1
#define TC_TYPE2 typeK // thermocouple on TC2
#define TC_TYPE3 typeK // thermocouple on TC3
#define TC_TYPE4 typeK // thermocouple on TC4
#define NC 4 // maximum number of physical channels on the TC4

// Calibration Values
// default values for systems without calibration values stored in EEPROM
#define CAL_GAIN 1.00 // you may substitute a known gain adjustment from calibration
#define UV_OFFSET 0 // you may subsitute a known value for uV offset in ADC
#define AMB_OFFSET 0.0 // you may substitute a known value for amb temp offset (Celsius)

// Time Base for slow PWM
// When NOT using PHASE_ANGLE_CONTROL option
// choose one of the following for the PWM time base for heater output on OT1 or OT2
//#define TIME_BASE pwmN4sec // recommended for Hottop D which has mechanical relay
//#define TIME_BASE pwmN2sec
//#define TIME_BASE pwmN1Hz // recommended for most electric heaters controlled by standard SSR
//#define TIME_BASE pwmN2Hz
//#define TIME_BASE pwmN4Hz
//#define TIME_BASE pwmN8Hz
//#define TIME_BASE 15 // should result in around 977 Hz (TODO these need testing)
//#define TIME_BASE 7 // approx. 1.95kHz
//#define TIME_BASE 6 // approx. 2.2kHz
//#define TIME_BASE 3 // approx. 3.9kHz

// Debuging Options
// Useful for debugging only -- leave inactive otherwise
//#define MEMORY_CHK

// This turns on the "# xxxxxxx\n" acknowledgements after commands
//#define ACKS_ON

// Output Pin Setup
// phase angle control and integral cycle control outputs
#define OT1 9 // OT1 is on pin D9
#define OT2 10 // OT2 is on pin D10
#define OT_PAC OT2 // phase angle control on OT2 (AC fan, usually)
#define OT_ICC OT1 // integral cycle control on OT1 (AC heater, usually)
#define LED_PIN 13

// Heater and Fan Duty Dispay Options
// These should NOT need adjusting. They control what gets streamed back to via serial
// These have no effect on operation and only affect what gets displayed/logged by Artisan
#ifdef IO3_HTR // If using PWM on IO3 for a heater
#define HEATER_DUTY levelIO3 // Heater output is assumed levelIO3 with heater connected to IO3
#else // If using ICC control of a heater connected to OT1
#define HEATER_DUTY levelOT1 // Heater output is assumed levelOT1 with heater connected to OT1
#define FAN_DUTY levelOT2 // Fan output is assumed levelOT2 for phase angle control mode on OT2
#else // PWM Mode
#define HEATER_DUTY levelOT1 // Heater output is assumed levelOT1 with heatre connected to OT1
#define FAN_DUTY levelIO3 // Fan output is assumed levelIO3 for PWM control of fan connected to IO3

// Phase Angle Control Options
// When using PHASE_ANGLE_CONTROL option
// Selct load type being switched by phase angle control
#define TRIAC_MOTOR // inductive loads need a longer pulse width to fire at 100%
//#define TRIAC_HEATER // enable this for resistive loads, like heaters

// AC Power Options
// When using PHASE_ANGLE_CONTROL option
#define FREQ60 // 60Hz
//#define FREQ50 // 50Hz

// Interrupt Options for Zero Cross Detector
// When using PHASE_ANGLE_CONTROL option
// use these if zero cross detector connected to I/O2
#define EXT_INT 0 // interrupt 0
#define INT_PIN 2 // pin 2
// use these for I/O3
//#define EXT_INT 1 // interrupt 1
//#define INT_PIN 3

OK, two things to try.
Change the connection on the board from I/O-3 if you have it there to I/O-2. Then go into user.h and at the bottom, change from I/O-3 to I/O-2 by changing the comments.
WWII mentioned he could not get 6.2 to work on I/O-3 and neither could I. I had to change mine to I/O-2.
OK, I see you settings post, and you are using I/O-2. Make sure that it also connect to the board on I/O-2, the schematic shows to connect it to I/O-3

Do you have a volt meter? If so, measure the control voltage to the fan relay on the two relay input termals. At 100% you should have approx. 1.6VDC. As you reduce the percentage, it should drop down to approx. .9VDC.
If you are getting the drop in voltage, you have a bad SSR.

I also see you have your POTS commented out. Are you using those?
Edited by BenKeith on 02/10/2017 9:45 AM
Paul Varga
I am not using the POTS, and I could not get any control using IO3. IO2 is what im using. Yes i have a volt meter. I will measure the voltage going to the relay as you described. Could i put a LED across the zcd out put and see if it is pulsing?
Paul Varga
Well, Something is working somewhat correctly now. what i did not realize is that the speed is not balanced from 0 to 100. it works from about 60 percent to 100 percent. from 0 to 50 ish it revs. the voltages do change with the speeds but not in proportion to the speed setting The voltage is 1.2 at speed 99 and still 1.2 at 50 percent and .98 at 10 percent
Edited by Paul Varga on 02/10/2017 10:42 AM
I think you would pretty much have to use an O-scope to see anything about what it's doing. I took a voltage reading on one of mine and it pretty much stayed on 4.2VDC. My SSR has an LED built into it and it has a fast flicker to but I there was very little change in it between 0 and 100 percent

I looked maybe trying to get some kind of an indication off the opt-coupler but the probes I had on that meter were too fat to safely do anything without chancing shorting it out. While I have the parts to build another, I really didn't care to try.
If you have an O-scope, I could look at some points to check with mine and tell you where and what mine showed.

Yes, actually I posted 1.6 but should have posted 1.4. I didn't check if the drop was linear, I just went for 100 (1.4V) to 0 (.9v) so it sounds like you might have an SSR problem
Edited by BenKeith on 02/10/2017 11:11 AM
OK, I took some more exact readings.
100% 1.44v
and it gradually drop until I got to 60% were it was at .97V
From 60 to 10% it made very little change.
Below 10% it started dropping again but I didn't like the way the motor was growling so I didn't read any lower, other that at zero were is was in the millivolts.

I suspect if I put the O-scope on it looked at the pulse width, it would be a fairly linear change, but we are only measuring the DC change.

Still looks to me like your relay might be the culprit.

Now most of mine are Crydon but I do have one I went cheap with just to see how they worked and ordered one of those $5 Chinese relays and it worked fine. I rarely use that controller so not sure how long they will last but that was about a year ago I built that one, and it still worked the last time I used it.
Edited by BenKeith on 02/10/2017 11:23 AM
Paul Varga
UPDATE... what i found out is that the issue may be a ground related issue. What i noticed is that i had the roaster plugged into a power strip that had the ground broken off and thats when i can get some sort of speed control, but when plugged straight into the wall i cant adjust the speed.
Wow, that's strange.
Actually I've never had a problem with that. Mine are always used on grounded outlets. In my work room, I have one old, non grounded outlet that I have plugged mine into when working on them or testing and they worked on it.

As for the ebay SSR, I made a quick look and it looks like the really cheap -10 ones that will work are not around now.
Paul Varga
and what i notice too is that when its plugged into a ungrounded outlet the speed is somewhat adjustable, and if i touch the metal of the roaster the speed picks up. If i put my hand over my mouse on my laptop it speeds up too. strange!
I just realized you said when the Roaster is plugged in. My roasters don't plug into the wall. They have two plugs, on for the heater and one for the fan, however both of those are two prong, ungrounded plugs. Those plug into my SSR controller which is plugged into grounded 120VAC outlet.

That sounds like one of those deals you had better hope you don't ground your body somewhere and then touch the roaster. Might light you up like a Christmas tree.
Edited by BenKeith on 02/10/2017 12:02 PM
Paul Varga
should my ground on the TC4 board be at the same potential as my earth ground?
Paul Varga
so perhaps i break the ground pin off the plug. lol. The chassis is grounded, but there is only a hot and neutral for the fan and heater. I realize that a ground is a safety feature, but its causing this to not work right.
The three TC4's I mostly use are in stand alone, plastic boxes. They connect buy a DB-9 cable to the SSR control panels. I will have to look and see if I ran a ground cable between the TC4 and the SSR's.

I checked and my TC4 is totally isolated from the AC. There is no grounds between it and the SSR controller. I have the ZCD mounted on the SSR panels but it's not grounded to them.
Edited by BenKeith on 02/10/2017 12:14 PM
Paul Varga
so maybe my ssr's being mounted to the same metal as my chassis is grounded to could be a issue? Right now the only things that are in contact with ground are the relay bottoms and my bean probe which is a ungrounded type and my motor that stirs the beans.
Paul Varga
My solution to this problem is that I did away with the ground prong on the power cord. It really is doing nothing for this application. It was originally hooked up when this was a cookie oven, but as for my setup I dont see what this ground is doing. It works somewhat correctly without it so thats what it will be.

Thanks everyone for your help.
Don't know. My SSR's are mounted on aluminum heat sinks that are mounted on a 1/4" aluminum plate. I mounted a 120VAC duplex outlet in a metal box on the aluminum plate. I split the tie strap between the two outlets on the duplex so they are single outlets. I run my fan SSR to one side and the heater SSR to the other size. The bonded ground in the outlet is connected to the aluminum plate and the bonded ground going to the wall outlet is grounded and the wall outlet is grounded. So everything about the AC side of mine is on a bonded ground, other than the fan and heater are two prong outlets but the fan motor is connected to the bonded ground through it's mounting. Just not much of a way to connect a bonded ground to a heating element.
Having worked with electrical and electronics most of my life, I just don't like the idea having un ground metal pieces working in conjunction with hot AC lines.
Jump to Forum: