This study addresses the challenge of optimizing energy management in the electric vehicle industry, specifically focusing on motorsport. It particularly targets optimizing energy management during an endurance event at the Formula Student competition. The research involves detailed simulation of a complete endurance event, including developing precise track and vehicle models and their application in real-time energy management of our motorsport vehicle. The primary objective is to develop an energy reference profile that optimizes point scoring following the event’s specific rules. The energy reference profile serves as a strategic guideline for energy consumption and its regeneration throughout the endurance event. What sets this study apart is its emphasis on the real-time feedback controller’s implementation in the Formula Student prototype, FST12, specifically during the endurance event. This controller dynamically regulates the inverter’s power output, ensuring the vehicle closely follows the pre-established energy reference profile. This real-time energy management approach enhances overall performance by optimizing energy utilization for maximum scoring potential. The developed distance estimation method presented an error of less than 0.7% compared to experimental measurements. The Formula Student prototype, FST12, underwent experimental validation on a real 20 km closed-loop track. Results showed that the optimized strategy can be implemented with less than 0.5% of error in energy consumption and 6.8% of error in the obtained competing points.