In fact, flywheels last indefinitely, have two to three times the energy density of batteries, and will take a 90% discharge many times. In operation, when the satellite is in the sun and its solar arrays are generating electricity, a motor will "spin up" the flywheel to a maximum of 60,000 rpm. When the satellite is in the Earth's shadow, the flywheel's generator converts energy stored in the spinning mass into electricity. NASA engineers have refined the flywheel by incorporating magnetic bearings and advanced motor/generator technology. NASA plans to replace batteries on satellites and possibly the space station with four flywheels, which will also serve as gyros for positioning.