Steam engine throttle control

I’m building a steam engine. I have a linkage design that will require an electric motor to adjust angle of throttle. The design will throttle and govern the engine based on engine revs. Early steam locomotives achieved this by a mechanical governor and a steam shut off valve which meant a complicated throttle arrangement. The engine will have a potentiometer as a throttle. My question is this a simple as mapping the pot (0,1023 ) and mapping the rev count to 2000 over that same range (0,1023,0,2000) or do we need to break the revs down to seconds or milli seconds. Revolutions will only be counted by a single pulse per rev and I haven’t decided what type of sensor to use or do you think I should use more pulses per rev to get a better count per second and better responses. No code started as yet.

I doubt very much that there will be a linear relationship between speed and the steam-valve position.

The usual way to control the speed of an engine is by the use of a PID control system. There is an Arduino PID library and there is an example of a simple PID function in this link.

The idea of the PID system is to open (or close) the throttle to compensate for an error between the actual speed and the desired speed. As the error reduces the size of the throttle opening also reduces to avoid an over-shoot.

I suspect the mechanical steam-engine governors had this sort of behaviour built in - whether by accident or design.

If the engine will be operated without a person present you should probably also have a separate over-speed prevention device in case the Arduino control system fails - pieces of flywheel flying across the workshop should be avoided.

...R

You will need to do some more calculation.

The pot indicates the speed, that's one. Now the question is indeed how to get to this speed.

An experienced real life operator will do PID even though they don't call it. When say a train is setting off they will slowly open the valves, train sets in motion, valve opens more until fully open, and by the time the train reaches full speed the operator starts to throttle down, monitoring the speed of the train, anticipating slopes, and correcting the throttle as needed.

You are going to mimic that with a PID loop. You need some kind of speed feedback (encoder) to measure how fast your engine runs or the wheels spin or whatever point is convenient to measure, then adjust the throttle up or down to reach the desired speed. The speed vs. throttle setting relation is probably indeed not linear, but will also change with the load the engine experiences, and the current steam pressure which likely is also not constant but depends on factors such as the amount of fuel burning and the amount of steam taken.

Ripcrow:
Early steam locomotives achieved this by a mechanical governor and a steam shut off valve

Not actually the same, but this has to remind be of the loco at the end of "Back to the Future!". :grinning:

wvmarle:
An experienced real life operator will do PID even though they don't call it.

As with the equivalent "Cruise Control" - difficult to emulate what a driver does without thinking (much). Apparently not comprehended by whoever designed my Forester. :roll_eyes:

Ripcrow:
Early steam locomotives achieved this by a mechanical governor and a steam shut off valve

I missed this earlier (senior moment ?)

I don't think governors were ever used on railway locomotives. All they had (have) is an over-pressure valve to protect the boiler. The driver regulated the speed of the locomotive.

Governors are used on stationary steam engines and my Reply #1 is appropriate for them.

If this project is for radio control of a model steam railway locomotive then there will be no need for PID control. The human operator will control the speed - just like with a real steam railway locomotive.

And, from what I have seen at exhibitions people run model steam locomotives without radio control simply by manually adjusting the steam valve before the engine starts moving.

...R

The governor usually controls steam pressure to the inlet valve. The inlet valve is manipulated to control the amount of time steam is admitted to the cylinder. My linkage design eliminates the need for a Johnson bar linkage. The Johnson bar changed the valve opening time. My linkage will adjust the time the valve admits the steam. I think you may have missed the point. I want the throttle ( the pot ) to tell the arduino how many revs the engine is supposed to do. If the pot is set and gives a reading that equals x revs then the arduino reads the current revs and adjusts the throttle position if revs are not equal to the mapped pot value. For example pot reading equals 150 means engine revs supposed to be 500. If revs are less then 500 open throttle. If revs are over 500 then decrease throttle. If pot is mapped to 1023 and revs are mapped to equal same it should be linear. The throttle linkage can be adjusted to open the valve at the right time and have the valve open for the required time to create the necessary power without altering the steam pressure. For example engine load is increased so throttle opens as engine speed decreases. As the throttle opens steam is admitted for longer creating more power.
The last of the steam trains ran at full speed with hardly any steam use due to inlet valve closing quicker as speed increased. I want to achieve the same.

Sounds like PID to me, ECHO?

Governors were one of the first method of implementing PID. It works similar to Ki, as it integrates the error. These were used to regulate windmills also. A train that reacts too quickly using P and D terms would be pretty unrealistic.

Ripcrow:
The last of the steam trains ran at full speed with hardly any steam use due to inlet valve closing quicker as speed increased. I want to achieve the same.

But they did not (do not - they still exist in operational condition) have governors. The driver was the governor and the human brain continues to be a great deal more sophisticated than a computer program.

Are you making a model stationary steam engine or a model railway railway locomotive? If we know what you are trying to achieve it is much easier to give useful advice.

A railway locomotive is generally controlled with two devices - the regulator which determines how much steam is allowed out of the boiler (and therefore the steam pressure available to the cylinders) and the cut-off which determines the percentage of time the valve is open to admit steam to the cylinders. The two controls interact very closely with one another. With the inlet valve only open for a short period the steam is expanded more in the cylinder - though, for obvious reasons, the average cylinder pressure is lower.

Building a program that can optimise the setting of both of those controls will be a great deal harder than a program just needs to optimise one of them. In general a PID system is used to control a single input based on a single output - for example, with a DC motor the PWM duty cycle is adjusted in response to the motor speed.

At this stage my sense of your requirement is that you want to measure both speed and steam consumption and maintain a set speed with the minimum amount of steam. It may be that the amount of cut-off in conjunction with the regulator setting and the speed provides a good proxy for the quantity of steam being consumed so that there is no practical need for a device to measure steam consumption directly.

I suspect that the drivers of full-sized locomotives used some rule-of-thumb for setting the cut-off and used the regulator for finer control. Adjusting the cut-off is not generally as convenient as adjusting the regulator. Put another way, the cut-off setting is probably chosen by experience rather than by short-term trial-and-error on every journey. You could do some trials with your locomotive and from the data create a table of cut-off settings that your program could use.

...R

The normal “Watt” centrifugal governor on a steam engine is effectively a proportional feedback controller just acting on a control valve throttling steam. ( It’s not an integrator !!)

As a starter ..You could mimic that - you don’t need to know throttle position only the speed to which you want to control. So measure flywheel speed , have a desired rpm set on a pot. Output to the throttle ( steam valve) is then the difference between set rpm and actual rpm , multiplied by some gain factor and that is sent to the throttle servo.

As the previous poster mentions, in his great description , adding some form of variable valve timing makes it harder - but one step at a time !

Like the watt governor it will have “droop”, that is as load increases revs will drop ( leave your to work out why) you can add some error integration later to fix that .

proportional does not retain the error. If it was it would oscillate (instead of holding firm the speed while taking some time to achieve this). Mechanical governors can be relatively quick but it’s integral due to their flywheel effect. I understand what you mean about it being related to the proportional aspect of control.

Here’s a pretty good diagram that shows the response to a waveform.

I grew up next to a railroad with steam engines. I can assure you that to start a locomotive, you do not just crack open the steam valve. The engineer opens the valve as far as possible, to the point of spinning the wheels, in order to make the train begin to move. There are just too many variables for an Arduino to duplicate this.

Paul

This is a stationary motor without a governor. The steam cutoff can regulate speed and a variable valve timing setup is what my linkage will provide. All I need to do is read the revs and have a way of using the pot to set what revs I want. Set the pot to 1000 revs and the arduino reads the rev count and adjusts the linkage by turning a dc motor clockwise or counterclockwise. The dc motor will turn a screw that pushes or pulls a slide which alters the angle of the push rod. The push rod works in a slide that is used as a lever to open the valve.
If you imagine a ball valve as a inlet valve. The handle has a slot cut into it. If the push rod is at 90 degrees and is closest to the valve body the pushrod can push the valve open the full movement of the pushrod travel. If the pushrod is positioned further away from the valve body the valve will open less. The pushrod will have a pivot point that will allow its position of contact with the valve lever to be adjusted. This will be the job of the dc motor. The slot in the valve lever allows the valve to be opened at the right time every time but also allows the time steam is admitted to be varied.

What I’m not sure about is how to read the revs and map them to match the pots map. Do I need to create a library. When mapping a potentiometer to control a servo a library has to be included in the program. How do I create a library or is there another way to map the pot to the revs.

Ripcrow:
This is a stationary motor without a governor.

[....]

What I’m not sure about is how to read the revs and map them to match the pots map. Do I need to create a library. When mapping a potentiometer to control a servo a library has to be included in the program. How do I create a library or is there another way to map the pot to the revs.

Have you carefully considered what I said in Reply #1.

Now that we know it is a stationary engine we can set aside all the comments that were made about railway locomotives.

...R

To measure the rpm of the motor you need an encoder of sorts. Many different options, depending on your machine. Mounted to the shaft or contactless, optical or inductive pickup is common for contactless. Whatever works for you. A slot in a wheel and a break beam sensor, a white dot on a wheel that can be read by a brightness sensor, just to name a few - again, many different options.

It seems to me you are muddying the water a bit by using the term 'throttle' for two different things.

Ripcrow:
I have a linkage design that will require an electric motor to adjust angle of throttle.

and

Ripcrow:
The engine will have a potentiometer as a throttle.

One 'throttle' controls the engine RPM and the other 'throttle' commands the desired RPM. Part of the confusion comes from the common use of 'throttle position sensor' which would normally be a pot used to measure the position of the linkage not a pot used to command a desired RPM.

Yes, you can map a pot directly to the desired RPM. Then you need an algorithm to decide how much the linkage should move to deliver the desired RPM. You can map a specific RPM to a specific linkage angle but that is just the P of a PID algorithm. A full PID algorithm will be smoother and quicker.

PID library

Sounds much the same as a model chopper tail rotor gyro application.

Receiver gets the required position of the tail rotor, feeds this to the gyro, gyro compares this and the feedback from the gyro pot (or equivalent if electronic gyro not mechanical) and adjusts the servo to suit.

Any change in either the receiver input (operator input) or the input from the gyro pot due to unwanted movement, and the gyro circuit adjusts the servo until equilibrium is achieved.

Not suggesting using a gyro, just the idea behind it.

Ok so the pot is the man operated part of the throttle assembly. The electric motor does the actuating of the mechanism. Does mapping the pot (0,1023,0,2000) create the algorithm needed. According to my arduino book the map function maps a number in one range into another range.

Therefore any input from the pot would be mapped over to revs if that was the range you mapped it with. Once it’s mapped it’s pretty simple to write a code that says if pot = 2000 (1023) read revs if revs below 2000 digitalwrite motor pin in the direction needed to increase revs. Read revs. If pot = 511 read speed if revs over 1000 digitalwrite motor pin in the direction needed to reduce revs.

Seems simple. But should revs be calculated per minute or per second or even milliseconds. How do we define what we are mapping the pot to as well. Simply (0,1023 ,0,2000) doesn’t define what the 0;2000 is.

Mapping pot to rpm is that simple indeed.

But the throttle control is where PID comes in play. Measure the rpm as often as practical, then dial in the PID. You probably won't need D.

Try it, there’s a science behind smooth and accurate control systems. You might be ok with it’s performance. If you’re manually just speeding up and slowing down it will do what you input. Where PID excels is when you want smooth controls that takes feedback and self adjusts for load changes including hill climb ... etc without fluctuations we call oscillation. If you’re reading the rpm and having it adjust the speed based on a potentiometer you have already put in the “P”. This can get unbalanced if it starts to overshoot and hunt for the correction. Watch out for jerkiness.