PID Controller Design for Ventilator (2023 Update)

Sorry, you aren't making yourself at all clear. I'm pretty sure this is because you know so little about how the machines work that you don't understand what is going on.

The machine runs the course of ventilation the operator programs. It does this with all manner of automatic monitoring of the various parameters and results.

The operator is summoned by an alarm if anything is going wrong.

So is there something that you take exception to? If so, can you explain it clearly?

What is your point??? I think again you are showing your ignorance of what this machine does.

Ok, glad you are a supporter.

--

  Rick C. 

  +- Get 1,000 miles of free Supercharging 
  +- Tesla referral code - https://ts.la/richard11209
Reply to
Ricketty C
Loading thread data ...

ing being controlled, how can you design the controller other than trial an d error?

that presses on a bag producing an air flow with the loop controlled by a p ressure measurement.

frequency. Presently they are using 3.6 kHz with 8 bit PWM control. I kinda wonder if a sigma-delta might be better, but that might require some exter nal logic. They seem to be shy of pushing the CPU too much even after chang ing from an Arduino CPU at 20 MHz to an ARM CM4F at 80 MHz.

xhale and inhale. In general, would it be better to simply jump the pressur e set point at once and let the PID controller do its thing, optimizing the response time as best as possible controlling overshoot -or- would it be b etter to run up the pressure set point over a period of time which would se em to place less demand on the PID controller?

is as a capacitor) in parallel with a dissipative element (a dashpot or res istor in electronics). The motor is highly geared to a relatively lightweig ht arm pushing on a bag with air passing through a tube of relatively low r estriction. So initially the dominate opposition to flow will be the dissip ation/resistor, i.e. proportional to the rate of airflow. This in turn is p roportional to the arm speed (although not constant through the stroke due to the bag geometry). The arm speed is what is controlled by the PWM (appro ximately).

re that's appropriate. The response to air entering the lung will be the su m of the airway resistance (dashpot) and the lung compliance (spring) which would be a series combination to obtain the resulting air pressure. Well, maybe that is right for the mechanical model, but in the electrical equival ent if pressure is the same as voltage it would be a series arrangement.

ven by a P only controller, is there any way it could ring? I was shown dat a measured that showed huge ringing from an initial step function in the se t point.

flow regulated cycles. I expect to see similar results with either method.

e of air delivered is regulated mechanically by the angular motion of a cam ):

The volume of air is not what is controlled by the PID.

--

  Rick C. 

  --+ Get 1,000 miles of free Supercharging 
  --+ Tesla referral code - https://ts.la/richard11209
Reply to
Ricketty C

n

ltje:

ed Ricketty C

ine triggered

raw air in

th no registration

across

better

er.

n the blood.

in your lungs

thout you

ventilator hacked together by amateurs, no matter how well-meaning they are

ign through a certification process and into manufacturing. So that will be covered. When we hit certain bumps in the road the solution is to not worr y about it since the company taking it over will be redoing that anyway. Th is is not a rational to take technical shortcuts, more procedural things. S o the documentation will be sparse I expect.

proper requirements analysis. This means many aspects of the design are not planned out properly and various sections have been redesigned several tim es and may be again in the future as we find bends in the road.

monitor since the one in the motor controller has very poor accuracy. Ther e is a nominal current ratio, but at lower currents the tolerance is worse

er sparse'?

ance case that will be made to the FDA (or whoever). Ultimately, the FDA c ertifies the as-built system and will need to see proper design docs and * rational* that when reasoned about, can make the argument that the system will behave as required and is safe.

f the PID control law is something else. Understanding the system dynamics and developing is control loop goes beyond understanding a PID controller.

oping control systems. From the number of posts and your 'wondering' of wh at the control variable is, it sounds like one need to make a model of the system in order to better understand the components and linkages and devel op a realistic transfer function. I am quite surprised that the system is characterized as a simple first order system.

nction is first order. Closed loop control rotational speed/voltage is alwa ys a second order system - in fact, it is the quintessential example in any first control theory course. And there is a 'simplifying assumption' - if one assumes the time constant of the electrical circuit is much smaller than the time constant of the load dynamics, the transfer funct ion may be reduced to a first order transfer function. Not clear that th is simplifying assumption is applicable in this case.

ency test and measure the response. Create a simulink model. Understand w here the poles and zeros of the system are and determine the natural frequ ency of the system.

an effective control approach...there is usually more to it than throwing a PID controller at the system.

n compensate for that (hardware and digitally) You should also consider do ing stability analysis to see if your controlled introduced an oscillation.

uation about your skills or experience - just a lesson learned from spendin g lots of time in the control and certification domain (both FDA and Mil) ) .

I would love to do something more rigorous, but I can't even get them to do a proper requirements analysis. "We don't have time." So instead we have a hardware "check list".

Yeah, I know. I think I've already said I will stick around to get see tha t a design review is done on the next board rev, then I am out.

I did design a high side current sensor today. The motor controller has a current sensor circuit but at lower current the tolerance is terrible ? ?33%. The high side sensor should be within 5% even using 1% resistors t hroughout. I used a very small sense resistor to minimize voltage drop and the first amp stage drops that to a third, so a second amp is used to get to a 3V range. The amount of signal conditioning circuitry is adding up. We are also out of I/Os on the MCU. They are talking about needing to add LEDs for alarms, but no indication of how many or what color... oh, there a re requirements for flash rate to indicate severity along with the color. I can get one I/O back from the interface to the battery charge chip and ma ybe another elsewhere. Two I/Os and an I2C chip will get you a lot more I/ Os as long as you don't require them to set interrupts.

--

  Rick C. 

  -+- Get 1,000 miles of free Supercharging 
  -+- Tesla referral code - https://ts.la/richard11209
Reply to
Ricketty C

And what guidelines are they using to decide these issues? Having a multicolored flashing christmas tree isn't going to help a provider decide "what's going wrong".

[And a good fraction of the population suffers from one or more forms of color-blindness. And, not all colors are readily discernible in different lighting conditions.]

I went through this exercise, recently, with the design of a large "discrete indicator panel" (if you need a cheat-sheet to understand what's trying to be conveyed, then you're failing at that goal!).

Reply to
Don Y

The simple hydro-mechanical ventilator + lung system is an oscillator, is it not?

It's fed with energy from the compressed air supply, and it chunk-chunk-chunks in and out like a steam engine.

So in even the simplest case I think the overall system of lungs + vent has to be at least second order. Sure it can oscillate, that's what it's supposed to do when the system is operating normally.

Reply to
bitrex

You literally know nothing about this. You ask a question, but it's not genuine. You just want to hear something you can maybe trash the project over. So why should anyone bother with you?

This is a case where you are not part of the solution, you are part of the problem.

Sorry, you need to talk to the people who set the standards for traffic lights, and medical ventilators, not me.

I'm sure you are very accustomed to failing. Thanks anyway.

--

  Rick C. 

  -++ Get 1,000 miles of free Supercharging 
  -++ Tesla referral code - https://ts.la/richard11209
Reply to
Ricketty C

(sigh) AGAIN you assume that I have no first-hand knowledge of the issue.

From here, it seems like your ignorance IS the problem!

Good luck on your upcoming failure!

Clown.

Reply to
Don Y

thing being controlled, how can you design the controller other than trial and error?

m that presses on a bag producing an air flow with the loop controlled by a pressure measurement.

. frequency. Presently they are using 3.6 kHz with 8 bit PWM control. I kin da wonder if a sigma-delta might be better, but that might require some ext ernal logic. They seem to be shy of pushing the CPU too much even after cha nging from an Arduino CPU at 20 MHz to an ARM CM4F at 80 MHz.

exhale and inhale. In general, would it be better to simply jump the press ure set point at once and let the PID controller do its thing, optimizing t he response time as best as possible controlling overshoot -or- would it be better to run up the pressure set point over a period of time which would seem to place less demand on the PID controller?

this as a capacitor) in parallel with a dissipative element (a dashpot or r esistor in electronics). The motor is highly geared to a relatively lightwe ight arm pushing on a bag with air passing through a tube of relatively low restriction. So initially the dominate opposition to flow will be the diss ipation/resistor, i.e. proportional to the rate of airflow. This in turn is proportional to the arm speed (although not constant through the stroke du e to the bag geometry). The arm speed is what is controlled by the PWM (app roximately).

sure that's appropriate. The response to air entering the lung will be the sum of the airway resistance (dashpot) and the lung compliance (spring) whi ch would be a series combination to obtain the resulting air pressure. Well , maybe that is right for the mechanical model, but in the electrical equiv alent if pressure is the same as voltage it would be a series arrangement.

riven by a P only controller, is there any way it could ring? I was shown d ata measured that showed huge ringing from an initial step function in the set point.

nd flow regulated cycles. I expect to see similar results with either metho d.

ume of air delivered is regulated mechanically by the angular motion of a c am):

Pressure is a dependent variable, not the controlled variable.

Reply to
Flyguy

Here is a summary of the different modes:

"a more modern approach describes ventilatory modes based on three characteristics ? the trigger (flow versus pressure), the limit (what determines the size of the breath), and the cycle (what actually ends the breath)."

Reply to
bitrex

e thing being controlled, how can you design the controller other than tria l and error?

arm that presses on a bag producing an air flow with the loop controlled by a pressure measurement.

vs. frequency. Presently they are using 3.6 kHz with 8 bit PWM control. I k inda wonder if a sigma-delta might be better, but that might require some e xternal logic. They seem to be shy of pushing the CPU too much even after c hanging from an Arduino CPU at 20 MHz to an ARM CM4F at 80 MHz.

en exhale and inhale. In general, would it be better to simply jump the pre ssure set point at once and let the PID controller do its thing, optimizing the response time as best as possible controlling overshoot -or- would it be better to run up the pressure set point over a period of time which woul d seem to place less demand on the PID controller?

f this as a capacitor) in parallel with a dissipative element (a dashpot or resistor in electronics). The motor is highly geared to a relatively light weight arm pushing on a bag with air passing through a tube of relatively l ow restriction. So initially the dominate opposition to flow will be the di ssipation/resistor, i.e. proportional to the rate of airflow. This in turn is proportional to the arm speed (although not constant through the stroke due to the bag geometry). The arm speed is what is controlled by the PWM (a pproximately).

t sure that's appropriate. The response to air entering the lung will be th e sum of the airway resistance (dashpot) and the lung compliance (spring) w hich would be a series combination to obtain the resulting air pressure. We ll, maybe that is right for the mechanical model, but in the electrical equ ivalent if pressure is the same as voltage it would be a series arrangement .

driven by a P only controller, is there any way it could ring? I was shown data measured that showed huge ringing from an initial step function in th e set point.

and flow regulated cycles. I expect to see similar results with either met hod.

olume of air delivered is regulated mechanically by the angular motion of a cam):

There are many good presentations on this topic available on the Internet. Try checking some out. It will be very educational.

--

  Rick C. 

  +-+ Get 1,000 miles of free Supercharging 
  +-+ Tesla referral code - https://ts.la/richard11209
Reply to
Ricketty C

tje:

Ricketty C

e triggered

w air in

no registration

cross

tter

.

the blood.

n your lungs

hout you

ventilator hacked together by amateurs, no matter how well-meaning they are

sign through a certification process and into manufacturing. So that will b e covered. When we hit certain bumps in the road the solution is to not wor ry about it since the company taking it over will be redoing that anyway. T his is not a rational to take technical shortcuts, more procedural things. So the documentation will be sparse I expect.

proper requirements analysis. This means many aspects of the design are no t planned out properly and various sections have been redesigned several ti mes and may be again in the future as we find bends in the road.

t monitor since the one in the motor controller has very poor accuracy. The re is a nominal current ratio, but at lower currents the tolerance is worse

ther sparse'?

urance case that will be made to the FDA (or whoever). Ultimately, the FDA certifies the as-built system and will need to see proper design docs and *rational* that when reasoned about, can make the argument that the syste m will behave as required and is safe.

of the PID control law is something else. Understanding the system dynami cs and developing is control loop goes beyond understanding a PID controlle r.

eloping control systems. From the number of posts and your 'wondering' of what the control variable is, it sounds like one need to make a model of t he system in order to better understand the components and linkages and dev elop a realistic transfer function. I am quite surprised that the system i s characterized as a simple first order system.

function is first order. Closed loop control rotational speed/voltage is al ways a second order system - in fact, it is the quintessential example in a ny first control theory course. And there is a 'simplifying assumption' - if one assumes the time constant of the electrical circuit is much smaller than the time constant of the load dynamics, the transfer fun ction may be reduced to a first order transfer function. Not clear that this simplifying assumption is applicable in this case.

quency test and measure the response. Create a simulink model. Understand where the poles and zeros of the system are and determine the natural fre quency of the system.

t an effective control approach...there is usually more to it than throwing a PID controller at the system.

ign compensate for that (hardware and digitally) You should also consider doing stability analysis to see if your controlled introduced an oscillatio n.

inuation about your skills or experience - just a lesson learned from spend ing lots of time in the control and certification domain (both FDA and Mil) ).

Sure, it will oscillate if you control it with an oscillator.

It is not supposed to oscillate when you try to ramp up the rising edge of the pressure. You talk about second order but you don't seem to actually u nderstand it, you just sort of wave hands over it.

The spring and dashpot of the lung is the same as my car's suspension. Tha t is not going to oscillate. The motor, arm and bag are actually a pretty simple system of move the motor arm and air moves out of the bag under pres sure. The action of the motor inflating the lung is slow enough that with an adequately quick control loop there will be no overshoot, no ringing, no nothing. The control loop will runs tens of times faster than the edge ra te of the pressure or flow rate, so the control loop will only be driven at frequencies much lower than it can deal with.

Whatever. I won't likely get a chance to work on the software. I will let them figure it out. It's not rocket science.

--

  Rick C. 

  +-- Get 1,000 miles of free Supercharging 
  +-- Tesla referral code - https://ts.la/richard11209
Reply to
Ricketty C

On a sunny day (Sun, 16 Aug 2020 11:03:24 -0700) it happened snipped-for-privacy@highlandsniptechnology.com wrote in :

From the last testament in the twentieth century when the Evil Ruler Donald Trump came to power God send the corona virus to punish the people

Reply to
Jan Panteltje

ketty C

iggered

r in

registration

s
r

blood.

r lungs

you

Do you know any good control 'theory/practice' books. I've got a few, but I tend to get a little lost in the Laplace transforms, And would love something with a more 'hands on' feel, an AoE type of book.

Tim Wescott's book is fine.

formatting link

George H.

Reply to
George Herold

sen

teltje:

ened Ricketty C

chine triggered

draw air in

with no registration

ts across

h better

neer.

in the blood.

2 in your lungs

without you

o

a ventilator hacked together by amateurs, no matter how well-meaning they a re

esign through a certification process and into manufacturing. So that will be covered. When we hit certain bumps in the road the solution is to not wo rry about it since the company taking it over will be redoing that anyway. This is not a rational to take technical shortcuts, more procedural things. So the documentation will be sparse I expect.

a proper requirements analysis. This means many aspects of the design are n ot planned out properly and various sections have been redesigned several t imes and may be again in the future as we find bends in the road.

nt monitor since the one in the motor controller has very poor accuracy. Th ere is a nominal current ratio, but at lower currents the tolerance is wors

ther sparse'?

urance case that will be made to the FDA (or whoever). Ultimately, the FDA certifies the as-built system and will need to see proper design docs and * rational* that when reasoned about, can make the argument that the system w ill behave as required and is safe.

of the PID control law is something else. Understanding the system dynamics and developing is control loop goes beyond understanding a PID controller.

loping control systems. From the number of posts and your 'wondering' of wh at the control variable is, it sounds like one need to make a model of the system in order to better understand the components and linkages and develo p a realistic transfer function. I am quite surprised that the system is ch aracterized as a simple first order system.

function is first order. Closed loop control rotational speed/voltage is al ways a second order system - in fact, it is the quintessential example in a ny first control theory course. And there is a 'simplifying assumption' - i f one assumes the time constant of the electrical circuit is much smaller t han the time constant of the load dynamics, the transfer function may be re duced to a first order transfer function. Not clear that this simplifying a ssumption is applicable in this case.

quency test and measure the response. Create a simulink model. Understand w here the poles and zeros of the system are and determine the natural freque ncy of the system.

t an effective control approach...there is usually more to it than throwing a PID controller at the system.

gn compensate for that (hardware and digitally) You should also consider do ing stability analysis to see if your controlled introduced an oscillation.

inuation about your skills or experience - just a lesson learned from spend ing lots of time in the control and certification domain (both FDA and Mil) ).

do a proper requirements analysis. "We don't have time." So instead we have a hardware "check list".

at a design review is done on the next board rev, then I am out.

current sensor circuit but at lower current the tolerance is terrible ? ?33%. The high side sensor should be within 5% even using 1% resistors th roughout. I used a very small sense resistor to minimize voltage drop and t he first amp stage drops that to a third, so a second amp is used to get to a 3V range. The amount of signal conditioning circuitry is adding up. We a re also out of I/Os on the MCU. They are talking about needing to add LEDs for alarms, but no indication of how many or what color... oh, there are re quirements for flash rate to indicate severity along with the color. I can get one I/O back from the interface to the battery charge chip and maybe an other elsewhere. Two I/Os and an I2C chip will get you a lot more I/Os as l ong as you don't require them to set interrupts.

No time for analysis? Requirement issues are always around. Requirements creep can be deadly. How they manage that process is direct indication of how the project will turn out. Building a model of the system is an ideal w ay of determine where the requirements are missing/ambiguous/wrong. You can pay me now or pay me later...unfortunately 'later' may be when a pe rson dies. Sounds like a bunch of clowns running (mangling) the project...( let me guess...'just give it to the engineers, they will figure it out' and the famous 'there is always a hero that pulls it out') One can't fix stupid....run away...fast. J

Reply to
Three Jeeps

They should test it on themselves.

--

John Larkin         Highland Technology, Inc 

Science teaches us to doubt. 

  Claude Bernard
Reply to
jlarkin

Nice idea; I've tried it and it isn't a good test.

Basically while I could play at being "almost recovered", I was no good at pretending to be "dead".

Reply to
Tom Gardner

Would you enjoy this fine series from MIT on ordinary differential equations including Laplace transforms:

The whole lecture series is good. the Laplace transform (and other integral transforms too) are, in general, tools for solving differential equations. So a refresh on ODEs may be helpful

Reply to
bitrex

Or the short-short version: power series coefficients are vectors in a vector space. Under some constraints, continuous functions are also vectors. The Laplace transform is a change of basis in a vector space of continuous functions, a basis where differential and integral operators become algebraic operators, and convolution becomes multiplication.

Reply to
bitrex

To a basis where..should say

Reply to
bitrex

:

icketty C

triggered

air in

o registration

oss

er

e blood.

our lungs

t you

Back in the day when I did design and teaching of this stuff, I used books by Brogan, Kou, Ogata, Diazzo & Haupis and Astrom. All are fairly theoreti cal, but Astroms book "Computer Controlled System: Theory and Design - 3rd edition was one that rolled in the use of Matlab & Simulink, as well as a c hapter on 'implementation details' . There may be more applications orient ed "how to' books around as of late, I just don't know about them. The Wes tcott book seems to be a valuable collection of 'things I learned when impl ementing control systems' Anyone who lived in the trenches can identify wi th having learned those lessons.

Actually, some of the detailed example problems in Matlab & Simulink are qu ite good, and they have a example on how to use their code generator which is helpful. Getting it set up for your target machine can be a little tric ky. Good luck J

Reply to
Three Jeeps

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.