3
$\begingroup$

enter image description here Above illustration is the basic setup for the question. The scenario will be the following:

A potentiometer(providing 0 to 5V) is an analog input to A0. This potentiometer voltage is converted to PWM(pin9) which controls a fan M1. Which means the human controls directly the M1 fan speed.

This directly speed-controlled M1 fan creates air pressure on a sensor Sen1.

On the other hand I want M2 fan to reach to a speed(via pin10 PWM) such that Sen2 should output the same voltage as Sen1. Which means eventually voltage at A1 analog input should be equal to A2. So one can achieve same air pressures at Sen1 and Sen2.

I'm not experienced in PID or other type of controls. I would be glad if someone can help me to relate parameters and code this scenario. I was suggested to ask here instead of Arduino stack-exchange.

edit: Do you think I can use the following idea. If I make changes as following: PWM to LED in that example will be PWM to M2 in mycase; poti input in the example will be Sen1 input in mycase. And LDR input in the example will be Sen2 input in mycase. Do you think it is worth to try?

$\endgroup$
  • $\begingroup$ Are those sensors independent? Can the air streams of M1 and M2 only reach their respective sensors or both of them? $\endgroup$ – Bending Unit 22 Sep 14 '16 at 8:27
  • $\begingroup$ They are not that far away.The flow of M1 might affect M2's flow a bit. I want the output voltage of sensor 2 to follow sensor 1's. $\endgroup$ – user16307 Sep 14 '16 at 8:35
  • $\begingroup$ Do you think I can use the following idea: johnwilliamrussell.wordpress.com/2014/09/21/… If I make changes as following: PWM to LED in that example will be PWM to M2 in mycase; poti input in the example will be Sen1 input in mycase. And LDR input in the example will be Sen2 input in mycase. Do you think it is worth to try? $\endgroup$ – user16307 Sep 14 '16 at 8:42
  • $\begingroup$ Please edit your question and include the information you obtained from your additional research. $\endgroup$ – Bending Unit 22 Sep 14 '16 at 8:49
  • $\begingroup$ just edited the question $\endgroup$ – user16307 Sep 14 '16 at 8:55
1
$\begingroup$

I'm not sure I understand why you're taking such a long "around the block to cross the street" approach to this problem. Your basic steps are:

1. [The human controls directly the] potentiometer voltage [which] is converted to PWM... which controls a fan M1.

2. This directly speed-controlled M1 fan creates air pressure on a sensor Sen1.

3. [The] M2 fan [should] reach to a speed(via pin10 PWM) such that Sen2 should output the same voltage as Sen1.

4. Which means eventually voltage at A1 analog input should be equal to A2.

5. So one can achieve same air pressures at Sen1 and Sen2.

If, per step 4 above, you think the analog input voltages should be the same, then why not just feed the human-reference input provided at step 1 to both fans?

Another way to think critically about this problem is to recognize that I, personally, have no idea what voltage is required to get a fan to achieve a particular air pressure. That is, maybe you as the designer should choose some maximum allowable air pressure (perhaps dictated by the capacity of the fan), and then have the human's reference be interpreted as a desired air pressure instead of a desired fan voltage.

Then, the desired air pressure is the reference, the actual air pressure is the feedback, and you use the error between the two to create your PID loop.

This is basically what you're talking about for fan two, where you have fan two setup in a "follower" mode.

The problem I would see with the approach you've requested is in your statement in the comments:

The flow of M1 might affect M2's flow a bit.

I'm assuming that this implies that M2's flow might also affect M1's. So imagine this:

  1. M1 is running at 50%.
  2. M2 is not running.
  3. M2 gets M1's 50% flow as a reference.
  4. M2 spins up, but a portion of its flow is sensed by M1's sensor, Sen1.
  5. M1's flow sensor now reads 50% + X%.
  6. M2 gets M1's 50% + X% flow as a reference.
  7. M2 spins a little faster, but a portion of its flow is sensed by M1's sensor, Sen1.
  8. Repeat 5-7 until M2 is spinning at full speed or the system naturally stabilizes at some value higher than probably intended.

If you have both PID loops (for M1 and M2) tuned to the same response time, then there is a high probability that they'll wind up "fighting" each other - both fans spin up at the same time, overshoot, trigger each other to slow down, and you may find that neither fan ever settles at the desired setpoint.

The two approaches I would take to inhibit this kind of behavior would be to intentionally tune one loop slower than the other. The slower system acts as a "base load" supplier, the faster loop responds to disturbances. This also assumes there's some moderate cross-flow between the two systems.

The other way you could try to do this is to have one control loop, where the output signal is sent to both fans (instead of being tailored on a per-fan basis) and maybe the output signal (Sen1 and Sen2) is averaged to produce one feedback.

I'm not sure what the application here is so I can't provide any meaningful advice beyond what I've posted above. You could consider ducting or physically relocating the fans to prevent cross-flow between M1 and M2.

I'll say that steps 4 and 5 above are generally conflicting - due to variations in motor and sensor construction, impedances, etc., you will probably find that voltages A1 and A2 are not equal when the outputs of Sen1 and Sen2 are equal, and vice-versa.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.