Skip to content

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#

Driveline of the Polaris: the pedal sets the engine torque, the engine drives the primary clutch, the CVT belt and the gear lever, the rear axle and the front demand drive turn the wheels, and the steering and the disc brakes act on the wheels. Driveline of the Polaris COMMANDS TORQUE PATH Pedal driver or pedal emulation Engine ProStar 999 cc, 84.1 N m, 61.1 kW Primary clutch centrifugal, grips at 1600 to 2600 rpm CVT belt ratio 3.43 to 0.68, shift lag 0.3 s Gear lever P R N H L, L 28.84, H 13.01 Engine braking passes back through the clutch, 60 N m maximum. Front demand drive AWD only, ring at 0.926 of rear speed Rear axle AWD, 2WD: locked, Turf: open front prop shaft Steering wheel driver or steering servo Steering ratio 13.24, ideal Ackermann Front wheels 27 x 9-14, 124 kPa Rear wheels 27 x 11-14, 138 kPa overrunning clutches Brake pressure driver or brake actuator Disc brakes front 19.3 N m/bar, rear 10.5 N m/bar line pressure brake torque One solve for each physics step finds the carrier speed, the wheel speeds, the clutch torque and the engine speed.
The torque path of the Polaris from the pedal to the wheels, with the steering and the brakes. The values are those of polaris.json. Open the diagram
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:

\[ \theta_{sw} = i_k \arctan(\kappa L_k) \]

\(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:

\[ a_d = a_{ref} + K_p (v_{ref} - v_{meas}) \]

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.

Drive-by-wire command path: a ROS 2 command becomes a line on the vehicle bridge, the receiver thread stamps its arrival, the command clock gives it a solver time, the command queue holds it until the matching physics step, the watchdog examines its age, the actuators and the ULC move the vehicle model, and the reports go out at 50 Hz. The real vehicle has the same commands and reports. Drive-by-wire command path SIMULATOR: A COMMAND ARRIVES ROS 2 command /vehicle/*/cmd ds_dbw_msgs ROS 2 bridge sim_bridge one line for each Vehicle bridge -RlPort= JSON lines, TCP Receiver thread 1000 reads each second, arrival time Command clock arrival time to solver time EACH PHYSICS STEP, 1/120 S Driver keyboard, replay, drive script Watchdog command age: 0.1 s maximum Enable, override system enable, fresh flags Take the snapshots that are due at this step Command queue inbox snapshots, each with its time Drive-by-wire actuators StepDbw Steering servo ULC Gear actuator Pedal emulation Brake pressure commands that are fresh without DBW control Vehicle model engine, CVT, wheels, chassis Reports, 50 Hz dbw_report /vehicle/*/report wheel speeds for the ULC REAL VEHICLE: THE SAME COMMANDS AND REPORTS ROS 2 command /vehicle/*/cmd the same topics Dataspeed gateway commands on the CAN bus DBW firmware timeout, actuators, ULC Polaris Ranger steering column, pedal, brake Reports, 50 Hz /vehicle/*/report the same topics
From a message of the bridge to the actuators. Open the diagram
ULC speed loop: the reference generator shapes the speed command, the error between the reference and the wheel speed gives an acceleration demand, the pedal selection chooses the throttle law, the brake pressure law or the stop hold, and the outputs go to the pedal emulation and the brake actuator of the vehicle. ULC speed loop ULC command signed speed, limits Reference speed reference, jerk limited Σ + − Demand accel reference plus gain × error Pedal selection throttle above 0.35, brake below −0.30 error demand accel reference Throttle law offset, accel term, error and integral Brake pressure law mass estimate × demand Stop hold 16 bar below 0.1 m/s throttle brake standstill Pedal emulation throttle pedal, percent Brake actuator line pressure, bar delay 0.03 s delay 0.03 s Vehicle model engine, CVT, driveline, brakes and wheels in the engaged gear Wheel speed mean of 4 wheels × scale 1.042 measured speed The loop uses speeds along the direction of the engaged gear. A user throttle command or a user brake command stops the ULC.
The shaped speed reference, the PI throttle law and the brake allocation. Open the diagram

Rules of the system enable (AcresPolaris.cpp, CoreSimDbw.cpp):

  • The message enable enables the system, and disable disables it (ACRES_DBW_ENABLED, ACRES_DBW_DISABLED in 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 next enable.
  • 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 enable true 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.