Project 1 - Wiper control system and Vehicle speed calculation for ABS using Wheel Speed sensor
Q1)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
Model-


SLDD-


Requirement Tagging-

Requirement group is created in the requirement manager and 3 reqiurements are linked to the states of the stateflow diagram.

Find the requirement tagging report in the attachments
JMAAB Report-

Find the detailed JMAAB report in the attachements.
Fixed point Tool-
Old SLDD-


New SLDD with fixed point conversion-


SLDV Design error detection-

Coclusion-
There was not any dead logic or falsified condition in the simulink model as per the design error detection report.
Find the SLDV design error detection report in the attachements.
SLDV Test generation-

Find the SLDV test generation report in the attachements.
Functional Testing-
Test Cases-

MIL Harness-

MIL Test Output-

As seen from the data inspector expected output and actual model output is matching at every time instant.
SIL Test Harness-

SIL Test Output-

As seen from the data inspector expected output and actual model output is matching at every time instant.
Auto code genration-
Wiper_Control_SWC.c-
/* * File: Wiper_Control_SWC.c * * Code generated for Simulink model 'Wiper_Control_SWC'. * * Model version : 1.43 * Simulink Coder version : 9.3 (R2020a) 18-Nov-2019 * C/C++ source code generated on : Wed Sep 21 00:46:14 2022 * * Target selection: ert.tlc * Embedded hardware selection: Intel->x86-64 (Windows64) * Code generation objectives: Unspecified * Validation result: Not run */ #include "Wiper_Control_SWC.h" #include "Wiper_Control_SWC_private.h" /* Named constants for Chart: '/Wiper_Control_Logic' */ /* Block states (default storage) */ /* External outputs (root outports fed by signals with default storage) */ /* Real-time model */ /* Model step function */ { /* Outputs for Atomic SubSystem: '/Wiper_Control' */ /* Chart: '/Wiper_Control_Logic' incorporates: * Inport: '/Rain_Input' */ /* Outport: '/Wiper_Output' */ } else { /* Outport: '/Wiper_Output' */ /* Outport: '/Wiper_Output' */ } else { /* Outport: '/Wiper_Output' */ } } break; /* Outport: '/Wiper_Output' */ /* Outport: '/Wiper_Output' */ } else { /* Outport: '/Wiper_Output' */ } } break; /* Outport: '/Wiper_Output' */ /* Outport: '/Wiper_Output' */ } else { /* Outport: '/Wiper_Output' */ } } break; /* case IN_Medium_Rain: */ /* Outport: '/Wiper_Output' */ /* Outport: '/Wiper_Output' */ } else { /* Outport: '/Wiper_Output' */ } } break; } } /* End of Chart: '/Wiper_Control_Logic' */ /* End of Outputs for SubSystem: '/Wiper_Control' */ } /* Model initialize function */ { /* SystemInitialize for Atomic SubSystem: '/Wiper_Control' */ /* SystemInitialize for Chart: '/Wiper_Control_Logic' */ /* End of SystemInitialize for SubSystem: '/Wiper_Control' */ } /* Model terminate function */ /* * File: Wiper_Control_SWC.h * * Code generated for Simulink model 'Wiper_Control_SWC'. * * Model version : 1.43 * Simulink Coder version : 9.3 (R2020a) 18-Nov-2019 * C/C++ source code generated on : Wed Sep 21 00:46:14 2022 * * Target selection: ert.tlc * Embedded hardware selection: Intel->x86-64 (Windows64) * Code generation objectives: Unspecified * Validation result: Not run */ #include "rtwtypes.h" #endif /* Wiper_Control_SWC_COMMON_INCLUDES_ */ #include "Wiper_Control_SWC_types.h" /* Macros for accessing real-time model data structure */ #endif #endif /* Block states (default storage) for system '' */ typedef struct { uint16_T Low_Speed; /* '/Wiper_Control_Logic' */ uint16_T Medium_Speed; /* '/Wiper_Control_Logic' */ uint16_T High_Speed; /* '/Wiper_Control_Logic' */ uint8_T is_active_c1_Wiper_Control_SWC;/* '/Wiper_Control_Logic' */ uint8_T is_c1_Wiper_Control_SWC; /* '/Wiper_Control_Logic' */ uint8_T Rain_HL; /* '/Wiper_Control_Logic' */ uint8_T Rain_LL; /* '/Wiper_Control_Logic' */ /* External outputs (root outports fed by signals with default storage) */ typedef struct { uint16_T Wiper_Output; /* '/Wiper_Output' */ /* Real-time Model Data Structure */ }; /* Block states (default storage) */ /* External outputs (root outports fed by signals with default storage) */ /* Model entry point functions */ /* Real-time Model object */ /*- * The generated code includes comments that allow you to trace directly * back to the appropriate location in the model. The basic format * is /block_name, where system is the system number (uniquely * assigned by Simulink) and block_name is the name of the block. * * Use the MATLAB hilite_system command to trace the generated code back * to the model. For example, * * hilite_system('') - opens system 3 * hilite_system('/Kp') - opens and selects block Kp which resides in S3 * * Here is the system hierarchy for this model * * '' : 'Wiper_Control_SWC' * '' : 'Wiper_Control_SWC/Wiper_Control' * '' : 'Wiper_Control_SWC/Wiper_Control/Wiper_Control_Logic' */ #endif /* RTW_HEADER_Wiper_Control_SWC_h_ */ /* * File trailer for generated code. * * [EOF] */ { /* (no terminate code required) */ } /*/* * File: Wiper_Control_SWC_private.h * * Code generated for Simulink model 'Wiper_Control_SWC'. * * Model version : 1.43 * Simulink Coder version : 9.3 (R2020a) 18-Nov-2019 * C/C++ source code generated on : Wed Sep 21 00:46:14 2022 * * Target selection: ert.tlc * Embedded hardware selection: Intel->x86-64 (Windows64) * Code generation objectives: Unspecified * Validation result: Not run */ #include "rtwtypes.h" #include #endif #endif #endif #endif #endif /* Imported (extern) block signals */ extern uint8_T Rain_Input; /* '/Rain_Input' */ #endif /* RTW_HEADER_Wiper_Control_SWC_private_h_ */ /* * File trailer for generated code. * * [EOF] */ * File trailer for generated code. * * [EOF] *//* * File: Wiper_Control_SWC_types.h * * Code generated for Simulink model 'Wiper_Control_SWC'. * * Model version : 1.43 * Simulink Coder version : 9.3 (R2020a) 18-Nov-2019 * C/C++ source code generated on : Wed Sep 21 00:46:14 2022 * * Target selection: ert.tlc * Embedded hardware selection: Intel->x86-64 (Windows64) * Code generation objectives: Unspecified * Validation result: Not run */ /* Model Code Variants */ /* Forward declaration for rtModel */ #endif /* RTW_HEADER_Wiper_Control_SWC_types_h_ */ /* * File trailer for generated code. * * [EOF] */



Develop Simulink/state flow model for the vehicle speed calculation unit inside the ABS system for the below conditions.
Description of Challenge:
fl, fr, rl and rr are the wheel speeds of front left, front right, rear left and rear right respectively.
Model-






Find the detailed JMAAB report in the attachements.
Fixed point Tool-
Old SLDD-


New SLDD-

SLDV Design Error detection-

Coclusion-
There was not any dead logic or falsified condition in the simulink model as per the design error detection report.
Find the SLDV design error detection report in the attachements.
SLDV Test generation-

Find the SLDV test generation report in the attachements.
Functional Testing-
Test Cases-

MIL Harness-

MIL Test Output-

As seen from the data inspector expected output and actual model output is matching at every time instant.
SIL Test Harness-

SIL Test Output-

As seen from the data inspector expected output and actual model output is matching at every time instant.
Auto code genration-
Vehicle_Speed_Calculation_SWC.c-
/* * File: Vehicle_Speed_Calculation_SWC.c * * Code generated for Simulink model 'Vehicle_Speed_Calculation_SWC'. * * Model version : 1.50 * Simulink Coder version : 9.3 (R2020a) 18-Nov-2019 * C/C++ source code generated on : Sat Sep 24 23:13:26 2022 * * Target selection: ert.tlc * Embedded hardware selection: Intel->x86-64 (Windows64) * Code generation objectives: Unspecified * Validation result: Not run */ #include "Vehicle_Speed_Calculation_SWC.h" #include "Vehicle_Speed_Calculation_SWC_private.h" /* External outputs (root outports fed by signals with default storage) */ /* Real-time model */ /* Model step function */ { /* Outputs for Atomic SubSystem: '<Root>/Vehicle_Speed_Calculation' */ /* Chart: '<S1>/Chart' incorporates: * Inport: '<Root>/Fl' * Inport: '<Root>/Fr' * Inport: '<Root>/Rl' * Inport: '<Root>/Rr' */ /* Outport: '<Root>/Vehicle_Speed' */ /* Outport: '<Root>/Vehicle_Speed' */ 3); /* Outport: '<Root>/Vehicle_Speed' */ 3); /* Outport: '<Root>/Vehicle_Speed' */ 3); /* Outport: '<Root>/Vehicle_Speed' */ 3); /* Outport: '<Root>/Vehicle_Speed' */ /* Outport: '<Root>/Vehicle_Speed' */ /* Outport: '<Root>/Vehicle_Speed' */ /* Outport: '<Root>/Vehicle_Speed' */ /* Outport: '<Root>/Vehicle_Speed' */ /* Outport: '<Root>/Vehicle_Speed' */ } else { /* Outport: '<Root>/Vehicle_Speed' */ } /* End of Chart: '<S1>/Chart' */ /* End of Outputs for SubSystem: '<Root>/Vehicle_Speed_Calculation' */ } /* Model initialize function */ { /* (no initialization code required) */ } /* Model terminate function */ { /* (no terminate code required) */ } /* * File trailer for generated code. * * [EOF] *//* * File: Vehicle_Speed_Calculation_SWC.h * * Code generated for Simulink model 'Vehicle_Speed_Calculation_SWC'. * * Model version : 1.50 * Simulink Coder version : 9.3 (R2020a) 18-Nov-2019 * C/C++ source code generated on : Sat Sep 24 23:13:26 2022 * * Target selection: ert.tlc * Embedded hardware selection: Intel->x86-64 (Windows64) * Code generation objectives: Unspecified * Validation result: Not run */ #include "rtwtypes.h" #endif /* Vehicle_Speed_Calculation_SWC_COMMON_INCLUDES_ */ #include "Vehicle_Speed_Calculation_SWC_types.h" /* Macros for accessing real-time model data structure */ #endif #endif /* External outputs (root outports fed by signals with default storage) */ typedef struct { /* Real-time Model Data Structure */ }; /* External outputs (root outports fed by signals with default storage) */ /* Model entry point functions */ /* Real-time Model object */ /*- * The generated code includes comments that allow you to trace directly * back to the appropriate location in the model. The basic format * is <system>/block_name, where system is the system number (uniquely * assigned by Simulink) and block_name is the name of the block. * * Use the MATLAB hilite_system command to trace the generated code back * to the model. For example, * * hilite_system('<S3>') - opens system 3 * hilite_system('<S3>/Kp') - opens and selects block Kp which resides in S3 * * Here is the system hierarchy for this model * * '<Root>' : 'Vehicle_Speed_Calculation_SWC' * '<S1>' : 'Vehicle_Speed_Calculation_SWC/Vehicle_Speed_Calculation' * '<S2>' : 'Vehicle_Speed_Calculation_SWC/Vehicle_Speed_Calculation/Chart' */ #endif /* RTW_HEADER_Vehicle_Speed_Calculation_SWC_h_ */ /* * File trailer for generated code. * * [EOF] *//* * File: Vehicle_Speed_Calculation_SWC_private.h * * Code generated for Simulink model 'Vehicle_Speed_Calculation_SWC'. * * Model version : 1.50 * Simulink Coder version : 9.3 (R2020a) 18-Nov-2019 * C/C++ source code generated on : Sat Sep 24 23:13:26 2022 * * Target selection: ert.tlc * Embedded hardware selection: Intel->x86-64 (Windows64) * Code generation objectives: Unspecified * Validation result: Not run */ #include "rtwtypes.h" /* Imported (extern) block signals */ #endif /* RTW_HEADER_Vehicle_Speed_Calculation_SWC_private_h_ */ /* * File trailer for generated code. * * [EOF] *//* * File: Vehicle_Speed_Calculation_SWC_types.h * * Code generated for Simulink model 'Vehicle_Speed_Calculation_SWC'. * * Model version : 1.50 * Simulink Coder version : 9.3 (R2020a) 18-Nov-2019 * C/C++ source code generated on : Sat Sep 24 23:13:26 2022 * * Target selection: ert.tlc * Embedded hardware selection: Intel->x86-64 (Windows64) * Code generation objectives: Unspecified * Validation result: Not run */ /* Model Code Variants */ /* Forward declaration for rtModel */ #endif /* RTW_HEADER_Vehicle_Speed_Calculation_SWC_types_h_ */ /* * File trailer for generated code. * * [EOF] */


