Polaris Ranger#
The Polaris model gives the Polaris Ranger CREW XP 1000 utility vehicle and its Dataspeed drive-by-wire. A program drives it with the same commands as the real vehicle: the messages of ds_dbw_msgs 2.3.11. The model gives the same reports as the real vehicle.
Source: Game/Source/Acres/AcresUtvModel.h and AcresUtvModel.cpp. The game and ACRES Core compile the same file. Parameters: Game/Content/Simulation/polaris.json. Each fitted value in that file has its provenance. The fit tools are in Tests/Game/Polaris.
Physics Step#
One physics step (1/120 s) calls the model in this sequence:
StepDbw(Dt, P, Command, S); // actuators, ULC, gear
StepUtvSteering(Dt, P, S); // road wheel angles
StepUtvPowertrain(Dt, P, S); // engine, CVT, clutch
for (int I = 0; I < 4; ++I)
PrepareUtvWheel(Dt, I, P, SurfaceUnderWheel[I], Samples[I], S);
SolveUtvDriveline(Dt, P, S); // wheel spins, engine speed, fuel, energy ledger
Then the caller applies the forces of the wheels to the chassis. The caller is AAcresVehiclePawn::AsyncPhysicsTickActor in the game and FAcresPolaris in ACRES Core.
Parts of the Model#
| Part | Model |
|---|---|
| Engine | ProStar 999 cc twin. A full-load and a motoring torque curve, blended by the torque request. An electronic-throttle lag, an idle governor, a rev limiter and a top-speed governor. No fuel on overrun. |
| CVT | A centrifugal primary clutch. Its capacity grows with the square of the engine speed above the engagement speed. The belt ratio settles where the forces of the primary and the secondary balance, between the low and the overdrive ratio. |
| Gearbox | P, R, N, H and L. Park locks the transmission output. |
| Drive modes | Turf (rear differential open, front off), 2WD (rear locked) and AWD. In AWD, the front drive engages when the rear wheels turn faster than the front ring gear. |
| Brakes | The hydraulic pressure multiplied by a torque gain for each axle. |
| Steering | The steering wheel angle divided by the steering ratio, with ideal Ackermann geometry on the front wheels. |
| Wheels | The contact model of the tractor: suspension, tire on soil and on hard ground, lateral slip (Tire and Soil). |
| Energy | The energy ledger and the Willans fuel map of AcresPowerModel.h. |
Drive-by-Wire#
The drive-by-wire layer turns the commands into actuator positions, as the firmware of the vehicle does.
| Subsystem | Model |
|---|---|
| Steering | A reference generator with rate and acceleration limits, a transport delay, a first-order servo and a slew limit. |
| Throttle | A pedal emulation with rate limits. |
| Brake | A delay, a build-up with rate and acceleration limits, and a release that depends on the pressure. |
| Gear | A shift takes a fixed time. The actuator accepts a shift only below a speed limit. |
| Timeouts | A subsystem disengages when no command arrived for 0.1 s. |
| ULC | The Universal Longitudinal Controller: a shaped speed reference, a launch offset, a PI throttle law, the brake allocation and a stop hold. |
The command modes of the steering are angle (2), curvature (3), yaw rate (4) and percent (14). A curvature command maps to a steering wheel angle:
\(i_k\) is dbw.steering.kinematic_ratio of polaris.json (the steering ratio when it is 0). \(L_k\) is dbw.steering.kinematic_wheelbase_m (the wheelbase when it is 0). A yaw-rate command uses \(\kappa = r / v\), with the speed floored at 0.5 m/s.
The ULC makes an acceleration demand from its reference and the measured speed:
The throttle law is: pedal = offset + \(k_a a_{ref}\) + \(k_v e\) + \(k_i \int e\,dt\). The proportional term fades in with the speed up to the launch speed. The demand selects the throttle above throttle_on_mps2 and the brake below brake_on_mps2.
Rules of the system enable (AcresPolaris.cpp, CoreSimDbw.cpp):
- The message
enableenables the system, anddisabledisables it (ACRES_DBW_ENABLED,ACRES_DBW_DISABLEDin the log). - A pedal key or a steering key while the system is enabled is an override. The game disables the system and writes
ACRES_DBW_OVERRIDE. The override flag stays in the reports until the nextenable. - When the bridge client disconnects, the game disables the system.
- A subsystem has drive-by-wire control only when three conditions are true. The system is enabled. The command has
enabletrue and a command type that is not 0. Its last message is 0.1 s old or less. A user throttle or brake command stops the ULC. - A session driver (a replay, a route review, a drive script) sends a steering angle and a ULC speed when the bridge does not command the subsystem.
- ACRES Core has no keyboard and no session driver. It starts with the lever in P. Enable the drive-by-wire and send a gear command before a speed command.
The bridge applies each command at the physics step that agrees with its arrival time (Time Stepping and Determinism).
Parameters#
These values are in Game/Content/Simulation/polaris.json.
| Key | Value |
|---|---|
geometry.wheelbase_m |
2.8702 m |
geometry.track_front_m, geometry.track_rear_m |
1.31 m |
mass.dry_kg |
1063 kg |
mass.occupant_kg, mass.occupants |
85 kg, 1 |
steering.ratio |
13.237 |
engine.idle_rpm |
1250 rpm |
engine.max_speed_mps |
27.7 m/s |
dbw.command_timeout_s |
0.1 s |
dbw.steering.delay_s, dbw.steering.tau_s, dbw.steering.slew_deg_s |
0.0205 s, 0.1323 s, 500 deg/s |
dbw.steering.lock_deg |
487 deg |
dbw.steering.max_curvature_per_m |
0.2 1/m |
dbw.steering.kinematic_ratio |
9.69 |
dbw.brake.max_bar, dbw.brake.delay_s |
80 bar, 0.0333 s |
dbw.gear.shift_s, dbw.gear.max_speed_mps |
1.0 s, 0.3 m/s |
dbw.ulc.kp |
1.0 1/s |
dbw.ulc.default_accel_mps2, dbw.ulc.default_decel_mps2 |
1.2 m/s², 1.5 m/s² |
dbw.ulc.throttle_offset_pct, dbw.ulc.throttle_accel_pct, dbw.ulc.throttle_speed_pct, dbw.ulc.throttle_integral_pct |
13.24, 0.706, 27.25, 5.83 |
dbw.ulc.launch_speed_mps |
0.5 m/s |
dbw.ulc.throttle_on_mps2, dbw.ulc.brake_on_mps2 |
0.35 m/s², -0.6 m/s² |
dbw.ulc.stop_speed_mps, dbw.ulc.stop_brake_pct |
0.1 m/s, 20 % |
Change a value for one session with -PolarisSet=key=value;key=value (the game), polaris_overrides (acres_core.Batch) or --polaris-set (core_sim).
Standstill Hold#
With a speed command of zero, the ULC applies the stop brake below dbw.ulc.stop_speed_mps. The brake demand also gets an integral of the speed that is left, so that the vehicle comes to rest on a slope (dbw.ulc.stop_integral_per_s).
Hardware Shifts#
A shift changes the calibrated vehicle for a robustness study. A shift is a bias of the speed sensor of the ULC, of the throttle or of the brake pressure. A shift can also move the steering center. All zero is the calibrated vehicle. Set a shift with the operation set_vehicle_shift of the control channel or the service /acres/set_vehicle_shift.
Limits#
- The chassis is one rigid body. Each corner has an independent suspension.
- The engine has no temperature state and no starter.
- The firmware defaults of the steering reference generator are not documented. The model uses the values that the planner of the vehicle sent.