Low Cost PCB's Low Cost Components

Author Topic: EEVacademy #6 - PID Controllers Explained  (Read 2826 times)

0 Members and 1 Guest are viewing this topic.

Offline Howardlong

  • Super Contributor
  • ***
  • Posts: 3799
  • Country: gb
Re: EEVacademy #6 - PID Controllers Explained
« Reply #25 on: September 06, 2017, 03:38:01 PM »
Quote
Not that much: "For personal use only. Not for government, academic, research, commercial, or other organizational use."

It remains the case that Matlab is mainly in regular use in universities and for non-commercial purposes. I think the cost is far to high for businesses and commercial organizations to make general use of it.

Ok, Octave is free and is almost compatible with matlab, which ever one you choose is OK, and please use Cortex M and the DSP math lib for them, they are free too :)

Counter intuitively, some of the CMSIS DSP library is far from optimal either, ISTR that the M4F  floating point FIR decimator is an example, I am sure there are others. I rolled my own, which was a lot more educational, and for my application was two orders of magnitude faster. Vendors often concentrate their efforts on headline algorithms like FFT. Beware!
 

Offline f5r5e5d

  • Frequent Contributor
  • **
  • Posts: 323
Re: EEVacademy #6 - PID Controllers Explained
« Reply #26 on: September 06, 2017, 08:48:05 PM »
what engineer in a real company isn't supported by something close to his yearly salary in capital - which should include software tools

Quote
It remains the case that Matlab is mainly in regular use in universities and for non-commercial purposes. I think the cost is far too high for businesses and commercial organizations to make general use of it.

if your company only needs the tool and expertise once a year or less then hire a consultant who has the tool, if you need it more than a few times a year then even US$ 10-20k is a bargan compared to the product dev team time, cost, lost profit from not hitting the market oppourtunity window
 

Offline Kleinstein

  • Super Contributor
  • ***
  • Posts: 3310
  • Country: de
Re: EEVacademy #6 - PID Controllers Explained
« Reply #27 on: September 07, 2017, 03:12:03 AM »
The PID software is pretty simple - so really basic C. So it should not really matter if it will run on an Arduino / ARM cortex M4, PC or maybe even one of the old basic stamps.

You have to implement the reading the sensor and output of the control separate anyway, as the input can be more than just an ADC value (e.g. timing, frequency) and the output can also be DAC / PWM / frequency and others.

On how much explanation one likes depends on personal preferences and also the a-priori knowledge. Some of us are at high-school other have an PhD in engineering or science. So there is no perfect way to fit all.
 

Offline Red Squirrel

  • Super Contributor
  • ***
  • Posts: 1285
  • Country: ca
Re: EEVacademy #6 - PID Controllers Explained
« Reply #28 on: September 12, 2017, 01:29:41 PM »
I know the oven is just an example, but this theory is more for really fast stuff like a SMPS right? Since for a slower control type situation like an oven you'd just keep checking the sensor value, and then if it goes above or the same (or maybe a bit above if you want to account for thermal mass etc), you turn off the relay, then wait till it drops to a predefined temp (a dead zone) then turn the relay back on.  Right? 

At least that's how I did it with my furnace when I built my thermostat system. I also add a minimum run/stop time to prevent short cycling, ex when it's 50 below outside the temp will drop faster but it does not "feel" cold yet in every room.  I plan to redesign that whole system to make it more modular to sense/control various things via plug in cards, so I presume this is knowledge that is going to be good to have.
 

Offline IanB

  • Super Contributor
  • ***
  • Posts: 7820
  • Country: us
Re: EEVacademy #6 - PID Controllers Explained
« Reply #29 on: September 12, 2017, 01:41:35 PM »
"Fast" and "slow" is all relative. For example, something which is "fast" when time is measured in minutes can become "slow" if time is measured in seconds. And then the thing which is "fast" in seconds becomes "slow" when measured in milliseconds. So you control your oven temperature with "bang-bang" on/off control, but as time constants get faster you might turn the control element on and off faster and faster, until suddenly you find yourself doing PWM control with variable mark/space ratio  ;D
I'm not an EE--what am I doing here?
 

Offline Brumby

  • Supporter
  • ****
  • Posts: 5339
  • Country: au
Re: EEVacademy #6 - PID Controllers Explained
« Reply #30 on: September 12, 2017, 06:12:41 PM »
"Fast" and "slow" is all relative.

Very much so.
 

Offline Kleinstein

  • Super Contributor
  • ***
  • Posts: 3310
  • Country: de
Re: EEVacademy #6 - PID Controllers Explained
« Reply #31 on: September 12, 2017, 10:28:24 PM »
There is no principle difference between fast and slow systems. So one can use the same PID theory and regulator type for both.

The simple on/off regulation method is usually slower than a PID regulator for the same system. It also depends on the system to regulate how good different regulator types work. The Question of using simple on/off or PID does not depend on the speed / time scale of the system to regulate, but on the type of system (e.g. direct reacting, integrating, integrating with extra delays ) and the control element (e.g. continuous or On/off).

With system that allow for an analog control, the PID regulator usually gives better control than the simple on/off scheme. Especially in systems with extra delay, the simple on/off system may not result in a stable control loop.
 

Offline Howardlong

  • Super Contributor
  • ***
  • Posts: 3799
  • Country: gb
Re: EEVacademy #6 - PID Controllers Explained
« Reply #32 on: September 12, 2017, 10:53:31 PM »
what engineer in a real company isn't supported by something close to his yearly salary in capital - which should include software tools

Quote
It remains the case that Matlab is mainly in regular use in universities and for non-commercial purposes. I think the cost is far too high for businesses and commercial organizations to make general use of it.

if your company only needs the tool and expertise once a year or less then hire a consultant who has the tool, if you need it more than a few times a year then even US$ 10-20k is a bargan compared to the product dev team time, cost, lost profit from not hitting the market oppourtunity window

Everyone has a price, and that depends on the perceived value.

It depends what you call a "real company". It might be your opinion that support cost should equate to salary, and while that might be your experience, it doesn't make it true for all. But as an example, my own "support" R&D budget is several times my salary, and I still don't consider Matlab to be valuable enough to purchase.

For example, I've had an MSDN sub that my company has funded for many years, and the use and value I get out of that far outweighs the cost of Matlab. The same applies to the numerous other bits of software, in either capital or recurring expense, particularly development toolchains, from which I get daily use. You can add to that my hardware budget which is several times my software budget.

My need for Matlab/Octave is occasional and sporadic, perhaps two or three times a year, but it tends to be a couple of days of intensive use, unlike the development tools or MSDN, I have no need to use it day to day. At one point about 15 years ago I did have a one year Matlab licence as part of TI's DSP toolchain. There were a couple of Matlab tools I used fairly frequently to do with filter design that Octave didn't have, but other than that Octave could do everything else I needed. I simply could not justify the horrendous cost of Matlab for the value it provided, and since then there are many other options that provide the functionality I was using from Matlab without an outrageous price.

At what price point would I consider Matlab worthwhile? Perhaps $300/year tops to me. I see their website gives me an individual price of $5,000 with the toolboxes I'd be interested in, double what I pay for my annual MSDN licence, so thanks, but no thanks!
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 12572
  • Country: nl
    • NCT Developments
Re: EEVacademy #6 - PID Controllers Explained
« Reply #33 on: September 13, 2017, 12:04:18 AM »
Quote
Not that much: "For personal use only. Not for government, academic, research, commercial, or other organizational use."

It remains the case that Matlab is mainly in regular use in universities and for non-commercial purposes. I think the cost is far to high for businesses and commercial organizations to make general use of it.

Ok, Octave is free and is almost compatible with matlab, which ever one you choose is OK, and please use Cortex M and the DSP math lib for them, they are free too :)
I agree. GNU Octave can do a lot which Matlab can do too. I've used GNU Octave for a project to check some control loops and it has served me well.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf