Project 1 - Wiper control system and Vehicle speed calculation for ABS using Wheel Speed sensor
- Wiper control system
Develop Simulink/state flow model for wiper control system based on the given conditions.
Description of Challenge:
- If the density of the rain is low, then wiper rotates with low speed & the output signal should be 100rpm
- If the density of the rain is medium, then wiper rotates with medium speed & the output signal should be 200rpm
- If the density of the rain is high, then wiper rotates with high speed & the output signal should be 500rpm
Note: Rain density input comes from the external sensor, for the simulation purpose constant block with knob can be taken
Ans.
Fixed Point


Simulink Design Verifier

JMAAB Compliances


MIL

SIL

Requirement Tagging

Back to Back Testing

Baseline Testing

#include "question1.h"
#include "question1_private.h"
/* External inputs (root inport signals with default storage) */
ExtU_question1_T question1_U;
/* External outputs (root outports fed by signals with default storage) */
ExtY_question1_T question1_Y;
/* Real-time model */
static RT_MODEL_question1_T question1_M_;
RT_MODEL_question1_T *const question1_M = &question1_M_;
/* Model step function */
void question1_step(void)
{
/* Outputs for Atomic SubSystem: '<Root>/Subsystem' */
/* MultiPortSwitch: '<S1>/Multiport Switch' incorporates:
* Gain: '<S1>/Gain'
* Gain: '<S1>/Gain1'
* Inport: '<Root>/Rain_Density'
* Logic: '<S1>/Logical Operator'
* RelationalOperator: '<S1>/Relational Operator'
* RelationalOperator: '<S1>/Relational Operator1'
* RelationalOperator: '<S1>/Relational Operator2'
* RelationalOperator: '<S1>/Relational Operator3'
* Sum: '<S1>/Sum'
*/
if ((int32_T)((uint32_T)(uint16_T)((uint16_T)(((((question1_U.Rain_Density >=
496) && (question1_U.Rain_Density <= 1120)) << 5) +
((question1_U.Rain_Density <= 480) << 4)) + (question1_U.Rain_Density >=
1136 ? 48 : 0)) << 11) >> 15) == 1) {
/* Outport: '<Root>/wiper_speed' incorporates:
* Constant: '<S1>/Wiper_Speed_Low_Density_Rain'
*/
question1_Y.wiper_speed = 51200U;
} else {
/* Outport: '<Root>/wiper_speed' incorporates:
* Constant: '<S1>/Wiper_Speed_High_Density_Rain'
*/
question1_Y.wiper_speed = 59392U;
}
/* End of MultiPortSwitch: '<S1>/Multiport Switch' */
/* End of Outputs for SubSystem: '<Root>/Subsystem' */
}
/* Model initialize function */
void question1_initialize(void)
{
/* (no initialization code required) */
}
/* Model terminate function */
void question1_terminate(void)
{
/* (no terminate code required) */
}
/*
* File trailer for generated code.
*
* [EOF]
*/