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.
YellowMotors.cpp@0:85e85976c650, 2016-02-03 (annotated)
- Committer:
- amateusz
- Date:
- Wed Feb 03 16:09:07 2016 +0000
- Revision:
- 0:85e85976c650
- Child:
- 2:6f6e591f1838
created linearization functions.; to do: functions to actually move the motors, like setting PWMs and Direction shift register.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
amateusz | 0:85e85976c650 | 1 | #include <math.h> |
amateusz | 0:85e85976c650 | 2 | |
amateusz | 0:85e85976c650 | 3 | float motorLinearizationL(float desired) |
amateusz | 0:85e85976c650 | 4 | { |
amateusz | 0:85e85976c650 | 5 | return (6.6691*(exp(0.0249053*(desired*100))+2.92508))/100.0; |
amateusz | 0:85e85976c650 | 6 | } |
amateusz | 0:85e85976c650 | 7 | |
amateusz | 0:85e85976c650 | 8 | float motorLinearizationR(float desired) |
amateusz | 0:85e85976c650 | 9 | { |
amateusz | 0:85e85976c650 | 10 | return 4.096509*(exp(0.0286952296*(desired*100))+5.073644964)/100.0; // \/ history of trial and error |
amateusz | 0:85e85976c650 | 11 | //return 5.9693939*(exp(0.0251906*(desired*100))+3.162519)/100.0; // that wasn't that bad at all! to early start, the rest ok |
amateusz | 0:85e85976c650 | 12 | //return (3.45183*(exp(0.0292461*(desired*100))+5.51727))/100.0; |
amateusz | 0:85e85976c650 | 13 | } |