Alternative PID controller or PLC project - Page 1
Forum section: electronics / projects

author: HackedFridgeMagnet
author_rank: Super Contributor
timestamp: September 04, 2014, 12:15:19 am
content: HiI 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 humidity3-6 relay outputs to switch 10A loads, possibly 3 phase.0-2 pwm capable outputs0-100 gpio outputsSD card for logging maybe FATRTC (must have)network either RS485 or LAN or wireless or USBsmall display and about four front panel buttonsI 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.

author: Alex Eisenhut
author_rank: Super Contributor
timestamp: September 04, 2014, 12:27:25 am
content: Eeep, sounds like a job for a PLC. Those ain't cheap.

author: HackedFridgeMagnet
author_rank: Super Contributor
timestamp: September 04, 2014, 12:32:54 am
content: Yes, that did cross my mind, maybe I should rename my thread.QuoteThats the sort of attitude I need.

author: moffy
author_rank: Super Contributor
timestamp: September 04, 2014, 12:45:02 am
content: Go with a Raspberry Pi. They have shields with all the extra functionality you will need.

author: HackedFridgeMagnet
author_rank: Super Contributor
timestamp: September 04, 2014, 01:25:02 am
content: Here is an open source contender.http://startingelectronics.com/projects/large-open-source-PLC/PLC-components/orhttp://startingelectronics.com/projects/small-open-source-PLC/closed source but inexpensive.http://velocio.net/ace/

author: Alex Eisenhut
author_rank: Super Contributor
timestamp: September 04, 2014, 01:27:25 am
content: Quote from: HackedFridgeMagnet on September 04, 2014, 12:32:54 amThe PLC will have solved all the problems you'll encounter plus you have the industrial "hardness" you won't get with Raspberry Piet 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.

author: HackedFridgeMagnet
author_rank: Super Contributor
timestamp: September 04, 2014, 01:49:20 am
content: QuoteYeah 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/orhttp://startingelectronics.com/projects/small-open-source-PLC/closed source but inexpensive plcs, I haven't heard of them before.http://velocio.net/ace/

author: IanB
author_rank: Super Contributor
timestamp: September 04, 2014, 02:05:29 am
content: 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.

author: HackedFridgeMagnet
author_rank: Super Contributor
timestamp: September 04, 2014, 04:18:18 am
content: QuoteYou 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=item2a3beff3aeThanks 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.

author: Rerouter
author_rank: Super Contributor
timestamp: September 04, 2014, 08:19:32 am
content: 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,

author: HackedFridgeMagnet
author_rank: Super Contributor
timestamp: September 04, 2014, 12:19:02 pm
content: Quote from: Rerouter on September 04, 2014, 08:19:32 amI 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.

author: ajb
author_rank: Super Contributor
timestamp: September 04, 2014, 05:48:31 pm
content: How cheap is cheap enough for a PLC solution? There are some incredibly low cost PLC options these days, such as AutomationDirect'sCLICK 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).

author: HackedFridgeMagnet
author_rank: Super Contributor
timestamp: September 04, 2014, 11:44:01 pm
content: 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.

author: DenzilPenberthy
author_rank: Frequent Contributor
timestamp: September 08, 2014, 02:31:58 pm
content: 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 cheaperDo 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.

author: HackedFridgeMagnet
author_rank: Super Contributor
timestamp: September 08, 2014, 03:53:30 pm
content: Thanks for having a go Denzil.QuoteYeah 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.QuoteYeah 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.QuoteThis might be a good starting point. Just get something up and running first.

author: IanB
author_rank: Super Contributor
timestamp: September 08, 2014, 04:48:52 pm
content: Quote from: HackedFridgeMagnet on September 08, 2014, 03:53:30 pmI 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?

author: HackedFridgeMagnet
author_rank: Super Contributor
timestamp: September 08, 2014, 11:27:15 pm
content: 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.QuoteI have no proof but I disagree.QuoteIt seems you could write just as many bugs with IEC 61131-3, maybe more if you haven't used it before.QuoteI 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.

author: orion242
author_rank: Unknown
timestamp: September 09, 2014, 12:15:33 am
content: 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?

author: HackedFridgeMagnet
author_rank: Super Contributor
timestamp: September 09, 2014, 01:07:36 am
content: QuoteDon'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.

author: orion242
author_rank: Unknown
timestamp: September 09, 2014, 01:35:56 am
content: 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.

author: HackedFridgeMagnet
author_rank: Super Contributor
timestamp: September 09, 2014, 04:03:44 am
content: QuoteOk 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.

author: DenzilPenberthy
author_rank: Frequent Contributor
timestamp: September 09, 2014, 12:24:36 pm
content: Quote from: HackedFridgeMagnet on September 08, 2014, 03:53:30 pmEssentially, 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.

author: HackedFridgeMagnet
author_rank: Super Contributor
timestamp: September 09, 2014, 11:58:54 pm
content: QuoteLol, 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.

author: Michael Rempel
author_rank: Contributor
timestamp: September 20, 2014, 11:56:12 pm
content: 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=item4ac8b3d97cHumidity 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=item2592ac9712Rather 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.