Click the green flag! Press A to hide the adjustments: 1) Up/down arrows adjust the pendulum acceleration. The two lines on the right show the clock's time vs. the Scratch timer. If the line on the right drifts down, increase the pendulum acceleration; if it drifts up, decrease the pendulum acceleration. 2) Right/left arrows adjust the gear acceleration. Reduce this value if you notice the gear "gaining" on the escapement arms; increase this value if you notice the gear "lagging" behind the escapement arms. 3) Space resets the time from the system clock.
This project simulates the action of a clock with a mechanical escapement gear. Time sensing blocks are used only once - when the green flag is clicked - to set the initial position of the hands. After that, time is kept through the motion of the pendulum and the central gear. The pendulum's motion is governed by sinusoidal acceleration, and the gear rotation accelerates clockwise whenever it's not in contact with the escapement arms. The default settings keep pretty decent time on my laptop. Depending on the speed of your computer, it may run fast or slow, but you can adjust the performance as described above. Small adjustments add up quickly. Happy tinkering!