GearBlocks

GearBlocks

Not enough ratings
Combustion Engine Builder's Guide
By danger726
How to build combustion engines in GearBlocks, from the basics to more advanced topics such as crank angle offsets, timing angles, and firing order.
   
Award
Favorite
Favorited
Unfavorite
Introduction
This guide assumes basic knowledge of how to build in the game, how to configure and activate part behaviours, and so on. The in-game tutorial is a good starting point to learn about these topics.

NOTE: Energy Consumption is assumed to be off unless otherwise specified!
The Simplest Engine
At the bare minimum, a combustion engine must have the following parts to function:
  • Rear (Driven) Crank.
  • Cylinder.
  • Head.
  • Throttle.
All of these parts can be found under the "Combustion Engines" part category.

First, attach an Engine Cylinder 2x2 and Engine Rear (Driven) Crank x2 & Axle x2 via a Beam x3:


NOTE: The rear crank must be connected via a Rotary Bearing attachment to the engine block, this is crucial as the engine's torque is delivered via this attachment.

Using the linker tool, link the engine cylinder to the crank, this will automatically create a piston and connecting rod:


Then, attach an Engine Head x2 and Engine Throttle x1:


NOTE: The throttle can attach to either side of the head, the opposite side will automatically become the exhaust outlet.

Assign a key to control the throttle:


Activate all the parts, and the engine will run in this basic form, but it will have to be started by hand.

The grabber tool can be used to shove the crank to turn it over and get the engine going, it'll probably take a few attempts:


NOTE: For the purpose of these examples, a Pin part is being used to hold the engine in place when unfrozen.
Adding a Starter Motor
Attach a Clutch & Ring Gear x3 (24T). This acts as a flywheel to make the engine idle more smoothly, and has a gear which will be used in a moment:


Add a Starter Motor Small, found under the "Motors" category (with an additional Beam x1 used here to attach it):


Along with an Axle x2 and Spur Gear x1 (8T):


Assign a key to control the starter motor, and enable "Invert Solenoid":


NOTE: Given the particular location of the starter motor in this example, the solenoid must be inverted so that the gears only engage when the starter is running.

Activate the starter motor, and hold the assigned key to start the engine.

NOTE: To stop an engine once running, either deactivate the throttle or head parts, stall the engine (e.g. with the grabber tool), or just freeze the construction. A proper way to turn off engines with an ignition switch will be coming in a future update!
Multi-Cylinder Engines
By adding more crank parts to build up a crankshaft:


...Attaching another cylinder:


...And head, a multi-cylinder engine can be built:


Each head can have its own throttle, but a throttle can also be shared between multiple heads using Pipe parts to attach it:


An exhaust system can also be constructed from pipes, by attaching them to the heads on the opposite side to the throttle:
Crank Angle Offset
The engine crank parts can be attached together at 90 degree intervals. This allows for example, an inline 4 cylinder engine, with a crankshaft that has its middle two cranks 180 degrees out of phase:


However, for some engine configurations, a finer tuning of the crank angles is necessary. For example, in this 3 cylinder engine, the cranks are 120 degrees apart:


This can be achieved using crank angle offsets. It's often easiest to start with all the cranks aligned like this:


And then adjust the angle offset as needed in the crank's part behaviour settings:


In this way, many kinds of engine configurations can be built. Check out the in-game constructions for some examples of what's possible!
Timing Angles
For a multi-cylinder engine, its cylinder head timing angles determine how smoothly it runs.

NOTE: Currently, timing angles only affect the sound of an engine, not its actual performance.

The timing angles are derived from the engine's relative crank angles and cylinder head "firing order". See the Engine Tool section for information on how to modify the firing order.

To calculate the timing angles, the game iterates through each of an engine's heads in firing order:
  1. For the first head, the timing angle is set to zero, i.e. for timing purposes, the crankshaft is considered to be at zero degrees when the first head's piston is at top dead centre (TDC).
  2. Then, for each subsequent head, the game calculates the angle the crankshaft would need to rotate through in a clockwise direction for its piston to reach TDC.

NOTE: A crankshaft's rotation direction is determined when viewed from the "rear" of the engine (i.e. whichever end the Rear (Driven) Crank is at).

For example, in this 2 cylinder engine, the first head has a timing angle of zero degrees, and the second an angle of 360 degrees:


Engines are treated as having a 4 stroke combustion cycle, meaning each cylinder "fires" every two crankshaft revolutions (i.e. 720 degrees).

So in this 2 cylinder engine, the first cylinder fires when at TDC at zero degrees, the second cylinder fires after one full revolution (360 degrees, bringing it back to TDC), the first one fires again after two revolutions (720 degrees), and so on.

In this way the engine fires a cylinder once per 360 degree revolution, alternating cylinders.

NOTE: The EngineTool script mod is being used here to display the timing angles, for more info on this see the Engine Tool section.

Here's another example, a 3 cylinder engine, with cranks spaced 120 degrees apart:


The first cylinder fires at zero degrees, the second cylinder after 240 degrees of crankshaft rotation, the third after 480 degrees, the first again after 720 degrees, and so on. Note the equal spacing of 240 degrees between firings.

There are often a few different firing order sequences that give an equal spacing for a given engine configuration, here's another one for the 3 cylinder:


However, there will be some that do not result in equal spacing between timing angles, for example:


Now cylinders 1, 2, and 3 will fire after the crankshaft has rotated 0, 120, and 240 degrees, then again after 720, 840, and 960 degrees, and so on. The big gap between cylinder 3 and 1 firing will give the engine a rough running "offbeat" sound.

As a final example, here is a 4 cylinder engine, with its middle two cranks 180 degrees out of phase:


As always, the first cylinder fires at zero degrees. Then each subsequent cylinder fires after an additional 180 degrees of rotation, again giving an equal spacing between firings.

There are alternative firing orders that could work here, e.g. rather than 1-4-2-3, instead 1-2-4-3 could be used.

NOTE: Timing angles that are equally spaced apart give a smooth sounding engine. However, there are no hard and fast rules, unequal timings can result in all sorts of interesting sounding engines!
Engine Tool
To modify an engine's firing order sequence, the "Firing Order" index value for each head can be adjusted individually in its part behaviour settings.

However, an easier way is to use the EngineTool script mod!

NOTE: For general information on running script mods, refer to: https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=3082621095

With the EngineTool script mod running, target one of the heads in an engine, this will display each cylinder head's firing order and timing angle:


The mouse wheel can be used to quickly change the targeted head's firing order index value.

The tool also has a selection of pre-defined firing orders for common engine configurations such as inline 4, inline 6, cross-plane V8 and so on. Choose one from the dropdown and click the "Set To" button to apply it to the whole engine.

NOTE: Whenever a head's firing order value is changed, the timing angles are recalculated for the entire engine (according to the method described in the Timing Angles section).

Don't forget to look at the in-game example constructions to see how crank angles and head firing orders can be set up for various engine configurations.
Further Tuning
In an engine head's part behaviour settings, there are also options for adjusting maximum RPM, torque curve characteristics, and so on:


Output torque is more or less proportional to air flow rate through the head into a cylinder, and this flow rate is modulated by Volumetric Efficiency (VE). VE changes over the rev range, so by adjusting "Peak Volumetric Efficiency RPM", the torque curve peak can be shifted earlier or later in the RPM range.

While tuning an engine, the PartBehaviourGraph script mod can be used to visualise its torque curve and other parameters. With this script running, target the engine's Rear (Driven) Crank part and press Tab, this will open a window showing a real time graph of its data channels. The same can be done for Head and Throttle parts too:
4 Strokes and Sounds
As mentioned earlier, engines are currently simulated with a 4 stroke combustion cycle, with each cylinder firing every two crankshaft revolutions.

You may notice however that engine cylinders sound as if they fire every single revolution, like a 2 stroke engine.

In fact by default the sounds are doubled in pitch. This was done to make the engines sound more satisfying, given the relatively low maximum RPM possible.

For a more "correct" sound, you can turn this off by unchecking "Double Audio Pitch" in the engine head part behaviour settings.
Fuel Tanks and Ancillaries
Until this point, it has been assumed that Energy Consumption is off. To make an engine work with this setting turned on, it will need at least one Fuel Tank. Once attached to the construction, the engine heads can be linked to it.

Also a Battery should be added to power the Starter Motor, and an Alternator to charge the battery.



As always, explore the built-in examples for ideas!
5 Comments
WinVistaIsNotBad 16 Jul @ 3:47am 
Apparently there's a bug with the "invert direction" option of the engine, the sound is calculated as if the crank is rotating in the default direction regardless of which direction it actually rotates in, which means most engines if designed correctly won't run smooth, so if you want to fix that you have to first design the engine to run in the default direction and then turn the reverse direction thing on without touching the firing order :steamfacepalm:
Judy Tester 9 Feb @ 8:48pm 
@im_already_dead @paranormal113

https://en.wikipedia.org/wiki/Air%E2%80%93fuel_ratio#Air%E2%80%93fuel_equivalence_ratio_(%CE%BB)

"Air–fuel equivalence ratio, λ (lambda), is the ratio of actual AFR to stoichiometry for a given mixture. λ = 1.0 is at stoichiometry, rich mixtures λ < 1.0, and lean mixtures λ > 1.0."
im_already_dead 8 Feb @ 9:29pm 
paranormal113 Jan 27 @ 1:57pm 
a perfect guide but wtf is lambda?
i love your game keep it upp

...same
paranormal113 27 Jan @ 11:57am 
a perfect guide but wtf is lambda?
i love your game keep it upp
danger726  [author] 23 Jan @ 5:42pm 
Hey all, I hope this guide is somewhat useful, especially for the timing angle stuff and how it relates to engine sound. I'm not sure how well I explained it, so comment here if you still have questions!