Propeller bearings
The propellers of Create Aeronautics read by a computer: how hard they push, how fast the air goes through them, and whether they turn.
The Propeller Bearing and the Gyroscopic Propeller Bearing are blocks of Create Aeronautics. Without that mod, there is no such block, and peripheral.find("propeller_bearing") returns nil.
A Propeller Bearing turns the sails glued in front of it into a propeller: that is what moves a Create Aeronautics ship forward, turns it, or lifts a helicopter. A computer connected to one reads the thrust of the propeller, the speed of the air it blows, and whether it turns: enough to check that every engine of a ship works, to compare them, or to know what a turn of the throttle really gives.
Both bearings, the plain one and the gyroscopic one, have the peripheral type propeller_bearing. Against the computer, a bearing is called by its side ("top"...); on a Data Cable (Minicomputer and newer) it gets a name such as propeller_bearing@3,70,-8. peripheral.list("propeller_bearing") gives the names of all of them.
local prop = peripheral.find("propeller_bearing")
print("thrust " .. prop.thrust() .. ", air " .. prop.airflow() .. " m/s")Also a kinetic block. A propeller bearing is a Create machine that turns, so the wrapped bearing also has the methods of Create kinetic blocks, such as speed(), the speed of its shaft in RPM. The speed itself is set where the rotation comes from, often a Rotation Speed Controller (kinetic.set_speed()).
Every reading at once. Like the sensors, it has a read() (see sensor.read()) whose table holds thrust, airflow and active.
When the bearing is gone, its methods stop the program with propeller bearing removed; when its chunk is not loaded, with peripheral is not loaded.
prop.thrust() | How hard the propeller pushes now: sails ^ 1.5 × RPM × 0.2 with the default settings, from the propeller's own speed. 0 while the bearing has no propeller (not assembled) or does not turn. |
prop.airflow() | The speed of the air the propeller blows, in blocks per second (Engineer's Goggles write m/s: the same thing). It grows with the speed of the propeller and with the square root of its number of sails: sqrt(sails) × RPM × 0.05 with the default settings (server config propellerBearingAirflow). |
prop.active() | true while the bearing has a propeller (it is assembled) and that propeller turns, even slowly. false when the bearing stands still or has no propeller: then thrust() and airflow() are 0. |
How a propeller pushes
Four things to know before reading the numbers:
1. Sails and speed. The thrust grows with the number of sails and with the speed of the propeller: sails ^ 1.5 × RPM × 0.2 with the default settings (server config propellerBearingThrust for the 0.2). Twice the speed gives twice the thrust; four times the sails, eight times the thrust. The sails are the blocks a windmill counts (Windmill Sails, Sail Frames, wool, Symmetric Sails).
local function thrust(sails, rpm)
return sails ^ 1.5 * rpm * 0.2
end
print(thrust(4, 64))
print(thrust(16, 64))
print(thrust(16, 128))102.4 819.2 1638.4
2. The propeller takes time to spin up. Its speed follows the speed of the shaft, but not at once: a small propeller catches up quickly, a big one (dozens of sails) takes a second or two. The thrust follows the propeller, so it lags behind speed(), which is the shaft.
3. The sign is the direction. Thrust and airflow are positive when the propeller blows the air out past its sails and pushes the ship towards the back of the bearing, negative the other way. Turning the shaft the other way flips the sign, and so does the thrust direction set on the bearing.
4. The ship gets less when it moves. thrust() is what the propeller gives with the ship at rest, at sea level. A ship already moving the way the propeller pushes it gets less (the air is already moving), and so does a ship high up, in thin air (see altitude_sensor.pressure()). Engineer's Goggles show that smaller push, so they can read less than thrust().
The Gyroscopic Propeller Bearing has the same methods. It tilts its propeller towards the sky, up to 12 degrees from its axis, to keep a helicopter upright; any redstone signal on it locks the propeller straight. The tilt changes where the thrust goes, not how much there is.
Readings
prop.thrust()
How hard the propeller pushes now: sails ^ 1.5 × RPM × 0.2 with the default settings, from the propeller's own speed. 0 while the bearing has no propeller (not assembled) or does not turn.
- number
- the thrust of the propeller now, with a sign; 0 when it has no propeller or stands still
Its sign gives the direction (see above): compare math.abs values to tell the strongest engine. A check of every propeller of a ship, the weakest first:
local props = {}
for _, name in ipairs(peripheral.list("propeller_bearing")) do
table.insert(props, {name = name, thrust = math.abs(peripheral.wrap(name).thrust())})
end
table.sort(props, function(a, b) return a.thrust < b.thrust end)
for _, p in ipairs(props) do
print(string.format("%-28s %8.1f", p.name, p.thrust))
endSee also propeller_bearing.airflow() propeller_bearing.active()
prop.airflow()
The speed of the air the propeller blows, in blocks per second (Engineer's Goggles write m/s: the same thing). It grows with the speed of the propeller and with the square root of its number of sails: sqrt(sails) × RPM × 0.05 with the default settings (server config propellerBearingAirflow).
- number
- the speed of the air through the propeller, in blocks per second, with the sign of the thrust
The airflow also says how fast the propeller can push the ship: once the ship moves through the air as fast as the propeller blows it, the push that reaches the ship falls to nothing.
local prop = peripheral.find("propeller_bearing")
print(string.format("air through the propeller: %.1f blocks/s", math.abs(prop.airflow())))See also propeller_bearing.thrust()
prop.active()
true while the bearing has a propeller (it is assembled) and that propeller turns, even slowly. false when the bearing stands still or has no propeller: then thrust() and airflow() are 0.
- boolean
- true while the propeller is assembled and turning
An engine alarm: a lamp on top of the computer lights up when one of the ship's propellers stops.
while true do
local stopped = false
for _, name in ipairs(peripheral.list("propeller_bearing")) do
if not peripheral.wrap(name).active() then
stopped = true
end
end
rs.set("top", stopped)
sleep(1)
endTo steer a ship with a propeller, see the heading hold of vehicle.spin(); to lift it with balloons, Hot Air Burner.
See also propeller_bearing.thrust()