Control

From Trevipedia

Jump to: navigation, search

Contents

Driver controls

The driver controls are:

  • power switch: Off / Accessories / On
  • direction selector: Forwards / Off / Reverse
  • accelerator pedal (5 kOhm resistor)
  • brake pedal (5 kOhm resistor)
  • left indicator (momentary push button on steering wheel)
  • right indicator (momentary push button on steering wheel)
  • horn (momentary push button on steering wheel)
  • hazard lights switch
  • position lights / dipped-beam / main-beam switch on dash
  • windscreen cleaning controls

The power switch is wired directly to the 12 V battery. The remaining controls are wired to a driver controls box in the cab, which transmits commands to other parts of the car using a CAN bus.

Direction, accelerator pedal postion and brake pedal postion are polled every 100 ms. The driver control box calculates the required direction, maximum speed and maximum torque, and sends these to the motor controller on the CAN bus. (If the motor controller does not receive these values for, say, 200 ms then the maximum torque is set to zero.)

When the car is started, the maximum torque should be held at zero until the accelerator has been fully released and the direction selector is in the OFF position.

Other button and switch positions are transmitted only when they change.


CAN bus

Trev uses a CAN bus to send control and data messages between subsystems.

The hazard lights must operate even when the power switch is off, so should be wired directly to the 12 V battery. Diodes (or something) will allow the indicator lamps to be operated by either the hazard circuit or from the lighting controller.

A CAN message has:

  • an 11-bit message ID
  • a message length (0-8 bytes)
  • up to eight data bytes.

The messages used by Team Trev are listed below. (Explanations to be added.)


Motor control messages

  • 010 1 v: set the maximum speed to v (signed) in km/h; negative values indicate reverse
  • 011 1 t: set the desired torque to t (signed) percent of the maximum torque; negative values indicate regenerative braking
  • 012 1 v: actual speed is v (signed) km/h
  • 013 1 i: motor winding current is i (unsigned) percent of maximum allowable current
  • 014 1 i: DC link current is i (signed) amperes
  • 015 1 t: motor temperature is t (signed) degrees Celcius
  • 016 1 t: motor controller temperature is t (signed) degrees Celcius
  • 017 1 s: motor controller status is s (bitfield)
  • 01e 1 d: PWM duty cycle is d (unsigned)
  • 01f 1 n: number of Hall faults since last report is n (unsigned)

Driver controls

  • 070 0: turn left indicators on
  • 071 0: turn right indicators on
  • 072 0: turn indicators off
  • 073 0: turn horn on
  • 074 0: turn horn off
  • 075 0: turn high beam on
  • 076 0: turn high beam off
  • 077 0: turn head lights off
  • 078 0: turn parking lights on
  • 079 0: turn head lights on
  • 07a 0: turn brake lights on
  • 07b 0: turn brake lights off
  • 07c 0: turn reversing lamps on
  • 07d 0: turn reversing lamps off
  • 080 0: change dash mode
  • 081 0: handbrake is on
  • 082 0: handbrake is off
  • 085 0: reset trip meter
  • 086 0: Trev is plugged in
  • 087 0: Trev is unplugged


Battery management system

The BMS messages are defined by the Elithion BMS

Personal tools