Go down


Post by DanielLC on Wed Sep 21, 2016 3:53 pm

Normally, you balance a bike by steering. Unfortunately, this only works if it's moving. I designed a bike that balances with gyroscopic precession so that it can stay balanced while still. It's also strong enough to lift the bike up after it falls over. Unfortunately it doesn't balance that well while moving, but this is more a proof of concept, and a better design could switch to steering-based balance when it gets going.

The gyroscopes are normally held horizontally, and spin in opposite directions to counter each other out. To balance the bike, they tilt forward and backward, which forces the bike to tilt left or right by the principle of gyroscopic precession. This doesn't work if it gets tilted to far, but in that case the bike simply falls over, resets the gyroscopes, and then picks itself back up.

It's not overly difficult to knock the bike over, but if you hold Z it locks the gyroscopes to make it fall easily so you can watch it right itself.

//GyroBike by DanielLC
Body {
Lua {
    function onInit()
        resetTiltNegative = false;
        resetTiltPositive = false;
    function OnFrame()
 N_GYRO_POWER = 200*(400-_WY(N_GYRO));
 S_GYRO_POWER = 200*(-400-_WY(S_GYRO));
        if LOCK == 0 then
            if resetTiltNegative then
                TILT = TILT - 1.5;
                if TILT <= -59 then
                    resetTiltNegative = false;
                    TILT = -59;
            elseif resetTiltPositive then
                TILT = TILT + 1.5;
                if TILT >= 59 then
                    resetTiltPositive = false;
                    TILT = 59;
                TILT = TILT*1.03 - 10*_EZ() - 0.1*(TURN-180)*_VZ() - 2*_WZ();
                if TILT <= -60 then
                    resetTiltPositive = true;
                elseif TILT >= 60 then
                    resetTiltNegative = true;


Posts : 78
Join date : 2010-10-23

View user profile

Back to top Go down

Back to top

Permissions in this forum:
You cannot reply to topics in this forum