Motor malfunctions can happen for a variety of reasons, but the source of the problem can be narrowed down to a root cause with a few checks.
Sudden drops in speed might be the result of low battery, you can check this on your LCD display. Low battery is signaled by a decrease in the number of dots on the bottom of the display. More information on the performance limitations from a low battery can be found through the linked article.
Levy- Battery Connection
If you have a Levy, improperly closing the charger's dust cover at the base of the battery could lead to connection issues. In order for the battery pins to properly connect with the motor controller the dust cover should be flush with the bottom of the battery. Follow the linked article for additional information and images that might be useful to check your battery condition.
Levy Plus- Battery Connection
If you have a Levy Plus model, momentary power losses could be due to inconsistent connection from the battery to the motor. Your Levy Plus battery should fit snugly into the stem of the scooter, so you should check for unwanted movement. If you discover that your battery shakes when connected to your Levy Plus then consult this article for methods of making adjustments to the battery bracket.