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 motor by
Diff: motor.cpp
- Revision:
- 5:c50e40797114
- Parent:
- 4:e15ec9052a78
- Child:
- 7:9aaa4f73bb32
- Child:
- 17:28216063e33e
--- a/motor.cpp Fri Oct 21 13:44:19 2016 +0000
+++ b/motor.cpp Mon Oct 24 14:12:43 2016 +0000
@@ -204,5 +204,24 @@
return;
}
+void deltaCornerRight(float speed,float deltaTheta)
+ {// when cornering right the inner motor slows down more than the right hand side
+ // may just replace with ACC and DECC
+ float r;
+ float d;
+ float l;
+ // it may be worth doing this off the change in theta. so that it is insesnsitive to the calibration.
+ float diff= ((d*tan(deltaTheta)/(2*l)));
+
+ float w1 = (speed/r)*(1+diff);
+ float w2 = (speed/r)*(1-diff);
+
+ // when there is a speed sensor tghe conversion will be much more simplistic. this is basically just guessing.
+ // need to convert w1 to the duty cycle
+ TFC_SetMotorPWM(w2,w1); //temperary values
+
+
+ return;
+ }
