← Back to list

N7 Low Speed Automation — Design and Practice of Intelligent Vehicles (II)

AME5025 Design and Practice of Intelligent Vehicles(Ⅱ), NTU, 2025 spring

卓子元 (Tzu-Yuan, Cho) · 2025-11-18 09:52 · 0 claps · 6.0 min read
#course #autonomous-vehicles #dynamic-modeling
Open on Medium ↗
Wiki topics: AGT · AI Agents

N7 Low Speed Automation — Design and Practice of Intelligent Vehicles (II)

AME5025 Design and Practice of Intelligent Vehicles(Ⅱ), NTU, 2025 spring

1. Project Goal:

A Luxgen N7 EV will be set as the vehicle platform, equipped with a depth camera to implement perception algorithms. The goal is to extract target and vehicle posture information from raw data. The aim is to establish a complete workflow that gathers data from sensors, inputs it into the perception algorithm, and then sends the results to the N7 vehicle control system via FoxtronPi. This process will cover the stages of “perception,” “inference,” and “control.”

To achieve this goal, we will divide the team into two main groups: the Model group and the Camera group. These two groups will prepare the necessary parameters and environmental perception decision-making capabilities for the autonomous vehicle. The Model group will model the vehicle using Simulink based on data measured from the vehicle, while the Camera group will focus on object recognition and depth sensing through the practical use of depth cameras.

Figure 1. Ideal work flow

Figure 1. Ideal work flow

2. Results — Modeling group

To build the vehicle model, we measured some basic parameters of the vehicle, including its center of gravity and suspension spring constants. Parameters that are not available or difficult for us to measure will be used from default or assumptions.

a. Center of gravity:

For the center of gravity, we assumed the vehicle’s weight is evenly distributed between the left and right sides, with the center of gravity positioned at y = 0. To determine its position, we placed a scale under each of the four wheels on a flat surface and used a moment balance method. From this, we determined that the center of gravity is located 1536.98 mm behind the front axle (figure 2).

As for measuring the height of the center of gravity, we raised the rear wheels and tilted the vehicle at a 10-degree angle. Using the inclination method formula shown in the diagram below, we calculated that the center of gravity is 529.25 mm above the ground (figure 3).

Function for calculation for height of center of gravity

Function for calculation for height of center of gravity

Figure 2. Measurement of the center of gravity

Figure 2. Measurement of the center of gravity

Figure 3. Measurement the height of center of gravity

Figure 3. Measurement the height of center of gravity

For the suspension, we used the formula F = kx to measure the suspension’s spring constant in a static state.

We placed lead weights on the vehicle, ensuring that the weights were pressed as directly onto the tires as possible for more accurate results. After placing the weights, we measured the deformation of the tires and the increase in weight on the scales, which allowed us to calculate the spring constant k.

The results were as follows:

  1. Front suspension spring constant: 43,223 N/m

  2. Rear suspension spring constant: 42,732 N/m.

b. Path following model and simulation:

Simulink model of EV (figure 4), added tire, suspension, and motor modules from the Vehicle Dynamics Block set, and input the vehicle parameters measured through experiments.

Figure 4. model of Luxgen N7

Figure 4. model of Luxgen N7

In the diagram, the color coding is as follows:

  • Green: Mapped Motor module and PID controller
  • Light blue: Lateral force calculation function
  • Dark blue: Wheel suspension force calculation function
  • Red: Suspension and tire modules for the front and rear wheels

Signals and code will be shown in the Signals and code section

c. System Verification:

1. 0–100 km/hr acceleration capability:

Figure 5. graph of 0–100 km/hour acceleration simulation

Figure 5. graph of 0–100 km/hour acceleration simulation

Actual result of 0–100 km/hour acceleration time: 7 sec

Simulation result of 0–100 km/hour acceleration: 7.8 sec

→ ~ 10% error

2. Radius of gyration:

Next, we attempted to run a Constant Radius test. Figure 5 shows the simulation results. The red line represents a circle with a 100m radius, while the black line shows the actual path generated during simulation.

Figure 6. simulation for constant radius test

Figure 6. simulation for constant radius test

The official documentation does not provide specific values for the turning radius, but for similar vehicle models, the turning radius is approximately 5.5 to 6 meters. Simulation result matches documents.

3. waypoint of S curve:

We try to achieve the maximum vehicle speed within a 2-meter offset error (figure 6.). The red dashed lines in the image below represent the range of a 2-meter deviation. Results are shown by figure 8. & 9.

Figure 7. path function for S cure test

Figure 7. path function for S cure test

Figure 8. result of simulation when vehicle velocity =10km/hr.

Figure 8. result of simulation when vehicle velocity =10km/hr.

Figure 9. result of simulation when vehicle velocity =20.8km/hr.

Figure 9. result of simulation when vehicle velocity =20.8km/hr.

The maximum successful speed achieved under the given S-curve test is 20.8 km/h. Result matches expectation.

d. Signals and code:

  1. motor module (figure 10):

we used the built-in Mapped Motor in Simulink to model the motor. Due to the lack of information on the actual motor used in the N7, we based our motor parameters on an output power of 1000W and a maximum output torque of 340Nm which similar vehicle modules have.

Figure 10. motor module & PID controller for torque input

Figure 10. motor module & PID controller for torque input

The inputs to the motor module are as follows:

· BattVolt (Battery voltage): 347.76V

· MtrSpd (Motor speed): Set to match the average speed of the front and rear wheels.

· TrqCmd (Torque command): The difference between the ideal speed and the actual speed, controlled by the PID controller.

2. suspension module (figure 11):

For the front wheels, we used the Independent Suspension — MacPherson model. However, since Simulink does not have a built-in multi-link suspension module and the geometry of multi-link suspensions is more complex, we substituted it with the Solid Axle Suspension — Coil Spring model for the rear wheels.

Figure 11. suspension module

Figure 11. suspension module

The inputs to the suspension module are as follows:

· WhlPz (Left and right wheel z-axis displacement): Since the test environment is flat, we assumed this to be 0.

· WhlRe (Left and right wheel equivalent radius): 0.35 m

· WhlVz (Left and right wheel z-axis velocity): Since the tires do not experience displacement along the z-axis, we assumed this to be 0.

· WhlFx (Left and right wheel longitudinal force): This value comes from the tire model’s output for the longitudinal force, Fx.

· WhlFy (Left and right wheel lateral force): Calculated by the LateralForce function, as shown in Figure 11.

· WhlM (Left and right wheel suspension torque): Calculated by the WheelMoment function, as shown in Figure 12.

· Vehp (Vehicle body absolute position): The absolute position output from the Vehicle Body module.

· VehV (Vehicle velocity): The vehicle body’s x and y velocity outputs.

· StrgAng (Steering angle): Calculated using the formula d=atan2(ωL,vx), where:

d = steering angle, ω (omega) = vehicle angular velocity, L = vehicle wheelbase, vx ​ = longitudinal velocity of the vehicle

3. Tire module (figure 12):

Lastly, the tire module. We used one wheel for both the front and rear wheel to simulate the wheels of N7 in our model. Since we are dealing with automation under low speed, we chose the Simulink build-in Longitudinal Wheel — No Break module in our model.

Figure 12. motor module & PID controller for torque input

Figure 12. motor module & PID controller for torque input

· AxlTrq (Wheel torque): This is the torque output from the Mapped Motor module, denoted as MtrTrq.

· Vx (Vehicle longitudinal velocity): This is the longitudinal speed of the vehicle, which comes from the Vehicle Body module’s output x˙\dot{x}x˙ (i.e., the vehicle’s x-axis velocity).

· Fz (Normal force on the tire): This force is derived from the suspension module’s output WhlF, which represents the total force acting on the wheel in the vertical direction.

4. Code:

Figure 13. lateral force calculation function

Figure 13. lateral force calculation function

3. Results — Camera group:

Worked on Object Detection, Depth sensing and validation (not involved)

Testing: video link

Object detection: video link

Carla simulation: video link

Achieved successful full automation in Carla simulation

4. Reference:

  1. MATLAB. Vehicle Dynamics Blockset. https://www.mathworks.com/products/vehicle-dynamics.html
  2. MATLAB. Drivetrain and Transmission. https://www.mathworks.com/help/autoblks/transmission-and-drivetrain.html?s_tid=CRUX_lftnav
  3. Luxgen. LUXGEN n⁷ 完整規配表. https://storage.luxgen-motor.com.tw/app/public/LUXGEN%20n%E2%81%B7%20%E5%AE%8C%E6%95%B4%E8%A6%8F%E9%85%8D%E8%A1%A8.pdf

메타데이터
post_id
d3c93fa1775d
slug
n7-low-speed-automation-design-and-practice-of-intelligent-vehicles-ii-d3c93fa1775d
url
https://medium.com/@P_35301/n7-low-speed-automation-design-and-practice-of-intelligent-vehicles-ii-d3c93fa1775d
canonical_url
https://medium.com/@P_35301/n7-low-speed-automation-design-and-practice-of-intelligent-vehicles-ii-d3c93fa1775d
author_url
https://medium.com/@P_35301
status
ok
fetched_at
2026-06-12 07:40:50