Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of TVDctrller2017_brdRev1_ver6 by
Diff: TVDCTRL.cpp
- Revision:
- 29:a51cb2cf22ae
- Parent:
- 28:47e9531a3a9d
- Child:
- 30:c596a0f5d685
diff -r 47e9531a3a9d -r a51cb2cf22ae TVDCTRL.cpp --- a/TVDCTRL.cpp Mon Jul 03 12:03:34 2017 +0000 +++ b/TVDCTRL.cpp Sat Jul 08 06:20:29 2017 +0000 @@ -306,17 +306,18 @@ static float lastSteering=0.0f; float omega=0; int disTrq=0; + + steering = ratioLPF * steering + (1.0f - ratioLPF) * lastSteering; omega = lastSteering - steering; //舵角の差分算出 - omega /= 0.01f; //制御周期で角速度演算 if(myAbs(omega) < 0.349f) { //20deg/s disTrq = 0; } else if(myAbs(omega) <= 8.727f) { //500deg/s - disTrq = (int)((0xFFFF/45.0f * 10.0f) / (8.727f-0.349f) * (myAbs(omega) - 0.349f)); + disTrq = (int)((0xFFFF/45.0f * 5.0f) / (8.727f-0.349f) * (myAbs(omega) - 0.349f)); } else - disTrq = (int)(0xFFFF/45.0f * 10.0f); + disTrq = (int)(0xFFFF/45.0f * 5.0f); lastSteering = steering;