Modular design becomes a trend in the automotive industry to increase competitiveness with vehicle platforms that combine multiple modules to provide different applications. This paper presents an optimized Fuzzy Logic Control (FLC) applied to modular all-wheel-drive vehicles, focusing on Electric Vehicles (EVs) and Hybrid Electric Vehicles (HEV) powered configurations. The vehicle behavior is determined by dynamic model simulation, in which the Magic Formula is applied to define the tire slip, associated with the load transfer during curves or drive/break situations. The controller acts as an electronic differential and changes the in-wheel motor torques to correct the vehicle trajectory during a standard maneuver. A multi-objective optimization based on the genetic algorithm determines the FLC configuration. The vehicle parameters (EV and HEV) have been modified to analyze the optimized FLC and, in all cases, the control showed an improvement in behavior to the vehicle without control. Finally, the FLC was implemented in a simple microcontroller and a hardware-in-the-loop simulation was developed to simulate a real vehicle operating condition and analyze this performance.