swl017 / mpcc_ros

10 stars 5 forks source link

Model by Spec #5

Open swl017 opened 3 years ago

swl017 commented 3 years ago

related pull request: https://github.com/swl017/mpcc_ros/pull/4

1. 스펙으로 모델 도출

IAC 모델 스펙: google 문서

  1. 횡방향 Pacejka 모델

    Vehicle Lateral Parameter Plotter
    
    Data: param.mat/param_feasible
    eq = tan(pi/(2*C))-k*C == 0
    solve(eq,C)
    for k = 1.9 ~ 3.0(?)
    then, D = C_alpha*alpha_max/k, B = k/(alpha_max*C)
    
    Brief: convert linear tire model to Pacejka Magic formula
    
    Fy = C_{alpha}*alpha
    into
    Fy = D*sin(C*atan(B*alpha))
    using
    C_{alpha} = D*C*B and C*atan(B*alpha_{max}) = pi/2
    and C_{alpha}*alpha_{max} = k*D
    Thus, plot depending on k = 1.6~2.0

    Screenshot_20210116-012725_OneNote

Fy vs slip plot_lat_params_Fy_vs_slip

  1. 종방향 모델

    Vehicle Longitudinal Parameter Plotter
    
    Fx = (Cm1 - Cm2 * vx) * D - Cr0 - Cr2 * vx^2
    
    Data: param.mat/lonp

    Fx vs D(throttle) plot_lon_params_Fx_vs_D

vx vs t(simulate assuming full throttle) plot_lon_params_vx_vs_t

matlab code: swl017/MATLAB.git

2. 튜닝

  1. scaled -> fullscale의 변화만큼 cost 튜닝 Liniger MPCC fullscale branch: https://github.com/alexliniger/MPCC/blob/fullsize/C%2B%2B/Params/cost.json

  2. n_sqp 2 -> 100("잘생각해봐") src/mpcc_controller/mpcc_controller/Params/config.json

    "n_sqp": 100,

3. 결과

느리지만 안정적 mpcc_model_by_spce_nsqp_100.mp4 (30 MB)

4. TODO

  1. n_sqp < 10 에서도 잘 동작하게 튜닝
swl017 commented 3 years ago

@hynkis 참고 삼아 공유