# PER Lapsim
## Todo
- [X] Generic track simulation
## General Structure
The main body of the simulation is called run_track.m, running this file should fully run the simulation. All static vehicle characteristics are given as a list of variables in config.m. The provided template is intended to be filled in with new values for a different car to be compared. These values may change throughout the simulation if necessary, but all values represent the vehicle stopped with the load of a driver. Some variables may need to be added to this file as the simulation matures, but only if they represent defining characteristics of the car. With these variables loaded, the simulation interpolates RPM-Torque curve for the motor and the SOC-OCV curve for the battery. These are simplistic models and should be improved upon within the projects described below.
The config.m file also loads the track for a desired simulation. Only one should be uncommented in this file when running the simulation. There are track files for all dynamic events called acceleration_run.m, autox.m, skidpad.m, and endurance.m. The tracks are tables of three columns with each row representing a new section of the track, either a straight or a corner. The first column is a Boolean value with 1 representing a corner, and 0 representing a straight section. The second column gives the section distance or arclength in meters, how far the car must travel. The third column is the corner radius in meters, this value is zero for straight sections. The track table pre-process adds a fourth column with the maximum attainable cornering velocity given vehicle characteristics. This function should be updated to consider the lateral tire force model and ensure the car neither understeers nor oversteers.
![Uh Oh... Failed to load image](resources/blockDiag.jpg "High level overview")
The simulation may need to be ran on a Purdue computer to access all additional MATLAB packages that are used. I would suggest using remote connect to port into a Purdue computer or using MATLAB as a remote connection.
## Modifying the Sim
Since multiple people are doing work on the sim at the same time, the use of GitHub has been established to provide a proper workflow for each individual. If a derivative work or spin off needs to be established, a branch is to be made for all commited changes. Work that needs to go into the core of the simulator should be initially commited into a branch with a pull request being made to merge with master when the changes have been reviewed and verified. If a bug is found or a new feature is needed, please use the integrated change requests templates on GitHub for the project. We are using GitHub to foster modification in a safe manner, so please, do edit!
## Projects
### Motor Model
Motor curves from data sheets are interpolated using specific data points input in config.m and the function process_motor_table.m. Motor dynamics are determined in motor.m. This function is a simple case structure that calculates motor torque from an input motor RPM assuming always operating at the power limit. The function limits the wheels from slipping at the calculated traction limit, this will require interaction with the traction project. The function should be updated to multiple motor systems. No analysis is currently done on motor cooling effects on performance.
### Battery Model
Battery characteristics are interpolated using process_battery_table.m and a data array of battery open circuit voltage (OCV) and state of charge (SOC) as with other characteristics are located in config.m. Battery dynamics are determined within battery.m. Changes should be made directly to these files. Notes from the original creator of the LapSim state that regen, low voltage load, and thermals for the battery are topics to add to the simulation. From my current understanding of the model, the OCV-SOC curve is fitted to experimental data. There are more accurate ways to model battery performance, but with the linearized SOC curve, a proper series RC model isn't really neccessary.
### Suspension Model
The current suspension model is extremely basic. There is a half-baked attempt at weight transfer coded in longitudinal_traction.m however there are not detailed characteristics of the suspension in the Config template. Thinking hub-motors, it would be extremely beneficial to include suspension characteristics in evaluating its performance. Additionally, including the tire model in the simulation will require inputs of each individual wheel normal force and camber angle. I have started a script with some basic suspension calculations called weight_transfer.m. In this file I have included some critical suspensions lengths that should be included in the Config. I will leave this project to be open ended as far as how detailed the results should be, so as if the instantaneous normal force and camber of each wheel is included. For the time being, start these calculations in a new script.
### Traction
Wheel slip dynamics may be somewhat difficult to properly simulate. The current motor dynamics in motor.m assumes that the car is always operating at the power limit and will further limit output torque to the traction limit if necessary. The traction limit can be updated using the tire model simulation directly in longitudinal_traction.m and the track table preprocessing. I have created two functions called magic_formula_corner.m and magic_formula_straight.m that determines Pacejka tire coefficients for the lateral and longitudinal traction cases. The magic_formula.m function will evaluate either tractive force of an individual wheel with input of the respective coefficients, wheel normal load, and wheel camber angle. This project will be associated with updating the motor model as the slipping case is highly interrelated.
## Getting Set Up
- Prepare to clone the repository using the clone button on the main page of this repository. Rather than downloading all files, copy the link given in the clone box. If you are not a member of PER on GitHub, you won't be able to clone the project. If this is the case, please request access from a member on GitHub.
- In MatLAB, under home, select new. Select `Project`, and then `From Git`.
- Select change under repository path and enter the copied link from the clone page.
- Make sure the file path listed under `Sandbox` is where you want everything to go. When done, select `Retrieve` from the bottom right.
- When you get an error about not being able to find a project, select `Cancel`.
For more information about how to use GitHub with MatLAB after setup, read the document [here](https://docs.google.com/document/d/1gen7prkkG-CvCPOUjR6NYGRNGCtM_V16xhgDluyXJXo/edit).
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
matlab算法,工具源码,适合毕业设计、课程设计作业,所有源码均经过严格测试,可以直接运行,可以放心下载使用。有任何使用问题欢迎随时与博主沟通,第一时间进行解答! matlab算法,工具源码,适合毕业设计、课程设计作业,所有源码均经过严格测试,可以直接运行,可以放心下载使用。有任何使用问题欢迎随时与博主沟通,第一时间进行解答! matlab算法,工具源码,适合毕业设计、课程设计作业,所有源码均经过严格测试,可以直接运行,可以放心下载使用。有任何使用问题欢迎随时与博主沟通,第一时间进行解答! matlab算法,工具源码,适合毕业设计、课程设计作业,所有源码均经过严格测试,可以直接运行,可以放心下载使用。有任何使用问题欢迎随时与博主沟通,第一时间进行解答! matlab算法,工具源码,适合毕业设计、课程设计作业,所有源码均经过严格测试,可以直接运行,可以放心下载使用。有任何使用问题欢迎随时与博主沟通,第一时间进行解答! matlab算法,工具源码,适合毕业设计、课程设计作业,所有源码均经过严格测试,可以直接运行,可以放心下载使用。有任何使用问题欢迎随
资源推荐
资源详情
资源评论
收起资源包目录
毕业设计&课设-Matlab中的搭接仿真.zip (55个子文件)
matlab_codes
.github
ISSUE_TEMPLATE
documentation-request.md 486B
feature_request.md 621B
bug_report.md 538B
resources
blockDiag.jpg 66KB
.gitignore 94B
lapsim
classes
suspension.m 2KB
aero.m 1KB
hv.m 1KB
sensors.m 1002B
vd.m 13KB
tctv.m 366B
lv.m 4KB
tires.m 9KB
motor.m 8KB
driveline.m 3KB
driver.m 622B
cooling.m 481B
trk.m 728B
battery.m 4KB
HV_ODE.m 420B
batt_model.m 94B
VariableCurrent.csv 1.8MB
regen_ode.m 204B
load_cfg.m 2KB
Tire Model
draw_MNC_test.m 2KB
tire.m 4KB
magic_formula.m 2KB
RawData_Cornering_Matlab_SI.zip 48.02MB
Parse_Tire_Data.m 4KB
B1464run29.mat 9.61MB
magic_formula_corner.m 6KB
calc_magic_formula.m 454B
movemean.m 2KB
plot_variable_loads.m 903B
MNC.m 1KB
B1464run22.mat 15.02MB
RawData_DriveBrake_Matlab_SI.zip 38.9MB
get_variable_load_params.m 873B
slope.m 984B
magic_formula_straight.m 4KB
battery_data_parser.m 954B
OCV_Extraction.m 1KB
Emrax_Efficiency_Data.xlsx 48KB
rungekutta.m 1KB
regen_time.m 1KB
VTC6_Data.csv 194KB
Emrax_Efficiency_Data.csv 25KB
accel.csv 58B
init_cfg.csv 1KB
run_sim.m 3KB
skidpad.csv 64B
autox.csv 374B
ODE_test.m 4KB
VTC6 RPT.csv 5.38MB
README.md 7KB
共 55 条
- 1
资源评论
白话机器学习
- 粉丝: 1w+
- 资源: 7671
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- Matlab根据flac、pfc或其他软件导出的坐标及应力、位移数据再现云图 案例包括导出在flac6.0中导出位移的fish代码(也可以自己先准备软件导出的坐标数据及对应点的位移或应力数据,可根据需
- 拳皇97.exe拳皇972.exe拳皇973.exe
- 捕鱼达人1.exe捕鱼达人2.exe捕鱼达人3.exe
- 医疗骨折摄像检测29-YOLO(v5至v9)、COCO、CreateML、Darknet、Paligemma数据集合集.rar
- ks滑块加密算法与源代码
- 医护人员检测23-YOLOv8数据集合集.rar
- 1.电力系统短路故障引起电压暂降 2.不对称短路故障分析 包括:共两份自编word+相应matlab模型 1.短路故障的发生频次以及不同类型短路故障严重程度,本文选取三类典型的不对称短路展开研究
- C#连接sap NCO组件 X64版
- 开源基于51单片机的多功能智能闹钟设计,课设毕设借鉴参考
- 深度强化学习电气工程复现文章,适合小白学习 关键词:能量管理 深度学习 强化学习 深度强化学习 能源系统 优化调度 编程语言:python平台 主题:用于能源系统优化调度的深度强化学习算法的性能比较
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功