# Adaptive Cruise Control in Electric Vehicles with Field-Oriented Control
## 4 Implementation
### Simulation  
The simulation of the adaptive cruise control based on an indirect field-oriented control drive system was implemented in the Simulink environment from MATLAB. To simulate the same system as the experimental one, the simulated elements had the same parameters as the real elements used in the low-scale prototype system. The induction machine was modeled based on the parameters from Table 1 to obtain an accurate view of how the experimental setup will work. Then, the motor was supplied through an IGBT inverter from a DC source, which acts like a battery. The inverter was driven by PWM signals, which were generated with an SPWM generator based on the sinusoidal three-phase current generated from d-q currents obtained from the vector control block. Additionally, the electromagnetic brake and current regulator were modeled and simulated. The adaptive cruise control block respects the structure presented in Figure 4, and it generated longitudinal acceleration based on the set driving speed, the safe time gap in seconds, the relative distance between the vehicles, the relative velocity between the vehicles, and the host vehicle speed, as presented in Section 2. Besides the host vehicle system, a leading vehicle was also modeled. Figure 9 presents the simulated system. This simulation allowed us to test three possible scenarios. The first one was when there was no car in front of the host car; the host car can run at the desired set velocity in this classic cruise control scenario. The second scenario was when the host car was running at the desired set velocity and at a certain point in time, and there was a leading car in front, so the velocity must be adjusted to maintain a safe distance between the two vehicles. The third scenario was when the host car was following a leading car for a certain period, so the velocity was adjusted to maintain a safe distance. Figure 8: Current-torque characteristic of the powder brake. The vector control block was the implementation of an indirect vector control based on Equations (12)-(14), the block diagram from Figure 4, and the machine's parameters from Table 1. Figure 10 presents the implementation of the indirect vector control block. As in the case of the motor, the current regulator and the powder brake were also modeled based on the real element. The current regulator was modeled as a PWM signal generator, where the input voltage ranging between 0 and 10 V determined the duty cycle of the PWM signal from 0% to 100%. The PWM generated by the current regulator was applied to the brake, where using a transfer function, the PWM signal was transformed  
Figure 10: Indirect vector control block. Reproduced from [18] with permission from IEEE. Figure 9: Adaptive cruise control based on indirect vector-controlled induction machine drive system. into the current. Based on the current-torque characteristic, from Figure 4, a look-up table was implemented, so the corresponding torque was obtained at the output of the brake and was applied to the induction machine. Figure 11 illustrates how the brake was modeled. * **Experimental system** For the experimental system, beside the induction machine, Lesson 1/3 HP 3450 rpm, the current regulator, and electromagnetic powder brake, presented earlier, the following elements were used: a Danfoss inverter, a rotary encoder, three Hall current sensors, a power supply source, and a dSPACE platform. The dSPACE platform has analog and digital inputs and outputs; it is a real-time, dual-core processor that can be programmed using Simulink. For this system, the dSPACE platform was used to read the signals from the current sensors and from the rotary encoder using Simulink; the vector control block was developed, and PWM drive signals for the inverter were generated. Additionally, the torque load from the powder brake was controlled from the dSPACE using a voltage signal to the LEO--current regulator.