So the generator is not really connected, until it's time to take energy off the flywheel.
I think you are all misinterpreting the question, and Jovan is misunderstanding "flywheel". He did mention battery.
I think the question is about using unnecessary kinetic energy (such as that generated by an electric car from its propulsion motor(s) when coasting down hill) to add charge to the propulsion battery.
The effect is "flywheel like", but no actual flywheel is involved, especially the one Jovan perceives, a wheel spinning in a vacuum.
There are a few tricky little bits about electromagnetics here that might shed some light on your dilemma.
An electric generator presents a torque load that is proportional to the flow of current in the generator. So if you aren't drawing any electric power from the generator, it's very easy to turn the shaft. Short-circuit the leads together and a generator becomes a very effective brake.
Similarly, the amount of power a motor draws from its power supply is proportional to the torque on the motor shaft. A free-spinning motor uses much less energy than one driving a load.
The control circuitry makes sure that if electric power is needed from the flywheel, the motor won't be accelerating at the same time.
To add to Morningfox's good answer... There is no electricity stored there. It is all kinetic energy (the moving flywheel) but it can be converted to electrical energy if you use that KE to turn a generator.
I know how a flywheel functions but it makes no sense to me, It is a wheel spinning in an vacuum (not contacting anything but the axle). It uses the motion of the flywheel as an energy storage device;The axle and bearings are specifically designed with a magnetic bearing so that friction is minimized.
What confuses me is this:
if the motor and generator are both connected to the flywheel wouldn't the generator just convert the flywheels energy into electrical energy as soon as the motor puts the energy in?
I don't see how the energy can actually be stored on the flywheel if the generator is there.
please help me i cant quite get my head around that bit, is there something I'm missing?
Thank You