The software KiCad was used to create the respective PCB, due to it being open-source and easy to use. The first step was to create the schematic symbols corresponding to each component of the circuit, some already existed (like resistors, capacitors, diodes and MOSFET’s), and others were created from scratch (like gate drivers, motor, batteries, voltage regulator and all the 2, 3 and 6 pin connectors). Due to its size, the schematic was divided in 3 images.

With this schematic in hand, we need to create the necessary footprints to assemble the PCB layout. Just like the component schematics, some footprints already existed and were used and others were created from scratch (using the component datasheets as reference for the dimensions and pin placements). 

 In the following image we see the entire PCB layout.

Besides these copper wires, all other components were placed on the top layer, in the following image we can see the physical PCB (courtesy of JLCPCB) assembled with all components.

In order to test the controller design, assuring the safety of the driver and the car, the whole system was recreated in a laboratory. The controler is present on the leftmost side (we also have an arduino recording measurements from temperature sensores placed on all the heatsinks) and the motor on the right side is acting as a generator, so we can simulate various loads.

A diagram explaining this setup is also shown.

Firstly, we have two 12V batteries in series connected to the PWM controller, which is powering the DC motor with an equivalent DC voltage V1 (proportional to the duty cycle). This motor is coupled to the second one on the right mechanically, making the angular velocity of both shafts the same. Since the second motor is not powered electrically, it is serving as a generator, imposing a voltage V2 on the three rheostats which itself imposes a current back on the DC motor generator.

The current forced by the rheostats is interpreted by the left DC motor as a torque load. In other words, by increasing the equivalent resistance of the three rheostats, we are making the DC motor use more current, giving us the ability to manipulate how much current runs through the PWM controller. This way, by adjusting this resistance, it is possible to simulate racing conditions, assuming the only external variable on the DC motor is the torque appliedon E1. The following system of equations describes how the mechanical component interacts with the electrical in a DC motor.

Matching the torque and velocity on each motor (using the coupler), and knowing the constants R, L, k, J and B for both cases, with just a few measurements of the system, it is possible to calculate all the relevant information. For example, imagining we know the torque both the car and the driver apply on the motor on a certain point of the track, by adjusting the rheostats, we are able to obtain the correspondent current draw graph on the controller for variable speeds on those conditions.

Since we are dealing with currents around 25A or 30A, both the motors and the rheostats are working near their limits. To mitigate any possible damage to the equipment, the temperature of both motors is monitored closely, as well as the current on each rheostat, to ensure the load is distributed equally. As for the controller, the PWM signal generated is observed on an oscilloscope and the temperatures of the diodes and MOSFET's are recorded as well.