David's dead reckoning code for the LVBots competition on March 6th. Uses the mbed LPC1768, DRV8835, QTR-3RC, and two DC motors with encoders.

Dependencies:   PololuEncoder Pacer mbed GeneralDebouncer

Revisions of main.cpp

Revision Date Message Actions
48:597738b77f77 14 months ago Changes from before the contest, I think. File  Diff  Annotate
47:9773dc14c834 15 months ago Got some awesome results using carefully calculated scale factors for the gyro! File  Diff  Annotate
46:df2c2d25c070 15 months ago Some minor changes. The overall dead reckoning is working now, but I don't think I did much to fix it. File  Diff  Annotate
45:81dd782bc0b4 15 months ago Calibrate the line sensors. Add testLineSensorsAndCalibrate. Unfortunately, testLineFollowing is not working though. File  Diff  Annotate
44:b4a00fbab06b 15 months ago Get testDriveHome to work: the robot got to within about 6 inches of where it was in one test I did. File  Diff  Annotate
43:0e985a58f174 15 months ago Changed reckoner to use readings from turnSensor (Gyro) to get its direction vector instead of encoder ticks. File  Diff  Annotate
42:96671b71aac5 15 months ago Calibrate L3G using a buffer of 1000 zero-rate readings. Measured a drift of -1.850 degrees over 3 minutes (-0.01 degree per second). File  Diff  Annotate
41:3ead1dd2cc3a 15 months ago Gyro: Add a hacky offset of +6.5 in TurnSensor.cpp. The turn sensor drifts much more slowly now, like maybe 1 degree per minute. File  Diff  Annotate
40:6fa672be85ec 15 months ago Add TurnSensor and L3G code but I am not happy with how the Gyro drifts a degree every few seconds or so. File  Diff  Annotate
39:b19dfc5d4d4b 15 months ago New motors! 100:1 HP. File  Diff  Annotate
38:5e93a479c244 2014-03-13 The final version of the code that was used for the competition.; File  Diff  Annotate
37:23000a47ed2b 2014-03-06 With a boost 0.2% to handleRight in the Reckoner, this code did very well on the course twice!! Then I ran it the other way and it was more than a foot off :( File  Diff  Annotate
34:6c84680d823a 2014-03-05 Not sure.; File  Diff  Annotate
33:58a0ab6e9ad2 2014-03-05 Bunch of stuff. Then reduced drivingSpeed to 400. File  Diff  Annotate
32:83a13b06093c 2014-03-04 getting line sensors to work again; File  Diff  Annotate
31:739b91331f31 2014-03-04 testLineSensors seems to work fine with QTR-3RC. File  Diff  Annotate
30:84be2d602dc0 2014-03-04 Seems like the QTR-3RC could work, based on my tests on P10. File  Diff  Annotate
29:cfcf08d8ac79 2014-03-04 trying to figure out the analog problem; File  Diff  Annotate
28:4374035df5e0 2014-03-01 Discovered that 4 out of the 6 analog inputs on the mbed are severely messed up. Might need to get a new mbed or do digital filtering (a median of three readings out to work). File  Diff  Annotate
27:2456f68be679 2014-03-01 Fixed a major bug in the line following (reduceSpeed return value was not used). Made finalSettleIn better by adding an integral term and increasing the settleSpeed from 200 to 300. File  Diff  Annotate
26:7e7c376a7446 2014-02-28 This is my attempt to make it hang on to the line better after finding it. I found a really bad bug in followLineToEnd that might explain all the problems, but I also changed the loadCalibrationAndFindLine function so it doesn't overshoot. File  Diff  Annotate
25:73c2eedb3b91 2014-02-28 Some stuff. I am about to take away the foundLineTimer in an attempt to make it better at finding the line. File  Diff  Annotate
24:fc01d9125d3b 2014-02-28 Fixed the problem with LineTracker always thinking the line was visible. File  Diff  Annotate
23:aae5cbe3b924 2014-02-28 Stuff; File  Diff  Annotate
22:44c032e59ff5 2014-02-28 Fixed the code for calibrating. Added testCalibrate. File  Diff  Annotate
21:c279c6a83671 2014-02-27 Wrote a whole bunch of code that could theoretically allow the robot to compete, but it has not been tested at all yet. File  Diff  Annotate
20:dbec34f0e76b 2014-02-27 Broke up driveHome into two functions. File  Diff  Annotate
19:a11ffc903774 2014-02-25 Got the robot to get back to its home position and stop. File  Diff  Annotate
18:b65fbb795396 2014-02-24 Got the robot to face towards home! File  Diff  Annotate
17:2df9861f53ee 2014-02-24 Created a stub driveHome routine that we need to fill in. File  Diff  Annotate
16:8eaa5bc2bdb1 2014-02-24 Got debounced button pressing to work. File  Diff  Annotate
12:835a4d24ae3b 2014-02-23 Made the Reckoner class and wrote a routine to help test it.; File  Diff  Annotate
10:e4dd36148539 2014-02-22 Successfully tested the encoders, printing out a nice bar graph. File  Diff  Annotate
9:9734347b5756 2014-02-22 Made verything use CamelCase.; File  Diff  Annotate
8:78b1ff957cba 2014-02-22 refactored into many files File  Diff  Annotate
7:85b8b5acfb22 2014-02-21 Setting more PWM registers now, but the call to period_us is still necessary for some reason. File  Diff  Annotate
6:89a39870e23d 2014-02-20 Got high-resolution 20 kHz PWM. File  Diff  Annotate
5:01ad080dc4fa 2014-02-20 Succeeded in getting high resolution PWM. File  Diff  Annotate
4:1b20a11765c8 2014-02-20 Succeeded in generating basic PWM signals with PwmOut. File  Diff  Annotate
3:59c80d4b4bf2 2014-02-20 Done working on encoder stuff for now.; File  Diff  Annotate
2:968338353aef 2014-02-20 Moved the code to enable pull-ups into the app. File  Diff  Annotate
1:d0d9653a4547 2014-02-20 Added pacers. File  Diff  Annotate
0:e77a0edb9878 2014-02-20 Got basics working. See commit for library. File  Diff  Annotate