Design Seats Comfort System using Renesas Controller
Published: 2023-11-22 05:46:07

Hello Readers,
I'm Sana, and I'm a Junior Software Developer with Luxoft India. I'm happy to share this post, in which I relate my previous experience with Design Seats Comfort system using Renesas Controller.

**Introduction**
Here in this Article, we have designed the Seats comfort system in which seat comfort systems can adjust to the driver and passengers individual preferences. They can also adapt to different seasons.
Seats Comfort System heating and cooling solution is a complete system that provides a comfortable and personalized driving experience. This specification covers the functional requirements for the HR/PU single seat heater/ventilation ECU. Additionally, it will capture all the assumptions that are made to allow the project to proceed in a timely manner.

**Project Hardware Setup and Overview**

- *Micro Controller* :
Renesas MCU : RL78 / F12 series - R5F109GCC

- *Equipment Being Used in Project*:

The ECU will be connected to the following:

	1 - Power Supply 
	2 - Harness
	3 - Heater Mat PADs (Cush and Back)
	4 - Blower
	5 - Switch assemblies with led indicator
	6 - CRO

**Hardware Details**

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yyqu862wsx8441lbj2am.png)



![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fprdpowc584zg7jki4tg.png)

**Functional Block Diagram**

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/988him84zx5lqtl2wqc0.png)



**Device Driver(DD) Modules being used in this Project:**

- **Scheduler:** In this project, we have designed the scheduler to run at 10ms rate based on project requirement. Which allow the application to be process the data at each 10ms rate and provide 	   designed output. In order to achieve this goal, we have used Timer Channel-3 & Interrupt Channel-3 for design the scheduler.


- **Timer:** In this project, We have used Total 8 channel, 16bits Timer to achieve different different functionality as below :
 
Ch0 - Master of Heater @5Hz
Ch1- Heater Back - Slave
Ch2 - Heater Cushion - Slave
Ch3 - Scheduler
Ch4 - Master of Blower @20Khz
Ch5 - Blower Cushion - Slave
Ch6 - blower back - Slave
Ch7 - LIN

- **Interrupts :** Each Timers (T0 to T7) are generating interrupt (ISR0 to ISR7) respectively and used as per point no.3

- **PWM :** In this Project, We have designed PWM with Multi PWM (Pulse Width Modulation) Functionality to achieve Heater and Blower (Ventilation) Functionality per point no.3

- **Watchdog :** We have designed watchdog functionality to be serve at 3V per project requirement.

- **ADC :** In this Project, We have used 8 ADC Channel as below :

ANI7        NTC_CUSH_A2D       NTC_Cush_A2D
ANI6        uIGN1              IGN1 feedback
ANI5        uHEAT_LS_FB        Heat mode Low side current feedback
ANI4        VSP_BACK_A2D       Back Fan Speed Voltage Monitor
ANI3        VM_CURRENT_A2D     VM Current Monitor
ANI2        uIGN2              IGN2 feedback
ANI1        VSP_CUSH_A2D       Cushion Fan Speed Voltage Monitor
ANI0        uHEAT_CURRENT_A2D  Cush/Back Heat Mode Current Monitor

- **LIN :** LIN is nothing but Local Interconnect Network used for Communication between Master and Slave. We have designed very basic functionality of communication between Master and Slave.

**Operational Modes :**

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hu417hs0u37ygcj5mst2.png)

- OFF Mode:
In OFF State the  ECU will transition from the ON Mode to the OFF Mode
when IGN_VOLTAGE < 5-VDC

- ON Mode:
In ON State the ECU from the OFF Mode to the ON Mode 
when IGN_VOLTAGE > 5-VDC

- Normal Operation Mode :
It transits from IDLE to Normal Mode when 10-VDC IGN_VOLTAGE 15-VDC

- Heat Mode:
The ECU will transition from the IDLE Mode to HEAT Mode when Heat Mode Switch is pressed while ECU in Normal Operation Mode.
The ECU will transition from the VENT Mode to HEAT Mode when Heat Mode Switch is pressed while ECU in Normal Operation Mode.

- Vent (Blower) Mode:
The ECU will transition from the IDLE Mode to Vent Mode when Vent Mode Switch is pressed while ECU in Normal Operation Mode.
The ECU will transition from the HEAT Mode to VENT Mode when VENT Mode Switch is pressed while ECU in Normal Operation Mode.

- Degraded Mode :
It transits from NORMAL HEAT or VENT Mode state to the DEGRADED HEAT state when IGN_VOLTAGE < 8.5-VDC.
It transits from the NORMAL HEAT or VENT Mode state to the DEGRADED HEAT state when IGN_VOLTAGE > 16.5-VDC.

- Fault State:
The ECU shall disable HEATER or BLOWER Functionality within 10-msec transitioning to the FAULT state from Normal operation mode.
The ECU shall set HEAT_IND or VENT_IND to INACTIVE within 16-sec of transitioning to the FAULT state.

**- CS+ IDE Setup**

- CS + IDE : First Impression of CS + IDE - Its all about HOW CS+ IDE look like

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lbw3hkji0votin79a8uf.png)

- _Clock setting :_
Select the High-Speed Main Mode - 2.7 (V) < VDC < 5.5 (V) Volts, Threshold Voltage to 0.2 VDD and Set High-Speed Oscillator Clock to 32 MHz based on Project requirement.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i2vvn8tjhuli2ngsfow1.png)

**Note:**
Selection of High-Speed Main Mode Voltage and High-Speed Oscillator Clock setting depend on ECU Specification and watchdog requirement.
For more information, please read Renesas controller datasheet.



![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6en0n8nqi8okvt0y5upd.png)

Select Internal Low Speed Oscillator Clock to 15Khz and CPU and Peripheral Clock to 32Mhz on based on Project requirement.

- _Device setting should be done as mentioned below:_

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zls2akgascs5ulnsv5em.png)

**Note:**
Selection of Link option and Device Setting depend on project requirement. 
For more information, please read Renesas controller datasheet.

- _On chip debug mode should be enabled as below:_

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ujdcyjpvye99ytni5g8y.png)

Selection of  debugger depend on which debugger you have connected with Hardware. i.e. : E1 debugger , E2 or E2 Lite debugger

- _Reset resource should be enabled:_

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9oxs0qeqc85nrk6k008e.png)
**Note:**
Selection of Reset resource depend on project requirement. (i.e., software reset , hard Reset, watchdog reset), We have enabled in this project as we are using watchdog. 
For more information, please read Renesas controller datasheet

- _Voltage needs to be set to 5 Volts to enable the flashing through debugger_

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ottednzlj0niwvqahyft.png)

- **Selection of Debugger Tool:**
 Option to select debugger connected with Hardware

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zu1jqlv266ka88wsluce.png)

- **Selection of .abs File for Debugging :** 
For Renesas Controller, **.abs file** is debugger file to do debugging with existing code / build. Engineer used this file to keep the breakpoint and evaluate the result in watch window. 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fletj210vkbal4f2z10l.png)

- **Selection of .hex file for debugger :** For Renesas Controller, .hex file is executable file for Testing Purpose. Engineer used this file for Testing


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yx4jeekp4zd2qmmu22d5.png)

**Create Project:**
Once you open the CS+ IDE, You can see first impression of IDE as below, later select Project option and Create New Project

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vchiwbsoa4zrf2jvgmc8.png)

**Conclusion**
The Design Seats Comfort System using Renesas Controller project was a successful endeavor that resulted in a high-performance, cost-effective, and reliable seating system for automotive applications. The project team successfully integrated enabling advanced features such as personalized comfort settings, climate control, and massage functions. The system was designed to meet the stringent requirements of the automotive industry, including durability, safety, and electromagnetic compatibility (EMC).