- The question is referring to this File Exchange submission: https://www.mathworks.com/matlabcentral/fileexchange/63823-matlab-and-simulink-racing-lounge--vehicle-modeling; and this model in particular 'BEV_TS_Regen_Model.slx'
- Torque * Rotational Velocity = Power.
- APP is the accelerator pedal position with values [0;1].
- MDL.MotorModel.MaxPwrOut and MDL.MotorModel.MaxTrqOut are two constants defined in the model workspace. Consider them as motor-specific constants that shouldn't be altered.
- The block passes along a maximal torque (MaxTorque) and an allowable regenerative torque (AllowableRegenTorque).
- The block inputs are the APP (see above) and the current motor speed.
- The min block compares two torque values and passes on the smaller value. The first torque is the maximal motor torque (MDL.MotorModel.MaxTrqOutMaxTorque) itself, the second one is the maximal motor power (MDL.MotorModel.MaxPwrOut) divided by the current motor speed (which also results in a torque).
- The resulting torque from the min-block is multiplied with the current pedal position to obtain the MaxTorque value to be passed along.
- To get the allowable value for for regenerative torque, the resulting torque from the min-block is multiplied by -0.5. This basically says that maximally half of the current torque can be regenerated. Consider the '-0.5' as an assumption by the model creator.