In any vehicle, the instrument cluster forms a critical part as it is the face of the vehicle that reflects the current state. Apart from providing the basic vehicle information, it can also provide crucial indications of electrical component malfunctions (EFI /ISG related). Clusters can acquire vehicle data over simple mechanisms such as encoders as well as through complex interfaces such as CAN, SAEJ1850 etc.,

Instrument cluster design for electric vehicles may have less system complexity, but they have to be more user friendly, less power hungry, and a cost-effective solution. Careful design and choice of cluster components is necessary to meet the stringent compliance requirements. Of the constituent components, the MCU holds the major stock whereas only a few vendors will be supporting automotive grade with the desired feature sets.

Renesas RL78 is an ultra-low power microcontroller (MCU) that enables customers to build compact, energy efficient instrument clusters for a wide range of two-wheeler and four-wheeler vehicles. It offers highly suitable peripheral interfaces such as: Three Channels of Stepper Motor Controller, LCD controller, Multiple IOs etc.,

In this blog, we will discuss in detail about the various features of an instrument cluster and how RL78 MCU will help simplify the design.

Instrument Cluster Subsystem

The major components and their functionalities are as follows:

  • Gauges: Generally, three gauges namely RPM, Temperature and Fuel Level get indicated by the cluster.
    • Fuel Gauge: The Fuel gauge ranges from Empty (E) to Full (F). Typically, the Fuel sensor unit is a TSR /SMR type realized with components such as float with potentiometer, Adjustable arm and sending unit with two wires (signal & ground wire). The signal received from the fuel sensor is analog. The pointer position depends upon the incoming resistance value and indicates the vehicle’s fuel level.
    • RPM Gauge: The signal received from the RPM sensor from encoder such as tach terminal unit with signal & ground wire, fire wall grommets is treated as frequency input. Based on the type and top speed of the vehicle, the input range varies.
    • Temperature Gauge: The signal received from the temperature sensor is also analog. Realized with sensors such as protective rubber unit, thermistor with two wire. Front end circuit converts the input resistance to corresponding voltage and thereby the voltage value at the microcontroller input indicates the current engine temperature.
    • Seven Segment Displays: Clusters may have different type of segmented display with various resolutions such as 27 X 4, 39 X 4, 48 X 4, 53 X 4 and 54 X 4. These could indicate information such as odometer, trip distance, hour meter etc.,
    • Telltales: Telltales are sort of regulatory indications typically realized with LEDS required to show the state of various components such as low battery, engine faults, high beam etc. They are usually realized via onboard LEDs with mechanical light guide. Graphical overlays will also be placed over the guides with standard Tell tale signs.
    • Switches: Usually a single switch or simple rotatable push-type switches are available to manipulate the information shown in the display such as Trip distance, Time etc.

There could be variations in the offerings and feature set based on the vehicle manufacturer.

RENESAS RL78 for Cluster:

Renesas is a leading semi-conductor company in the automotive space offering cluster solutions for many decades. While there are some architectural differences between all the MCU’s of the Renesas RL78 family, the sub-system remains more or less the same. The high-level design of the RL78 MCU based instrument cluster is captured below:

Instrument Cluster - Block Diagram
Instrument Cluster – Block Diagram

RL78 series of MCU’s help realize vehicle clusters effectively with its feature rich peripherals set:

Microcontroller: The RL78 MCU helps in achieving the highest performance within the low end MCU space. It offers improved efficiency, extensive scalability and reliable safety functions that aid in developing energy efficient instrument clusters. It has an operating voltage that ranges from 2.7V to 5.5V and flashes the program using 80 microcontroller pins.

Stepper Motor Drivers: There are up to three channels of stepper motor controllers / drivers with zero-point detection that can be configured using PORT pins (Sin+, Sin-, Cos+, Cos-). Each channel is controlling a stepper motor dedicated to gauges which commands the motor to move and hold at one of the angles without any position sensor. With the help of software based PID control, it is possible to effectively control the needles.

Segment LCD Controller: Capable of driving up to 200+ segments, the in-built LCD controller is available for controlling the segmented display with various resolutions such as 27 X 4, 39 X 4, 48 X 4, 53 X 4 and 54 X 4 which is directly driven from the RL78 microcontroller. The LCD screen can be controlled by the software to display any kind of data dynamically such as TRPI information, hour meter data etc.

Multiple IOs: There are multiple analogs and digital IOs available for interfacing sensors and Tell-Tale LEDs. RPM, temperature, and fuel level sensors are interfaced via a suitable front-end circuit. If needed, various Tell-Tale LEDs such as turn left, turn right, service, brake, etc. can be driven with dedicated digital outputs.

  • Analog Input Gauges: RL78 series comes with a rich set of ADC inputs that can be used to convert resistance/voltage-based sensor inputs to digital values. Software based processing will increase the accuracy of the acquired value.
  • Encoder inputs: With up to 24 timers, RL78 can be used to measure a variety of encoder inputs such as RPM, perform custom processing and obtain accurate digital values.
  • External connectivity: RL78 can also support I2C/SPI interfaces that can be used to communicate with peripherals such as EEPROM where the accumulated vehicle information such as ODO, TRIP data can be stored. RTC can be interfaces to track real time.  

Variants of RL78 also offers sound generator which can set a volume level and tone frequency, two channels of CAN, and expanded flash memory/RAM up to a maximum of 512 KB/24 KB, suitable for low-end instrument cluster applications.

Embien’s Expertise in the Automotive Industry:

Embien Technologies is a leading embedded systems development company that specializes in high – tech product engineering services. We help clients take competitive lead in their markets. With a unique mix of innovation, technology, and quality, we offer cutting-edge automotive electronics system designs by adapting the latest technologies in clusters, diagnostics, infotainment, connectivity etc., With deep domain expertise, we have assisted several OEMs, Tier 1, and Tier 2 vendors to surge their automotive electronics such as Instrument Clusters (Heavy & Light- Duty Vehicles), Digital Cockpits etc., by integrating sensors & radars, network connectivity, path planning & mapping technologies. Do you have a design idea in mind? Then, get in touch with us today!

In the last blog, we have covered the basics of CAN communication. Now, we will see about some of the advanced concepts involved such as Bit Stuffing, frame types, error types, Synchronization etc. We will also look into some of the non-standard extensions available in modern CAN controllers.

Generally, all CAN modules support the classical CAN protocol. It can receive and transmit both CAN base and the CAN extended frames. The transmission and reception of CAN FD frames is optional. Classical CAN Implementation do not support 29-bit identifiers. CAN 2.0B passive nodes were compliant with ISO 11898-1:2003, but it used very rarely. In this context, let us explore some of other concepts in detail.

Bit Stuffing

Bit Stuffing is used to ensure the synchronization of all nodes even when transmitting consecutive information with same value either 1 or 0.
During the transmission of message, a maximum of five consecutive bits may have the same polarity. In this case, the transmitter will insert the one additional bit of opposite polarity into the bit stream before transmitting the further bits. This will ensure that there is always some activity in the bus with in 6-bit intervals and hence avoid DC Voltage build up as well as being in sync with the transmitter.

Stuffing and De-stuffing

Stuffing and De-stuffing

On the receiving end, similarly the receiver also checks the number of bits of same polarity and removes the stuffed bits again from the bit stream in a process called de-stuffing.

CAN Frame Types

There are 5 types of frames in CAN protocol;

Data Frame (DF):

Carries Data from transmitting node to receiving node.

Remote Frame (RF):

Some times, a node might want to request some data from another which is made possible by Remote frame.
There are two differences between data and Remote frames.
RTR field of a data frame is dominant and RTR field of remote frame is recessive.
In data frame format data field is present, whereas in Remote frame format data field is absent.

The receiver will understand that transmitter is requesting some date and then prepares and sends the Data frame based on the protocol.

Error Frame (EF):

This type of frame is transmitted by any node to signal error.
The error frame consists of two different fields in CAN.
superposition of ERROR FLAGS (6–12 dominant/recessive bits)
ERROR DELIMITER (8 recessive bits).
There are two types of error flags:

Active Error Flag

When the Transmitting node transmitted six dominant bits, the error will be detected in network and the error sate called active error flag.

Passive Error Flag

When the Transmitting node transmitted six recessive bits, the error will be detected in network and the error sate called passive error flag.

Active and Passive Error Frames

Now let us see, how the CAN manages error states. In every CAN node, there are 2 error counters – Transmit Error Counter (TEC) and Receive Error Counter (REC). When the transmitter detects an error in the transmitted frame, it increments the TEC by 8. A receiver detecting an error will increment its REC by 1. On successful transmission/reception the error counters are reduced by 1.
Based on the error counts, the node behavior varies.

  • By default, the Active Error frame will be transmitted on the bus, when TEC and REC < 128. Thus, it will invalidate the frame globally.
  • But when 127 < TEC \ REC > 255, the passive Error frame will be transmitted on the bus, without affecting the bus traffic.
  • Finally, the node enters into the Bus off state, when TEC > 255. If node enters into the bus off state then no frames will be transmitted.

In any case, both transmitter and receiver reject the erroneous frames completely and do not process it any further.

Overload Frame (OF):

Overload frame contains two fields such as Overload flag and Overload Delimiter.
The over load frame will be generated, when the receiving node is overloaded – i.e. it is not able to detect and receive the incoming messages. The format is very similar to Error Frame but without the error counters incrementing. An Overload frame indicates that its transmitter require delay before receiving next data or remote frame and is mostly not used in modern CAN controllers.

Inter Frame Space (IFS):

Data frames and remote frames are separated from preceding frames and succeeding frame by a bit field called interframe space. It consists of three consecutive recessive bits. Following that, if a dominant bit is detected, it will be regarded as the “Start of frame” bit of the next frame.

Frame on CAN Bus

Frame on CAN BUS

Error Types

There are 5 types of error in CAN protocol.

Bit error:

Every node reads back, bit by bit from the bus during transmitting the message and then compares the transmitted bit value with received bit value. If bit received does not match with bit sent, then Bit error is said to be occurred.

Stuff error:

Set when more than five consecutive bits of same polarity are received in receiving node.

CRC error:

A transmitted always transmits the CRC value in the CRC field of CAN frame. The receiving node also calculates the CRC value using same formula and compares with received CRC value. If receiving node detects mismatch between calculated CRC values and received CRC value then it is called CRC error.

ACK error:

Occurs when no acknowledgment is sent by receiving node or no acknowledgment received in transmitting node.

Form error:

Set when fixed format fields in receive frame is violated. No dominant bits are allowed in CRC delimiter, ACK delimiter, EOF and IFS.

Synchronization and Re-synchronization

As there is no separate clock signal on the CAN bus, the node itself need to synchronize on the bus. For that reason, the underlying transmission format is NRZ-5 coding.
When the transmitting node sends CAN frame it consists the first bit of SOF (start of frame). All the receivers align themselves to this falling edge (recessive to dominant) after the period of bus idle. This mechanism is called hard synchronization.
After subsequent falling edges on the CAN frame are used to re-synchronize the nodes on bus and it is called soft synchronization. This resynchronization happens continuously at every falling edge (recessive to dominant transition) to ensure transmitting and receiving nodes stay in sync.

Additional functions

Some CAN protocol implementations offer optional functions that may or may not be a part of CAN specification. These include, for example, the single-shot transmission of data frames. This means that the automatic re-transmission in case of detected errors is disabled. This is useful for TTCAN add-ons and some tool applications.
Another option generally available is the bus-monitoring mode. The node can receive data and remote frames, but doesn’t acknowledge them and also doesn’t send error and overload flags. Nevertheless, these dominant bits are communicated internally in the CAN module.
In another optional restricted operation mode, the CAN module behaves equally, but it acknowledges received data and remote frames. The error counters are not incremented and decremented in this mode. If a node is the TTCAN time master, it must be able to transmit the time-reference message; other frames must not be transmitted.
For some applications, message time stamping is required. ISO 11898-1:2015 specifies that the optional time-stamp function features resolutions of 8-bit, 16-bit, or 32-bit. The time-base value is captured at the reference point of each data frame and it is readable after EOF (end-of-frame). Other (not standardized) optional functions include readable error counters, configurable warning limits, interrupt request generation, and arbitration lost capture.
If the CAN implementation allows changing the configuration of a node by software, the configuration data (e.g. bit-time configuration or operating mode) needs to be locked against changes while CAN communication is ongoing.

Armed with details of CAN communication, we will now attempt to understand general configuration of a CAN node for transmission and reception with examples from a real controller.

About Embien

Embien Technologies is a leading provider of product engineering services for the Automotive, Semi-conductor, Industrial, Consumer and Health Care segments. Working with OEMs in Industrial segments, we have developed numerous gateways, sensory modes on top of CAN network and protocols such as DeviceNet, CANOpen etc. Our Automotive experience enabled us develop Telematic units and In-vehicle Infotainment systems, Instrument clusters with CAN interfaces.

Dhananjayan
31. May 2018 · Write a comment · Categories: Embedded Hardware · Tags:

This blog is the sequel of the previous blog on Geo positioning system technologies. Here we will discuss more in detail about the important terms related to GPS receivers and guidelines for selecting suitable GPS receiver module for embedded system design.

GPS Receiver

Connection diagram for GPS module

 GPS Module – Connection Diagram

The above picture depicts the typical connection diagram of GPS module with any host controller. There are multiple interface options available for a host controller to receive the NMEA data where UART, SPI and USB are most common. PPS signal is an output from GPS and it is discussed in detail in the upcoming sections. Most of the GPS modules have internal patch antenna but also supports external active antenna connection.

NMEA Data

 NMEA (National Marine Electronics Association) data is the detailed output from any GPS receiver that includes the current location data of the receiver such as Latitude, longitude, altitude etc. This data is provided in a standard format to the user for compatibility with various manufacturers much like ASCII standard for digital computer characters.

Following is the example of a NMEA message from a GPS receiver –

$GPGGA,181908.00,3004.6040718,N,07040.3900269,W,4,13,1.00,408.135,M,29.200,M,0.10,0000*40

All the NMEA message starts with a $ character where each field is separated by a comma.

“GP” in GPGGA – represent that it is a GPS position. For GLONASS, it will be GL instead of GP.

GPGGA is a basic GPS NMEA message and many other NMEA messages are also available providing similar or additional information beside GPS coordinates. There are 19 different NMEA messages and they are listed below:

  1. $GPBOD – Bearing, origin to destination
  2. $GPBWC – Bearing and distance to waypoint, great circle
  3. $GPGGA – Global Positioning System Fix Data
  4. $GPGLL – Geographic position, latitude / longitude
  5. $GPGSA – GPS DOP and active satellites
  6. $GPGSV – GPS Satellites in view
  7. $GPHDT – Heading, True
  8. $GPR00 – List of waypoints in currently active route
  9. $GPRMA – Recommended minimum specific Loran-C data
  10. $GPRMB – Recommended minimum navigation info
  11. $GPRMC – Recommended minimum specific GPS/Transit data
  12. $GPRTE – Routes
  13. $GPTRF – Transit Fix Data
  14. $GPSTN – Multiple Data ID
  15. $GPVBW – Dual Ground / Water Speed
  16. $GPVTG – Track made good and ground speed
  17. $GPWPL – Waypoint location
  18. $GPXTE – Cross-track error, Measured
  19. $GPZDA – Date & Time

181908.00 UTC Time stamp in hours, minutes and seconds.

3004.6040718 Latitude in DDMM.MMMMM format. Decimal places are variable.

N North latitude

07040.3900269 Longitude in DDMM.MMMMM format. Decimal places are variable.

W West Longitude

4 Quality Indicator. Other options are as follows,

0 = Fix not valid

1 = Uncorrected coordinate

2 = Differentially correct coordinate (e.g., WAAS, DGPS)

4 = RTK Fix coordinate (centimeter precision)

5 = RTK Float (decimeter precision)

13 Number of satellites used in the coordinate

1.00 denotes the HDOP (horizontal dilution of precision).

408.135 Altitude of the antenna

M unit of altitude (e.g. Meter or Feet) and Unit of geoidal separation

29.200 geoidal separation. Subtracting this from the altitude of the antenna will provide the Height Above Ellipsoid (HAE)

0.10 age of correction

0000 correction station ID

*40 checksum

Time-To-First-Fix (TTFF)

 Another most important deciding feature of GPS receiver is the TTFF. TTFF of a receiver only decides how fast it can provide a valid NMEA data to the user. So the user must be very careful on the TTFF values while choosing the receiver. The TTFF values will be provided in the datasheet in seconds.

Any receiver can boot up in any one of the following three modes:

  1. Hot start
  2. Warm start
  3. Cold Start

The Time-To-First-Fix (TTFF) depends on the startup mode, with cold starts giving the longest TTFF. Following are the factoring affecting boot mode:

  1. Non availability of valid almanac and ephemeris data
  2. Level of incoming signals
  3. The unit is within 60 miles (100 Km) of location of previous fix
  4. Length of time since previous fix

Cold Start Mode

Any receiver start in this mode when,

  1. Receiver has not been used for long time
  2. Moved several hundred kilometers
  3. Incoming signals are low or marginal. i.e. the predicted satellites are overhead of the receiver but cannot receive signals due to tall buildings, foliage etc.

Any of the above situation will make the receiver cannot predict which satellites are overhead. Then the receiver works with an internal list of satellites and tries to acquire each one in turn. This allows the receiver to discover the satellite which are in view and eventually establish a position. Normally the TTFF on cold start takes 2 to 4 minutes.

Warm Start Mode

Any receiver start in this mode when,

  1. It has valid almanac data
  2. The current location of receiver is within hundred kilometers of the last fix location
  3. Receiver has been active in last three days and current time is known
  4. Ephemeris data that has not been stored or it has become stale
  5. Good signal strength and 4 or more satellites are visible

In this mode the receiver can predict which satellites are overhead but it needs to download the current Ephemeris data. TTFF for warm start mode is typically 45 seconds.

Hot Start Mode:

The receiver starts in this mode when the warm start conditions are met and,

  1. A fix has been established within the last 2 hours
  2. The receiver has stored valid ephemeris data for atleast 5 satellites

Receiver tracks the overhead satellites and needs to download minimum data to establish a position. TTFF for a hot start is typically 22 seconds. 

A-GPS

We have come across many startup modes for any receiver, but wonder how smartphone GPS units get a fix almost immediately?

They use Assisted-GPS (A-GPS) as a procedure of improving the TTFF or even allowing a fix in conditions where receiver might not be able to function.

A-GPS device will use a data connection available on the smartphone to contact an assistance server. This server will supply almanac and ephemeris data instead of waiting to receive them from the satellites. The server can also provide approximate location derived from the cell phone towers facilitating immediate fix.

PPS Signal

Most GPS receiver modules have an output called Pulse Per Second abbreviated as PPS. It is a digital output signal with much lower jitter than anything a MCU can do. PPS signal can be used to time things very accurately at a precision in nanoseconds.

They are most commonly used to wake the MCU from deep sleep mode periodically at an interval of one second. In some applications, they are used to synchronize the system time and rectify the time drift due to the temperature effects of the RTC crystals. 

Selection Guide for Receiver

There is lot of options available while selecting a receiver module. Some of the main factors to be considered while selecting the receiver are as follows,

  1. Multi System Support – Receiver module can be GNSS or GPS only. GNSS module provides simultaneous support to GPS, GLONASS, BeiDuo and Galileo systems. GNSS modules are better than GPS only modules and the cost of the GNSS module will be bit more comparative to the other.
  2. Size – Most important deciding factor for size constraint devices. Nowadays modules are getting very small but in general the antenna will also shrink to fit the module which will reflect in the lock time and accuracy.
  3. Number of channels – At a given time, there are so many satellites available in view but the number of channels a receiver module can track/acquire will affect the TTFF. The more a module can track/acquire many satellites, the faster it will find a fix.
  4. Update Rate – It is the time interval that how often a receiver module can recalculate and reports its position. The standard rate of a module is 1Hz (one report per second). Fast update rate means that there are more NMEA sentences coming out of the receiver module by which any microprocessor will be quickly overwhelmed trying to parse that much data.
  5. Power Consumption – Another important factor that decides the success of a battery powered devices. There are many factors deciding the power consumption of a receiver module and in any case the typical power consumption should be low in few tenses of mA ranging between 25 to 30mA. Most of the receivers have various power saving modes which can be used during idle conditions.
  6. Antenna – Antenna defines the quality of the receiver module and it must be finely trimmed good enough to pick up the frequencies. Receiver modules available with a small patch antenna on top of it. It is made of ceramic. Some modules will also have dedicated antenna pin for connecting external active antenna. Receivers used in cars require external antenna support since the receiver module has to be placed inside the vehicle mostly connected to the OBD port which will be placed beneath the dashboard where a patch antenna will struggle to receive the signals.
  7. Accuracy – Varies between modules. Most modules can get it down to +/- 3m and sub meter or centimeter accuracy are also available but bit expensive.

About Embien

Embien Technologies is a product engineering service provider with handsome experience on automotive product developments. Embien has various solutions for time to market developments for automotive domain including Sparklet Embedded GUI library for 2D or 2.5D or 3D Instrument clusters, Flint IDE for GUI prototyping and eStorm-B1 – Automotive grade BLE Module.