PWM vs Time Proportional PID Heating Control

The forum for discussing all kinds of brewing paraphernalia.
JabbA

Re: PWM vs Time Proportional PID Heating Control

Post by JabbA » Wed Jan 17, 2018 8:48 pm

Are You using a UNO or Mega2560?

I switched to a MEGA2560 for the additional PWM pins it offers.
I started with an Uno then put my own board together based on the Atmega1284p chip. Then I did indeed switch to the Mega 2560 when I ran out out of pins, and the 1284p circuit was a little unreliable.

As it happens the PCBs for the 'sheild' I designed turned up yesterday.

Cheers,
Jamie.

brewzone

Re: PWM vs Time Proportional PID Heating Control

Post by brewzone » Wed Jan 17, 2018 8:52 pm

A couple of screen shots of the PID graph function.

It shows the SP PV and Output on a continually updating radar like display.

Image
Image
Image
Image
Image

brewzone

Re: PWM vs Time Proportional PID Heating Control

Post by brewzone » Wed Jan 17, 2018 9:12 pm

JabbA wrote:
Wed Jan 17, 2018 8:48 pm
Are You using a UNO or Mega2560?

I switched to a MEGA2560 for the additional PWM pins it offers.
I started with an Uno then put my own board together based on the Atmega1284p chip. Then I did indeed switch to the Mega 2560 when I ran out out of pins, and the 1284p circuit was a little unreliable.

As it happens the PCBs for the 'sheild' I designed turned up yesterday.

Cheers,
Jamie.
How many and how much if I may ask ?

JabbA

Re: PWM vs Time Proportional PID Heating Control

Post by JabbA » Wed Jan 17, 2018 10:10 pm

I had 5 made by Seedstutio, cost around £12 with overland shipping, around 10 days. I've not got round to soldering it all up yet, but realised I've got a couple of pins the wrong way round. I'm undecided whether to cut traces and bodge it together or get another batch of boards made!

Image

The NodeMCU is simply to enable the status of the brewery to be sent via WiFi to NodeRED running my my RaspberryPi. It's a but overkill, but I brought a job lot and had space for it on the board!

Cheers,
Jamie

brewzone

Re: PWM vs Time Proportional PID Heating Control

Post by brewzone » Thu Jan 18, 2018 4:57 pm

That is reasonable.

Will have to look into getting some made Myself.

Cheers Jabba

brewzone

Re: PWM vs Time Proportional PID Heating Control

Post by brewzone » Sat Jan 27, 2018 12:28 am

Edited and moved post to My Effect of Kp Ki and Kd on PID Output thread.

viewtopic.php?f=6&t=80200&p=828677#p828677

JabbA

Re: PWM vs Time Proportional PID Heating Control

Post by JabbA » Sat Jan 27, 2018 11:33 am

I've implemented PWM on my sous vide controller and it works well, I'm currently getting +/- 0.1 degree accuracy with just a crude attempt at tuning. I'll have a better go at tuning too see if I can get it better.

I've decided not to populate the PCBs, hopfully I can get a revised board back from China before spring festival!

Cheers,
Jamie

brewzone

Re: PWM vs Time Proportional PID Heating Control

Post by brewzone » Sat Jan 27, 2018 1:29 pm

It seemed everyone preferred to buy Their PID's with a SSR rather than a mechanical version a few years back.

I never got around to trying one out as I was just too busy on other projects.

As I'm brewing a bit more at Home now I decided it was time to have a tinker around.

As I plan to build a Rims or Herms sytem I thought the 10 second window of Time Proportional might not react quick enough to changes.

brewzone

Re: PWM vs Time Proportional PID Heating Control

Post by brewzone » Sat Jan 27, 2018 3:20 pm

JabbA wrote:
Sat Jan 27, 2018 11:33 am
I've implemented PWM on my sous vide controller and it works well, I'm currently getting +/- 0.1 degree accuracy with just a crude attempt at tuning. I'll have a better go at tuning too see if I can get it better.

I've decided not to populate the PCBs, hopfully I can get a revised board back from China before spring festival!

Cheers,
Jamie
Looking forward to hearing how the new values work out.

brewzone

Re: PWM vs Time Proportional PID Heating Control

Post by brewzone » Sat Feb 10, 2018 1:21 am

Spent a few days setting the Arduino Mega to do PWM at 50Hz with a duty cycle between 0-1023 on Pin44 rather than the stock settings that the core libraries seem to impose of 490hz with a duty cycle between 0-255.

To introduce some protection against the SSR failing in the on state I'm looking at using either a contactor or a cheaper mechanical relay.

Next project an Arduino oscilloscope.

brewzone

Re: PWM vs Time Proportional PID Heating Control

Post by brewzone » Thu Feb 22, 2018 2:37 pm

If using timer5 to control pins 44 45 and 46 the only way of getting 1024 levels of control is with a 20.48 second or 0.0488hz frequency allowing 0.02ms per level of control with a 50hz UK mains frequency.

This probably explains why the arduino pid library uses timer2 at 15ms intervals using the overflow vector interrupt and a time proportional window of 10 seconds giving 512 levels of control.

Post Reply