Author Topic: Alternative PID controller or PLC project  (Read 9622 times)

0 Members and 1 Guest are viewing this topic.

Offline HackedFridgeMagnetTopic starter

  • Super Contributor
  • ***
  • Posts: 2028
  • Country: au
Alternative PID controller or PLC project
« on: September 04, 2014, 12:15:19 am »
Hi
I want to implement temperature control at a small mushroom farm. About 10 rooms, therefore 10 units. Currently they are doing it manually.
I want a bit more than the basic PID controller.
Cost is reasonably important for the hardware, but not so much for the software. I will do it myself at night.
It seems I might be able to use off the shelf hardware, such as a Dev board or a cheapass PID with the guts removed.
Or maybe one of those extruded boxes and do my own front panel and MCU board.
Looking for suggestions to what is not a unique problem.

Requirements:
   3-6 sense inputs at least 2 temperature and 1 humidity
   3-6 relay outputs to switch 10A loads, possibly 3 phase.
   0-2 pwm capable outputs
   0-100 gpio outputs
   SD card for logging maybe FAT
   RTC (must have)
   network either RS485 or LAN or wireless or USB
   small display and about four front panel buttons
   I may need some reasonable degree of ingress protection for the buttons and display, say IP54.
   hopefully based on an ARM cortex CPU with around 128k ram, STM preferred, but it really doesn't matter as long as I can write code for it.

I usually struggle with the mechanical design, if someone knows of a nice mechanical solution to this problem, attaching buttons and displays, I can easily spin a board to suit.
« Last Edit: September 04, 2014, 12:33:33 am by HackedFridgeMagnet »
 

Offline Alex Eisenhut

  • Super Contributor
  • ***
  • Posts: 3338
  • Country: ca
  • Place text here.
Re: Alternative PID controller project
« Reply #1 on: September 04, 2014, 12:27:25 am »
Eeep, sounds like a job for a PLC. Those ain't cheap.
Hoarder of 8-bit Commodore relics and 1960s Tektronix 500-series stuff. Unconventional interior decorator.
 

Offline HackedFridgeMagnetTopic starter

  • Super Contributor
  • ***
  • Posts: 2028
  • Country: au
Alternative PID controller or PLC project
« Reply #2 on: September 04, 2014, 12:32:54 am »
Yes, that did cross my mind, maybe I should rename my thread.

Quote
If you can buy it for 3$ on eBay, why design it?
Thats the sort of attitude I need.
« Last Edit: September 04, 2014, 12:34:32 am by HackedFridgeMagnet »
 

Online moffy

  • Super Contributor
  • ***
  • Posts: 1734
  • Country: au
Re: Alternative PID controller or PLC project
« Reply #3 on: September 04, 2014, 12:45:02 am »
Go with a Raspberry Pi. They have shields with all the extra functionality you will need.
 

Offline HackedFridgeMagnetTopic starter

  • Super Contributor
  • ***
  • Posts: 2028
  • Country: au
 

Offline Alex Eisenhut

  • Super Contributor
  • ***
  • Posts: 3338
  • Country: ca
  • Place text here.
Re: Alternative PID controller or PLC project
« Reply #5 on: September 04, 2014, 01:27:25 am »
Yes, that did cross my mind, maybe I should rename my thread.

Quote
If you can buy it for 3$ on eBay, why design it?
Thats the sort of attitude I need.

The PLC will have solved all the problems you'll encounter plus you have the industrial "hardness" you won't get with Raspberry Pi et al. Sorry, that's just the way it is. You just won't be able to get 24/7/365 uptimes in a messy environment with some slapped-together ad hoc stuff, no matter how hard you try, unless you spend 4 times the amount instead of just getting a PLC.

Just IMO.

But programming PLCs uses ladder or GRAFCET which is its own little world.
Hoarder of 8-bit Commodore relics and 1960s Tektronix 500-series stuff. Unconventional interior decorator.
 

Offline HackedFridgeMagnetTopic starter

  • Super Contributor
  • ***
  • Posts: 2028
  • Country: au
Re: Alternative PID controller or PLC project
« Reply #6 on: September 04, 2014, 01:49:20 am »
Quote
The PLC will have solved all the problems you'll encounter plus you have the industrial "hardness" you won't get with Raspberry Pi et al. Sorry, that's just the way it is. You just won't be able to get 24/7/365 uptimes in a messy environment with some slapped-together ad hoc stuff, no matter how hard you try, unless you spend 4 times the amount instead of just getting a PLC.

Just IMO.

But programming PLCs uses ladder or GRAFCET which is its own little world.

Yeah i can appreciate what you are saying, but I would like an cheaper and more sophisticated option, this could be used for other projects as they come up.
I don't doubt I can get pretty close to full uptime with some appropriate slapping together, and some time spent refining things.
User error is much more likely to cause trouble.
Yeah not touching Ladder logic, it justs seems stupid to me.


Here is an open source contender.

http://startingelectronics.com/projects/large-open-source-PLC/PLC-components/
or
http://startingelectronics.com/projects/small-open-source-PLC/


closed source but inexpensive plcs, I haven't heard of them before.
http://velocio.net/ace/
 

Online IanB

  • Super Contributor
  • ***
  • Posts: 11882
  • Country: us
Re: Alternative PID controller or PLC project
« Reply #7 on: September 04, 2014, 02:05:29 am »
Have you looked into an off-the-shelf small building HVAC controller? Most likely you would find a unit that does what you need without having to invent one, unless you really want to make it a hobby project. I'm sure the agriculture world is faced with this kind of problem often enough that there are pre-packaged solutions.
 

Offline HackedFridgeMagnetTopic starter

  • Super Contributor
  • ***
  • Posts: 2028
  • Country: au
Re: Alternative PID controller or PLC project
« Reply #8 on: September 04, 2014, 04:18:18 am »
Quote
Have you looked into an off-the-shelf small building HVAC controller?
You mean like this?
http://www.ebay.com/itm/CAREL-PCO5-HVAC-Compact-Controller-PCOX000BB0-I-O-Board-PC05-/181394207662?pt=BI_Control_Systems_PLCs&hash=item2a3beff3ae

Thanks for the suggestion.
I am just not sure it would be easier, than PID controllers and I still have limited flexibility and a reasonable expense. Depending on how many of these I need.

 

Offline Rerouter

  • Super Contributor
  • ***
  • Posts: 4694
  • Country: au
  • Question Everything... Except This Statement
Re: Alternative PID controller or PLC project
« Reply #9 on: September 04, 2014, 08:19:32 am »
could you break the tasks into more than one device, e.g. a simple multi-channel temp controller / plc, and something more advanced to handle the I/O and logging, after all just about any plc with logic I/O can have data shifted in or out serially,
 

Offline HackedFridgeMagnetTopic starter

  • Super Contributor
  • ***
  • Posts: 2028
  • Country: au
Re: Alternative PID controller or PLC project
« Reply #10 on: September 04, 2014, 12:19:02 pm »
could you break the tasks into more than one device, e.g. a simple multi-channel temp controller / plc, and something more advanced to handle the I/O and logging, after all just about any plc with logic I/O can have data shifted in or out serially,
I guess I could but I am not sure of the utility of having the controller and the logger both measuring temperature separately.

I am thinking that there would be boards or hardware out there that would have these type of core functions available already, be fairly robust and reliable, on top of which I could write C code to control, instead of using some half-assed user interface.
 
 

Offline ajb

  • Super Contributor
  • ***
  • Posts: 2601
  • Country: us
Re: Alternative PID controller or PLC project
« Reply #11 on: September 04, 2014, 05:48:31 pm »
How cheap is cheap enough for a PLC solution?  There are some incredibly low cost PLC options these days, such as AutomationDirect's CLICK series.  Not sure about availability in Australia, but I think they tick all your boxes (except maybe the PWM, but you could use an analog output to control a PWM driver if you really need it).
 

Offline HackedFridgeMagnetTopic starter

  • Super Contributor
  • ***
  • Posts: 2028
  • Country: au
Re: Alternative PID controller or PLC project
« Reply #12 on: September 04, 2014, 11:44:01 pm »
Thanks for the link, they are available in Australia, but the website is borked.
They look very well thought out. I'll get some pricing. No doubt it will be double the US price.
 

Offline DenzilPenberthy

  • Frequent Contributor
  • **
  • Posts: 409
  • Country: gb
Re: Alternative PID controller or PLC project
« Reply #13 on: September 08, 2014, 02:31:58 pm »
I'd say a PLC is the only sensible way to approach this project if you want the 10 rooms all controlled from a central point. As has been mentioned above. You'll more than recoup the initial cost by not having to deal with 101 issues later down the line  with everything from electrical ruggedness of inputs to how to mechanically connect everything up to to how to ensure the the system complies with all the relevant regulations.

With a PLC system it'll take you a day to do all of the mechanical work, installation and wiring then you can write some code. How long will you take designing something, making a PCB, assembling, testing, re-working?, building an enclosure, mounting it all on some sort of panel, soldering wires to your board etc? I don't know what you value your hourly rate at but I guarantee the PLC is cheaper :)

Do you have some sort of insurance which will cover you when a homemade thing with a Raspberry Pi malfunctions and spoils a whole crop of mushrooms or burns the place down?

An alternative and very simple approach would be a domestic central heating controller with a thermostat in each room feeding a contactor that supplies a heater.
 

Offline HackedFridgeMagnetTopic starter

  • Super Contributor
  • ***
  • Posts: 2028
  • Country: au
Re: Alternative PID controller or PLC project
« Reply #14 on: September 08, 2014, 03:53:30 pm »
Thanks for having a go Denzil.
Quote
You'll more than recoup the initial cost by not having to deal with 101 issues later down the line  with everything from electrical ruggedness of inputs to how to mechanically connect everything up to to how to ensure the the system complies with all the relevant regulations.
Yeah I can appreciate that this is the standard line, dont reinvent the wheel etc.
But really all I am looking for is something with IO capabilites, similar to a PLC but which is based on an MCU and for which I can write custom firmware in C. I am just not sure why I can't seem to get it off the shelf.
The ruggedness is not that hard to sort out, neither are the regulations, either way it needs a licenced sparky to do the mains wiring and so they can to the SELV wiring too. Luckily I have that licence.

Yeah raspberry pi is not an option, never was.

Quote
How long will you take designing something, making a PCB, assembling, testing, re-working?, building an enclosure, mounting it all on some sort of panel, soldering wires to your board etc? I don't know what you value your hourly rate at but I guarantee the PLC is cheaper :)
Yeah is true but on the other hand this type of PCB is not rocket science either.
The mechanical stuff is time consuming but much of it would need to be done if using PLCs too.

Quote
An alternative and very simple approach would be a domestic central heating controller with a thermostat in each room feeding a contactor that supplies a heater.
This might be a good starting point. Just get something up and running first.
« Last Edit: September 08, 2014, 03:55:07 pm by HackedFridgeMagnet »
 

Online IanB

  • Super Contributor
  • ***
  • Posts: 11882
  • Country: us
Re: Alternative PID controller or PLC project
« Reply #15 on: September 08, 2014, 04:48:52 pm »
But really all I am looking for is something with IO capabilites, similar to a PLC but which is based on an MCU and for which I can write custom firmware in C. I am just not sure why I can't seem to get it off the shelf.

I think because there is absolutely no industrial market for such a thing. Very few people can write C control code, and even fewer can write safe and bug free code. It is invariably the case that industrial controllers are configured at a high level using a standard control language such as specified by IEC 61131-3. I'm not sure what you believe you can't accomplish using such a system?
 

Offline HackedFridgeMagnetTopic starter

  • Super Contributor
  • ***
  • Posts: 2028
  • Country: au
Re: Alternative PID controller or PLC project
« Reply #16 on: September 08, 2014, 11:27:15 pm »
Appreciate your input Ian but I guess I am just not very satisfied with the PLC solution.
Probably the only reason I will end up going with PLCs is that this would be the industry standard way.

Quote
Very few people can write C control code
I have no proof but I disagree.

Quote
and even fewer can write safe and bug free code
It seems you could write just as many bugs with IEC 61131-3, maybe more if you haven't used it before.

Quote
I'm not sure what you believe you can't accomplish using such a system?
I guess I was put off by the price, especially once you double it when you buy off the local distributor who wont advertise their prices, you even have to apply to get a price.
Also don't want the vendor lock in.
For temperature control you could do it with an ATTiny. It seems so simple.
 

Offline orion242

  • Supporter
  • ****
  • Posts: 746
  • Country: us
Re: Alternative PID controller or PLC project
« Reply #17 on: September 09, 2014, 12:15:33 am »
Rolling your own seems crazy to me.  I wouldn't hesitate using HVAC / PLC controller for this.  They may not program in C but they can do anything that this is likely to require and a heck of alot more.  Built in web server, data logging, emailed alarms, etc all right out of the box.  You simply cannot match it unless your donating unlimited amounts of your time for free.

Exactly what will you be telling this farmer if your hand rolled controller runs into a hardware / software bug and kills his crop?
 

Offline HackedFridgeMagnetTopic starter

  • Super Contributor
  • ***
  • Posts: 2028
  • Country: au
Re: Alternative PID controller or PLC project
« Reply #18 on: September 09, 2014, 01:07:36 am »
Quote
Exactly what will you be telling this farmer if your hand rolled controller runs into a hardware / software bug and kills his crop?
Don't worry there are many ways to kill a crop, I am confident that they can manage to do that without me. ;)


FWIW: here is an old thread that is similar to this one. It didn't get past "use a PLC" either. https://www.eevblog.com/forum/projects/plc-design-using-mcu/



I'll just go with the minimum, some ebay HVAC controllers. They have different time periods and a 3 level fan control which I may be able to use as multiple outputs.
Thanks for the input.
« Last Edit: September 09, 2014, 01:19:25 am by HackedFridgeMagnet »
 

Offline orion242

  • Supporter
  • ****
  • Posts: 746
  • Country: us
Re: Alternative PID controller or PLC project
« Reply #19 on: September 09, 2014, 01:35:56 am »
I think you would be surprised what the "minimum" hvac controllers can do.  Unfortunately the market is pretty limited in what they sell over the counter.

Loytec has a good collection of freely programmables that they sell to anyone.  Software is available on their site free of charge.  There are others but I'm not sure what the land of oz has.  Getting your hands on the programing software will limit what use you will get out of ebay controllers unless they are simple staging / PID canned controls.
 

Offline HackedFridgeMagnetTopic starter

  • Super Contributor
  • ***
  • Posts: 2028
  • Country: au
Re: Alternative PID controller or PLC project
« Reply #20 on: September 09, 2014, 04:03:44 am »
Quote
Loytec has a good collection of freely programmables that they sell to anyone.  Software is available on their site free of charge.  There are others but I'm not sure what the land of oz has.  Getting your hands on the programing software will limit what use you will get out of ebay controllers unless they are simple staging / PID canned controls.
Ok I requested a quote for a small system from loytec asia. I'll see if they can come back with a price.

I wish they just put a price on the Web.

 

Offline DenzilPenberthy

  • Frequent Contributor
  • **
  • Posts: 409
  • Country: gb
Re: Alternative PID controller or PLC project
« Reply #21 on: September 09, 2014, 12:24:36 pm »

Yeah I can appreciate that this is the standard line, dont reinvent the wheel etc.
But really all I am looking for is something with IO capabilites, similar to a PLC but which is based on an MCU and for which I can write custom firmware in C. I am just not sure why I can't seem to get it off the shelf.


Essentially, the sort of processes that PLCs are typically used for aren't easy to write C code for. You might have thousands of inputs all doing things asynchronously which need dealing with in parallel.

I wouldn't underestimate the effort needed to write an RTOS for your MCU that can deal with that and be guaranteed not to crash or do something weird. I get the impression though that you probably know your stuff with C though so maybe it's fear of the unknown on my part but it's not a project I'd want to take on. All the time you spend working on that is not time spent solving your problem, it is time spent getting to the starting point of having a stable reliable platform to start solving your problem.

A PLC comes out of the box, clips on a DIN rail and you're away. Someone else has done all of the hard work and you're straight to work on writing code/ladder logic to implement your system.

Ladder logic has a weird reputation as being obscure and hard. I have no idea where this comes from, it's really simple and intuitive.
 

Offline HackedFridgeMagnetTopic starter

  • Super Contributor
  • ***
  • Posts: 2028
  • Country: au
Re: Alternative PID controller or PLC project
« Reply #22 on: September 09, 2014, 11:58:54 pm »
Quote
You might have thousands of inputs all doing things asynchronously which need dealing with in parallel.
Lol, unfortunately this isn't me.

I started out as a young cadet with a bit of ladder logic. It doesn't hold any fears apart from I feel like it's wasting my time with an archaic technology.

My main fear is with the plc frameworks and the vendor buyin. I don't wont to be stuck with some incompatible stupid useless framework full of gotchas when I could have the source code in front of me.
Yeah I am a bit of a control freak, and getting on the phone and talking to tech support when ever there is an issue is not my idea of fun.
In comparison the last project I designed is going well in the field, passed compliance with some help, has A2D, GPIO, RTOS, USB, Radio comms, SDIO, various displays and importantly is debuggable.
I feel a custom PLC-PID device for low speed control would be a walk in the park in comparison.

That said for this job I have received a good response from a distributor selling Novus industrial control gear.
The prices are more reasonable than I was expecting.
It would be wrong of me to recommend my own controller as much as I would like to.


 

Offline Michael Rempel

  • Contributor
  • Posts: 14
Re: Alternative PID controller or PLC project
« Reply #23 on: September 20, 2014, 11:56:12 pm »
All your requirements can be met with an arduino. You dont need the speed of a Raspberry Pie. My examples are random picks off ebay, not recommendations. But at Hong Kong prices you can do a lot of sensors for almost nothing.

30A relays controlled by 5v are available. Example:
http://www.ebay.ca/itm/Relay-Module-5V-30A-High-Power-For-Arduino-AVR-PIC-DSP-ARM-SLA-05VDC-SL-A-/321194809724?pt=LH_DefaultDomain_0&hash=item4ac8b3d97c

Humidity and temperature modules are available.
http://www.ebay.ca/itm/New-DHT11-Temperature-and-Relative-Humidity-Sensor-Module-With-Cable-for-Arduino-/161374574354?pt=LH_DefaultDomain_0&hash=item2592ac9712


Rather than a PID controller just program it with some hysteresis. At min value have it turn on the furnace relay, and at max turn it off. You can also graph the temperature against the set points and have an alarm for situations that get out of hand for free. You should also monitor doorways, outside temperature, and any other thermal / humidity changing sources. That way you can develop knowledge of operational conditions and make a plan. Also note that the effects of opening a door on the whole house can not be estimated from a single point effectively. You need multiple sensors in each space. Even then some back of the napkin air flow dispersion calculations are usually used. Wind speed and direction come into play too. But you can probably interpolate your data to figure out the effect once you have used your system for a while.

If you want to try PLC then I suggest automationdirect.com but the Arduino is a better idea IMHO. I have done both successfully. One of my designs is a straw burning furnace for green houses that generates upward of 6 million BTU for a client: Triple Green Energy.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf