For participants only. Not for public distribution.

Note #49
Speed server

John Nagle
Last revised October 27, 2004.

The speed server does engine, braking, and transmission management for the Overbot.


Messages understood by the SPEED server

The speed server, with ID SPEED, accepts the following message types, which are defined in "speedservermsg.h". A version of the speed server, written by Achut Reddy, already exists, but was written for the MicroMo controllers. It will be revised for the new controllers.

Message SPSS ("Set speed")

Specifies a speed and an acceleration. This is the main message to the speed server. An SPSS message shouild be sent to the speed server every 100ms. Failure to send one for 200ms will result in an emergency stop. Reply is with a speed state message. Names here are approximate; see the include file for the exact format.

speed float meters/sec
acceleration float meters/sec^2
gear enum desired gear
state enum desired state
fault enum desired fault code if nonzero


speed float actual meters/sec
acceleration float actual meters/sec^2
gear enum actual gear
state enum actual state
fault enum last fault code if nonzero
hint enum speed server suggestions to the move server


Speed states



Brakes Locked

parked Engine stopped, brakes locked. No No Yes No No Inactive
reset Engine stopped, brakes locked. No No Yes No No Reset controllers, then start
starting Cranking/warmup No Yes Yes Yes No Must be in neutral
startwait Starting failed, waiting No No Yes Yes No Try again after 30 seconds.
paused Engine running, brakes locked No Yes Yes Yes No Idle, in neutral
runwait 5-sec wait before move No Yes Yes Yes Yes Required by DARPA
idle Engine running, brakes locked No Yes Yes Yes Yes Idle, any gear
shifting Shifting in progress No Yes Yes Yes Yes The Polaris Ranger can only shift when stopped
run Run mode Yes Yes No Yes Yes Normal driving mode, forward or reverse.

From the move server's perspective, all the above states can be seen, but only parked, pause, idle, and run can be requested.

At power up, the state is parked. The move server should request paused to start the engine. The move server should then see the states progress from parked to reset to starting to paused, possibly with a detour through startwait if more than one start attempt is needed. The move server should just wait for paused.

To change gears, go to idle, and specify a new gear. The state will then progress from idle to shifting and back to idle, with the new gear set. It is then permissible to go to run, with the current gear specified. Trying to change gears without going through idle will cause a fault. Available gears are NEUTRAL, LOW6WD, LOW, HIGH, and REVERSE.

When ready to start motion from idle, request run, specifying a gear. Gear selection only matters for run. The state will then progress from idle to runwait to shifting to run. The move server should just wait for run. Note that there's a five second DARPA-required safety delay in runwait state, with the horn sounding but no vehicle movement.

If a pause signal is received, reduce speed to 0, then request paused. The move server must receive the DARPA pause signal and request paused. To come out of pause, request idle. The state will change to runwait for the required five second delay, then go to idle.

Sending a nonzero fault code will change the state to idle, if the previous state was run, or reset, if the previous state was not run. This is the proper way to force an emergency stop because of some problem of which the move server is aware. The brakes will slam on and the throttle will be cut to zero. We will have to define a set of fault codes and messages. Sending a nonzero fault code will result in a message being displayed in the LED sign.

Failure to send a message to the move server for 200ms will result in a fault. Making an invalid request will result in a fault.

After about ten minutes in paused,the state will change to parked, and the engine will stop, to save fuel.

Speed server state machine



The speed server provides some "hints" to the move server, indicating how things are going. These are

none No hint. Normal case.
suggest_upshift Current speed and RPM high enough for upshift to HIGH.
suggest_downshift Current speed and RPM low enough for downshift to LOW.
suggest_slowdown The speed server suggests slowing down. RPM too high for vehicle speed.
slipping Odometer and radar indicate slipping
  (others to be defined)

The general idea is that the move server, upon seeing a "hint", should gracefully take corrective action as indicated. This usually means finishing the current move, coming to a stop, requesting a gear change, and restarting. But because gear changing requires a stop, it's not worth doing unless you intend to spend some time in that gear.

Low gear is limited to about 17MPH. "LOW6WD" is low gear with six wheel drive engaged. Stay below 10MPH in that gear. On slippery or tilted surfaces, go to LOW6WD.