Page 1 of 3

Programmatic control of Stirling Engines

Posted: Wed May 05, 2021 2:28 am
by Tom Booth
Nothing too exciting here yet.

I'm beginning to learn basic electronics and programming with the goal of applying what I learn to improve Stirling engine performance.

This is some of my progress with lesson #4 of my Elegoo starter kit on How to change the colors of an LED.

https://youtu.be/uNnAMODvG_8

Similar electronics programming could be used to control the timing of a Stirling engine. That is, control the rate and frequency of heat delivery to the engine by controlling displacer motion.

This could be accomplished with a servo or possibly a stepper motor, but those are later lessons soon to follow included in the kit.

Likely some kind of sensor will also be needed to synchronize displacer motion with the piston.

This really started in the LTD magnetic vs gamma discussion, but doesn't really have much of anything to do with magnets specifically, or the type of engine, Gamma, or otherwise, so I thought a separate topic would be more appropriate.

Re: Programmatic control of Stirling Engines

Posted: Wed May 05, 2021 10:49 pm
by Tom Booth
Day 2,

Got the little servo hooked up and programmed.

https://youtu.be/PMqtfqtXpRM

The program used was just a simple modification of the one provided as an example with the electronics kit. The example program was actually too complicated, running the servo through a number of unnecessary maneuvers not needed for this simple project. I just had to take out several lines of code and change the sweep angle to about 45 degrees.

"Dwell" or the displacer's resting period at the top and bottom of the sweep is easily controlled as shown in the video, by just changing a couple numbers and re-uploading the program to the Arduino controller board.

Obviously this is not yet a working, functional engine. It is just some parts of a transparent, solar, Stirling engine kit, not yet assembled and with no heat applied, but I just wanted to hot glue something together for now to test out the little servo to see if it can do the job of lifting the displacer.

My impression is that this little plastic servo would not hold out for very long under continual use. It is also rather slow. (and noisy) With only a short distance to travel (45 degrees) I found that it cannot complete the distance if the "wait" time between commands is less than about 200 milliseconds. Typically the RPM of a little LTD engine would be slow enough that this servo could keep up, but if not, I may need to get one that is more responsive.

All in all though I'm pretty happy. I think it will be able to do what I have in mind.

I'll also need to rig up some form of sensor, I think, in order to keep the displacer/regenerator movement synchronized with the piston. Still a long way to go.

I would like to have the displacer motion triggered by the piston/flywheel passing some specified angle before TDC and/or before BDC. but have yet to decide what kind of sensor to use, and I don't know exactly how I'm going to program that yet.

Re: Programmatic control of Stirling Engines

Posted: Thu May 06, 2021 6:54 am
by Tom Booth
I have an idea that some such setup as this (above) may actually be nearly all that's needed, other than a linear generator, or variable load of some kind. Even just some applied friction, like drag against a flywheel, if there is one, but probably better, a resistive load.

In other words; if the engine can be got going with the servo, the piston, more or less is forced to follow the expansion and contraction of the gas induced, to an extent at least.

The piston may have a tendency to race ahead, because excess heat is applied, or lag behind, with not enough heat.

The piston and.displacer could be brought into sink by varying the heat input, and/or the servo timing (dwell or "wait" time).

But then also, with a variable load, the speed of the piston can be further fine tuned to match the speed of the servo/displacer, by speeding up or slowing down the engine by increasing or decreasing the load.

It may take some playing around with, but at this point the goal is just to have an engine running by whatever means while having the displacer motion under the control of the servo-program.

For all I know, a "free piston" type engine may simply fall into a synchronized pattern of motion all on its own, or at least without too much coaxing or heavy handed control.

Think of it as the servo being the person pushing someone else on a swing. The person on the swing (the piston) is mostly a passive recipient or "dead weight".

It is up to the person pushing the swing to time their efforts in such a way as to be synchronized with the natural rhythm of the swing, which is a result of all kinds of variables, like the weight of the person being pushed, the length of the chains holding up the swing, wind direction, gravitational pull etc.

It is mainly up to the person pushing the swing to synchronize their own motion or power input with the combined result of all of the other factors outside of the operators control.

It is not really necessary that the operator, or person pushing the swing, in this case the servo-motor, be perfectly synchronized.

Being a little clumsy, pushing a little early or late, or too hard or to slow, is not necessarily fatal. It is not necessary to be right on the mark every time.

I might, the servo might, that is, even "walk away" so to speak, for a while and let the person on the swing, swing by themselves for some time, if there is enough stored up momentum.

There is also, or should be, a cushioning effect produced due to the delay, or indirect way that the servo is applying heat.

That is, in other words; the servo moves the displacer, which allows the air in the chamber some exposure to heat, which heat, takes some time to transfer from the bottom plate, or wherever, depending on the engine type and design, to the air, which gradually expands, then produces a gradual increase in pressure, which then begins at some point, to have an impact on the piston.

Of course, though, to be able to actually "see" or "feel" or sense when the swing is in the best position to receive another push, would be ideal, a sensor may not be absolutely necessary as long as the servo is acting somewhere in the ballpark.

The person, or weight or object on the swing, could, simply be pushed by a rather "dumb" mechanical arm, so long as its movements were timed properly.

It seems worth a try anyway. This little servo does seem rather clumsy though.

But maybe operating "blind" is close enough:

https://youtu.be/b4_pT3GkRZU

Re: Programmatic control of Stirling Engines

Posted: Thu May 06, 2021 8:39 am
by Tom Booth
Once loaded with instructions, the controller can operate independent of the laptop, powered by only a 9volt battery.

https://youtu.be/MiX8Pttid6o

Unless, of course, the program needs to be modified, then I guess it would need to be reconnected.

It is apparently POSSIBLE to do this wirelessly over WiFi, but an additional add-on WiFi board would have to be connected.

The connecting rod I'm using for this is the one supplied with the Stirling engine kit. It is actually quite bulky, with a stainless steel rod and even small ball bearings, and unnecessarily heavy IMO. Probably it could be replaced with a very fine wire to advantage.

The displacer material is also possibly heavier than it could be, though my plan is to add some steel wool to serve as regenerator, which will add some weight.

I'm concerned that the displacer, at this point is a rather heavy weight for this tiny little servo. I don't want to burn it out.

Re: Programmatic control of Stirling Engines

Posted: Thu May 06, 2021 9:49 am
by Tom Booth
My reason for wanting to do all this is based on the theory that heat is NOT a substance or material fluid.

As such, being only the kinetic energy of the air molecules striking the piston, according to Tesla, and even according to Carnot himself as written in his journals in late life, (only recently published), there should be no need for a "sink".

A batter at the plate in baseball does not need to "sink" the impact or worry about somehow removing it in order to hit a home run. Nobody would ever imagine the likes of such a thing, that the impact of a baseball bat on a ball requires some sort of "sink" or material outlet somewhere for the substance imparted to drain off.

Someone pushing a swing does not have to race around to the other side and somehow let out the force that was imparted, but this idea that heat MUST flow THROUGH a heat engine and out the other side to the "sink" is so ingrained nobody questions it, or imagines that reality could possibly be any other way.

IMO, if a "sink" is not a necessity, as Tesla pointed out 100 years ago, then the heat input can be limited and intermittent. The displacer/regenerator only needs to supply a small impulse of heat/expansion at the begining of the cycle when the piston is near TDC (top dead center). Then the kinetic energy of the fast moving air molecules is transfered to the piston. The energy supplied travels out to the load. There is, or may be no real necessity to worry about removing excess heat, if no excess is supplied in the first place.

Someone pushing a swing does not have to worry about removing the excess energy. They just don't push too hard in the first place.

A "push" is not an actual material thing that somehow propels a swing forward requiring removal when the job is done. It is just an intermittent impulse supplied to make up for loses, friction, wind resistance etc. that otherwise slows things down.

Having a displacer jog up and down throughout the cycle so that it pushes heat across the engine to the sink is quite possibly detrimental. It is a waste of energy, and very likely in my opinion, completely unnecessary.

This is, and remains at this time, however, just a theory.

This method of using a servo-motor to move the displacer seems like one way of putting the theory to the test.

There are other ways, like using a cam, but getting the cam just right could involve a lot of trial and error. It may be easier to just change a few numbers in a program than to machine a new cam each time.

It seems quite easy to me at the moment anyway.

There are a lot of additional videos on "The blind juggler" site of the robot bouncing various types of balls, at various rates, and to various heights, and at different speeds, all without any sensors and with some erratic behavior from the balls at times, all of which suggests to me that additional sensors for this project may not be necessary.

https://www.blindjuggler.org/videos/

What seems important is a steady rhythm and apparently, even that is not all that critical.

Change the rhythm of the impacts and the response of the ball adjusts accordingly.

Theoretically, the displacer movement controls the heat input of the Stirling engine, to which the piston responds, so it may be that no additional controls will be required.

Re: Programmatic control of Stirling Engines

Posted: Thu Jul 29, 2021 2:17 pm
by M13Calvin
An interesting read related to your programmatic control of the Stirling engine: https://ntrs.nasa.gov/api/citations/201 ... 014881.pdf

As far as the heat sink goes, it is impossible to use all of the heat energy input to drive mechanical work output. This is the basis of the Carnot efficiency and stems from the 2nd law of thermodynamics. In fact, if you were to truly thermodynamically analyze the baseball player hitting the ball, you would find that entropy (and waste heat) are produced in muscle fibers, viscous flow of the air, elastic deformation of the bat and ball, etc etc.

"Dumping waste heat" into a heat sink is required to bring the expanded fluid back to its original temperature and pressure after it does work.
Let's go through an example.

Heating:
You have 1L of air at 273K and 1 atm. Now you place it in contact with a heat source at say 573K and allow it to come up to temperature at constant volume. PV=nRT in a closed system says we have n = (101325*0.001)/(8.314*273) = 0.0446 mol of air. Once heated to 573K at constant volume, the pressure is raised to P = nRT/V = (0.0446*8.314*573)/(0.001) = 212671 Pa or 2.126 bar. The heat capacity of air is 0.718kJ/kg*K so we added Q = (0.718kJ/kg*K)*(0.02897kg/mol)*(0.0446mol)*(300K) = 278.3 J (heat input)

Expansion:
Now we allow the gas to expand isothermally (best case scenario, efficiency-wise). On an isotherm, PV = constant, so (P1*V1) = (P2*V2). Let's allow our air to expand back to a pressure of 1 atm or 101325 Pa. In this case V2 = P1*V1/P2 = (212671*0.001)/(101325) = 0.002099 m^3 or 2099 cc. If we integrate underneath the isotherm on the PV diagram, we can calculate the work output: W = nRT*ln(V2/V1) = (0.0446)*(8.314)*(573)*ln(0.002099/0.001) = 157.5 J (work output). We also added some heat in this stage which I did not calculate here.

Cooling/compression:
Now, to get our initial condition back (which we need to do to maintain a closed cycle), we need to get this 2099 cc of gas at 1 atm back down to 1000 cc at 1 atm. The only way to do that (the only free variable) is to change the temperature! So we remove the heat source, and put the air back in contact with a heat sink at 273K. Once the temperature equalizes, we can hold constant pressure at 1 atm and the ideal gas law will tell us P = 1atm, T = 273K, and V = 1L, right back where we started. The key here is that without dumping that heat somewhere, the gas would not be able to get back to the original starting condition.

As you see here, we *cannot* get all 278.3 J of heat we put into the gas out as useful work. There is *always* some waste heat. Now, you may ask what happens in the adiabatic case, where we add 278.3 J of heat, and then allow the gas to expand with no heat into or out of the wall of the container. In this case, PV^gamma is constant (http://hyperphysics.phy-astr.gsu.edu/hb ... adiab.html) and the output work is W = 136 J. So in this case too, we can't recover all the input heat as work. The final temperature of the gas here will be lower than 573K

Re: Programmatic control of Stirling Engines

Posted: Thu Aug 05, 2021 10:19 am
by Tom Booth
M13Calvin wrote: Thu Jul 29, 2021 2:17 pm An interesting read related to your programmatic control of the Stirling engine: https://ntrs.nasa.gov/api/citations/201 ... 014881.pdf

As far as the heat sink goes, it is impossible to use all of the heat energy input to drive mechanical work output. This is the basis of the Carnot efficiency and stems from the 2nd law of thermodynamics. In fact, if you were to truly thermodynamically analyze the baseball player hitting the ball, you would find that entropy (and waste heat) are produced in muscle fibers, viscous flow of the air, elastic deformation of the bat and ball, etc etc.

"Dumping waste heat" into a heat sink is required to bring the expanded fluid back to its original temperature and pressure after it does work.
Let's go through an example.

Heating:
You have 1L of air at 273K and 1 atm. Now you place it in contact with a heat source at say 573K and allow it to come up to temperature at constant volume. PV=nRT in a closed system says we have n = (101325*0.001)/(8.314*273) = 0.0446 mol of air. Once heated to 573K at constant volume, the pressure is raised to P = nRT/V = (0.0446*8.314*573)/(0.001) = 212671 Pa or 2.126 bar. The heat capacity of air is 0.718kJ/kg*K so we added Q = (0.718kJ/kg*K)*(0.02897kg/mol)*(0.0446mol)*(300K) = 278.3 J (heat input)

Expansion:
Now we allow the gas to expand isothermally (best case scenario, efficiency-wise). On an isotherm, PV = constant, so (P1*V1) = (P2*V2). Let's allow our air to expand back to a pressure of 1 atm or 101325 Pa. In this case V2 = P1*V1/P2 = (212671*0.001)/(101325) = 0.002099 m^3 or 2099 cc. If we integrate underneath the isotherm on the PV diagram, we can calculate the work output: W = nRT*ln(V2/V1) = (0.0446)*(8.314)*(573)*ln(0.002099/0.001) = 157.5 J (work output). We also added some heat in this stage which I did not calculate here.

Cooling/compression:
Now, to get our initial condition back (which we need to do to maintain a closed cycle), we need to get this 2099 cc of gas at 1 atm back down to 1000 cc at 1 atm. The only way to do that (the only free variable) is to change the temperature! So we remove the heat source, and put the air back in contact with a heat sink at 273K. Once the temperature equalizes, we can hold constant pressure at 1 atm and the ideal gas law will tell us P = 1atm, T = 273K, and V = 1L, right back where we started. The key here is that without dumping that heat somewhere, the gas would not be able to get back to the original starting condition.

As you see here, we *cannot* get all 278.3 J of heat we put into the gas out as useful work. There is *always* some waste heat. Now, you may ask what happens in the adiabatic case, where we add 278.3 J of heat, and then allow the gas to expand with no heat into or out of the wall of the container. In this case, PV^gamma is constant (http://hyperphysics.phy-astr.gsu.edu/hb ... adiab.html) and the output work is W = 136 J. So in this case too, we can't recover all the input heat as work. The final temperature of the gas here will be lower than 573K
How will the engine you are building accomplish all this? I will be very interested in seeing these principles demonstrated once it is completed.

https://www.stirlingengineforum.com/vie ... 465#p16220

Will you be incorporating some of the NASA kinematic non-sinusoidal "free piston" methodologies?

Re: Programmatic control of Stirling Engines

Posted: Thu Sep 16, 2021 7:21 am
by MikeB
I think the point that M13Calvin was trying to make is that if you were _able_ to build an engine that was optimised for adiabatic operation, and was 'perfect' in all other regards, it wouldn't be 100% efficient.
This is unfortunately true for any engine, of any type - there is a theoretical limit to what you can get out of it, as you cannot optimise for all factors simultaneously, and that is before you get into practicalities like friction.

A much easier example to visualise is wind turbines - one might imagine that it is possible to make them close to 100% efficient, but actually the limit is somewhere in the region of 50%. The reason for this is simple and two-fold: to get 100% efficiency, you must extract all of the energy from the air, which means it would stop moving entirely. which wouldn't allow air to flow through the turbine...
Secondly, the more your turbine slows down the wind, the more it will simply flow _around_ the turbine instead of through it.

Re: Programmatic control of Stirling Engines

Posted: Thu Sep 16, 2021 5:48 pm
by Tom Booth
The difference is that water over a water wheel, as Carnot theorized heat to be as some kind of fluid, and wind as another kind of "fluid" in physics terms are both different from heat as a form of pure energy.

Energy can be converted from one form to another. Water and wind are substances.

No substance pases through a heat engine as water passes through a turbine or wind through a wind generator.

As far as I know, there is no force, actual or theoretical, similar to gravity that causes heat to be attracted to cold in the way water falls down to a lower level due to gravity. There is no actual flow of heat through a heat engine.

The Carnot idea of heat as a fluid that flows like a river from a high to a low level or hot to cold and that a heat engine somehow intercepts that flow is to say the least, obsolete.

Re: Programmatic control of Stirling Engines

Posted: Fri Sep 17, 2021 7:23 am
by MikeB
I was once told that "All models are wrong, but some are still useful."

The Carnot idea of heat as a fluid is a useful concept most of the time, but I don't think I've ever seen anyone suggest that it can be 'intercepted'.

Similarly many of these conversations try to cover too much ground, thus obscuring the finer nuances of the various bits of theory.
One specific thing though - heat energy is VERY much like water/gravity - it will never flow uphill of its own volition, unless it is pushed in some way.

Re: Programmatic control of Stirling Engines

Posted: Fri Sep 17, 2021 8:26 am
by skypupbob
I'm not sure what you are saying, but there is air inside the engine and doesn't hot air rise ? Flowing "uphill".

Re: Programmatic control of Stirling Engines

Posted: Fri Sep 17, 2021 1:14 pm
by Tom Booth
MikeB wrote: Fri Sep 17, 2021 7:23 am I was once told that "All models are wrong, but some are still useful."

The Carnot idea of heat as a fluid is a useful concept most of the time, but I don't think I've ever seen anyone suggest that it can be 'intercepted'.
Generally speaking, energy can be extracted from a "flow", wind or a flowing river for example.

Carnot conceived of heat as a similar "flow" of substance or "caloric", considered to be an actual fluid, from a "high" hot level to a "low" cold level. This difference in "height" is all that is taken into consideration for so-called Carnot efficiency, which IMO is ludicrous.

In reality, it seems, in light of modern understanding, heat is more on the order of a vibration. The relative motion of individual molecules. There is no directional "flow" of heat inside a heat engine, any more than the relative random motion of pool balls ricocheting around on a pool table. There is no actual "flow" from the hot to the cold side of the engine, and therefore no "flow" of heat from source to "sink" to be intercepted.

Carnot imagined that a heat engine extracted energy in the same way energy is derived from a water wheel, by intercepting the flow of fluid.

Of course if the river is completely dammed up, there is no longer any flow to extract energy. Fluid must flow in order to extract energy from it

Random molecular vibration, or heat, propagates by kinetic energy transfer, such as one molecule, or a group of molecules bumping against other molecules.

In a heat engine, the hot air molecules are made to transfer kinetic energy to the piston. That energy is no longer available to transfer to the "sink".

Any transfer of heat to a "sink" is incidental to the operation of a Stirling heat engine, not a necessity as with a flow through a wind or water turbine.

In other words, the statement above: "without dumping that heat somewhere, the gas would not be able to get back to the original starting condition.", and that "So we remove the heat source, and put the air back in contact with a heat sink", is demonstrably not necessary.

No Stirling engine operates by removing the heat source and replacing it with a cold source.

Re: Programmatic control of Stirling Engines

Posted: Fri Sep 17, 2021 2:09 pm
by Tom Booth
To elaborate on the difference another way,

It might be imagined that letting heat into a Stirling engine heats the gas inside which expands and consequently pushes out the piston.

If heat were an actual fluid substance, it would then have to be "let out" so that the piston could return to it's starting position, as described previously:
Cooling/compression:
Now, to get our initial condition back (which we need to do to maintain a closed cycle), we need to get this 2099 cc of gas at 1 atm back down to 1000 cc at 1 atm. The only way to do that (the only free variable) is to change the temperature! So we remove the heat source, and put the air back in contact with a heat sink at 273K. Once the temperature equalizes, we can hold constant pressure at 1 atm and the ideal gas law will tell us P = 1atm, T = 273K, and V = 1L, right back where we started. The key here is that without dumping that heat somewhere, the gas would not be able to get back to the original starting condition
.

For a long time, since Carnot, this was, and to some degree still is, the belief about how a Stirling heat engine operates.

In actuality, however, the truth of the material is, a Stirling engine operates much to quickly for it's method of operation to depend on the slow transfer of heat by conduction.

Rather, heat radiates from the hot side into the gas inside the engine. The gas molecules quickly expand, colliding with the piston, transferring energy and cooling down simultaneously in the process. Hot air molecules colliding with the chamber walls mostly just bounce off, little energy transfer taking place, though of course, no enclosure can be made 100% impervious to heat, so some heat will inevitably be lost in this way, but such loses are not NECESSARY at all,, not in the way the loss of a fluid is necessary, if a fluid were to fill a chamber and push out a piston.

Heat is not a fluid as Carnot imagined. It is energy, which is "let out" in the process of driving out the piston. The energy introduced as heat is "let out" as mechanical "work".

That there is some necessity to let some part or portion of the heat flow through to the sink as "waste heat" seems to be a fallacy.

In my experiments, so far, blocking the path or "flow" of heat out of the engine to a "sink", by insulating the sink, results in the engine running measurably better. Retaining heat in the engine, rather than intentionally allowing it to transfer to a sink to get rid of it, appears to results in a stronger running engine.

Re: Programmatic control of Stirling Engines

Posted: Mon Sep 20, 2021 4:26 am
by MikeB
Tom Booth wrote: Fri Sep 17, 2021 2:09 pm The energy introduced as heat is "let out" as mechanical "work".
This is what I was trying to get at with the wind-turbine analogy - you missed out the word "some" above - _some_ of the energy in the air inside the engine gets transferred to work done by moving the piston. This will reduce the temperature / pressure in the cylinder, but if I understand correctly,
the reduction in pressure won't be enough to fully return the piston unless:
(a) the transfer of temp > work was 100% efficient
(b) no additional heat energy has transferred in during the elapsed time (half cycle)
(c) no energy was wasted via friction

Re: Programmatic control of Stirling Engines

Posted: Wed Sep 22, 2021 6:47 pm
by Tom Booth
MikeB wrote: Mon Sep 20, 2021 4:26 am
Tom Booth wrote: Fri Sep 17, 2021 2:09 pm The energy introduced as heat is "let out" as mechanical "work".
This is what I was trying to get at with the wind-turbine analogy - you missed out the word "some" above - _some_ of the energy in the air inside the engine gets transferred to work done by moving the piston. This will reduce the temperature / pressure in the cylinder, but if I understand correctly,
the reduction in pressure won't be enough to fully return the piston unless:
(a) the transfer of temp > work was 100% efficient
(b) no additional heat energy has transferred in during the elapsed time (half cycle)
(c) no energy was wasted via friction
I don't suppose we'll ever reach complete agreement on the matter, but as I tried to point out, WIND through a turbine is fundamentally different from HEAT.

I think we can agree that AIR passes through a wind turbine. A Stirling engine, however is hermetically sealed. No air molecules enter, pass through, or leave a Stirling engine.

As far as friction is concerned, I think we can also agree that the heat energy must first be converted to mechanical work BEFORE it can be converted BACK into friction/heat. Is that not dictated by simple logic?

"SOME heat", sure. But what is "some"?

Heat energy ranges all the way down to absolute zero, so even if the engine converted all of the ADDED heat and more, it would only be converting some, not ALL the heat down to absolute zero.

Obviously, in some way, a running Stirling engine does reduce pressure enough for the piston to return or it would not be running.

It is well know that it takes TIME to transfer heat by conduction through a heat transfer medium, such as the chamber walls of a Stirling engine More Time than is available in 1/2 cycle of an engine running at 1000 rpm.

Where does that leave us?

If there is not time enough to dissipate heat by conduction to a sink, how then does the pressure reduce enough for the piston to return?