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.
Dependencies: FastPWM MODSERIAL mbed QEI
Diff: main.cpp
- Revision:
- 4:e8b3fba77dd0
- Parent:
- 0:9cf3d3dc621b
--- a/main.cpp Wed May 31 20:30:48 2017 +0000 +++ b/main.cpp Wed May 30 09:44:15 2018 +0000 @@ -78,7 +78,7 @@ //Virtual model properties const float virtualMass = 0.0015f; -const float virtualStiffness = 50.0f; +const float virtualStiffness = 0.0f; const float virtualDamping = 3.0f; const float springPos = 0.0f; @@ -323,7 +323,7 @@ inline void doStateOPAdmittance() { //Virtual Model - refAcc = force / virtualMass - virtualStiffness * (refPos - springPos) - virtualDamping * refVel; + refAcc = (force - virtualStiffness * (refPos - springPos) - virtualDamping * refVel) / virtualMass ; refVel += refAcc * LOOPDURATION; if (refVel > MAXVEL)