Yet another Arduino Based Brewing controller

Australia & New Zealand Homebrewing Forum

Help Support Australia & New Zealand Homebrewing Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.
TheWiggman said:
I have a genuine FOTEK 40A and ripoff 25A with a new one in the mail.

http://www.fotek.com.hk/solid/SSR-1.htm

Still struggling with the idea that the Chinese are ripping off their already low quality products.
Lol, yeah it's a little ridiculous. Still, there are a lot of businesses in China and some good stuff - so lots of business opportunity I guess.

Looks like a <10ms response time to turn on. This should actually be the time for the LED in the photocoupler to turn on, and the photoresistor (or whatever) tu pick this up and send voltage to the AC zero switching circuit.

At 50Hz, a half wave is 10ms. So as long as your PID signal it holding ON when the signal gets to the zero crossing detection, it will turn on the element. If it's then OFF within the half wave, it will only turn off at the next zero crossing, so a period of 10ms. That's zero switching and 50Hz, not really an SSR spec.

So really, if you have a 10ms on signal and an 8s response time, even if it gets the signal early it should still be responding (8ms passed), on (from the input) and going past a zero crossing, so the element turns on.

So what if the input signal is less than 10ms, say 8s? Is the response time were 6s, you've got 2s of overlap to get that zero crossing in and 10ms of element time. But you could also miss it completely - with your input off before the zero crossing.

So, really, your minimum input time should be something like 12ms. How's do you do this? Probably a few things to consider:
-you can keep the PIDoutputlimits to (0,255) (doubles) and recognise that for certain outputs it won't turn on the SSR
-You could set the outputs to (1,255), and the slice/window to be whatever 1/255 would be to equal 12ms (3s would benefit appropriate)
-you could multiply the output by 2.5 to normalise the 0-255 to 0-100, but I would recommend rolling the gain back to 400-500.

There are probably some other things too - but basically any output at the moment that is less than 10ms probably won't do anything.
 
Are you able to step through the code line by line (like pressing F5) with setpoint and input set, and see what the output and error are for a single iteration of the PID compute loop?

Perhaps 'input' and setpoint are not the correct variables to force but whatever you can set as far upstream as possible (even a voltage number from the temperature).
 
Adr_0 said:
Are you able to step through the code line by line (like pressing F5) with setpoint and input set, and see what the output and error are for a single iteration of the PID compute loop?

Perhaps 'input' and setpoint are not the correct variables to force but whatever you can set as far upstream as possible (even a voltage number from the temperature).
Hmm, I guess I could make a "debug" version that logged them to the screen.
AFAIK (and currently) there's no real debug features with Arduino.

But being a coding-carmudgeon, I'll warrant that a good debug-log is better than any fancy debugging IDE.
 
Adr_0 said:
Are you able to step through the code line by line (like pressing F5) with setpoint and input set, and see what the output and error are for a single iteration of the PID compute loop?

Perhaps 'input' and setpoint are not the correct variables to force but whatever you can set as far upstream as possible (even a voltage number from the temperature).
Could do. The way I did this prior to using the controller in this thread was to just run the PID program by itself and write to the serial port, reading real-time though the software. If you want a single iteration just upload and put a pause in the software after the PID output is calculated.
 
Cool. It would become interesting to see 20°C error (approx), 1 and 0.1 if possible with just P of 500-1000 ans I, D set at 0.

This way the output would be known, and we can consider the next steps from there.
 
No promises I can do this in the short term, but if/when I respond I'll put it in the PID thread for you.
 
Here's the layout nearly complete. I'm going to hook up a 1.3A fuse to the 10A socket and add a relay so I can use the program to control the pump as a later date. Haven't been able to get home in time.e to catch Jaycar open.

1488693880897.jpg
 
Looks good. I'm envious of your plug-wiring :D

What I would like to add to mine is a USB-socket so I can plug-into the Arduino without taking the cover off.
 
I was thinking exactly the same thing regarding the USB. If you find a good one that's 'plug and play' let me know. I have some panel mount USB sockets but they go to a pin layout for a motherboard.

I had a quick effort at it again yesterday and I'm getting sensor errors AGAIN. Shitty. The only thing different is I removed a jumper between the DC -ve and mains earth. I might put it back in place and play around with a few more pullup resistors. Also might try and move that earth cable away from the 10A socket.
 
No it's the red, black and yellow cables on the top right with the two external 3.5mm jacks. The 3 you mention are the for the SSRs with the black being -ve.
 
Ok, cool. So you've got a couple of sensors? Have you tried putting 100nF ceramic capacitors between the ground and supply of each sensor? With a digital signal it would not be a good idea to put them between ground and data.

At the socket would probably be best - with the goal to filter out spikes from inside your main box before they get to the sensors.
 
Adr_0 said:
Ok, cool. So you've got a couple of sensors? Have you tried putting 100nF ceramic capacitors between the ground and supply of each sensor? With a digital signal it would not be a good idea to put them between ground and data.

At the socket would probably be best - with the goal to filter out spikes from inside your main box before they get to the sensors.
Is there something special about 100nF ceramic caps Addr_0 ?
How come we use such small capacitors? Would bigger or smaller also work?
(sorry for the stupid question, but I didn't do any more EE after first year).
 
Mr Wibble said:
Is there something special about 100nF ceramic caps Addr_0 ?
How come we use such small capacitors? Would bigger or smaller also work?
(sorry for the stupid question, but I didn't do any more EE after first year).
Smooth out power delivery, too big is a waste, too small will have little effect.
 
Mr Wibble said:
Is there something special about 100nF ceramic caps Addr_0 ?
How come we use such small capacitors? Would bigger or smaller also work?
(sorry for the stupid question, but I didn't do any more EE after first year).
Don't ask me, I'm not an electrical engineer...

100nF is a pretty common size for bypass capacitors. So is 220nF and 10nF. Having at least something there gets you 90% there - if noise is an issue - as it allows AC (likely high frequency) sitting on the DC lines to flow through the capacitor to ground rather than into your sensor - hence the term 'bypass capacitor'.

The sizing/capacitance is related to reactance, ie resistance to current flow. Those sizes will have a reactance pretty high at 50Hz - 15-30,000ohms - which means very little current will flow through, but some will still get through (good).

Hopefully you don't have a lot of AC current on your DC supply lines...

But at higher frequencies, a reasonable amount of current will pass through if it's there in AC form. Spikes and RF interference should fall into this category, while mains hum will fall into the former - it should help a bit.

I wouldn't see too much disadvantage in going a 220 or 560nF - but most circuits out there are perfectly fine with 100nF.
 
Well wicked. I got some 100mF caps from work because that's all they had. Put one across the 3.5mm jacks as well as a 1.4k resistor from the signal to power. Power up and boom: result. Finally in a state where I'm ready to brew.
 
TheWiggman said:
Well wicked. I got some 100mF caps from work because that's all they had. Put one across the 3.5mm jacks as well as a 1.4k resistor from the signal to power. Power up and boom: result. Finally in a state where I'm ready to brew.
Shit hot. Go RF theory!
 
I just committed some minor changes to the code base:
1/ Fix that initial bogus temperature alarm message. With a trusty hair-drier I can confirm that alarms come and go, as planned.
2/ Set the PID parameters to P,I,D = 600, 0, 0 as per TheWiggman's experimental results - I'm going to test these myself in a sec.

With the Arduino IDE 1.6.13 there's now about 2000 bytes of programming space left. Previously (IDE 1.5.x) this was in the low-hundreds (IIRC).
Maybe we can add a bluetooth write-only stream of data. That way a phone (or pc, whatever) could log temperatures, etc.
I guess we could log heater-coil activations and step-mash steps too.
 
Have you had any temperature error issues like TheWiggman?
 

Latest posts

Back
Top