|
| 1 | +/*! |
| 2 | +\mainpage Shield Code 6.0 Documentation |
| 3 | +
|
| 4 | +test test test test test |
| 5 | +*/ |
1 | 6 | /** |
2 | 7 | * @file main.cpp |
3 | 8 | * @brief Main file for the 317 lab project. |
|
6 | 11 | * |
7 | 12 | */ |
8 | 13 |
|
9 | | -/*TODO - IN ORDER OF PRIORITY: |
10 | | -- Turn on GPS pulse generator |
11 | | -- Make debugging setup picture/guide |
12 | | -
|
13 | | -need to figure out how many bytes we are sending. sit down with pen and paper. |
14 | | -
|
15 | | -- Timestamp issue: |
16 | | - - I2C clock turns off |
17 | | - - sweeps get super far apart - like 1 second |
18 | | - - CPP has undefined behavior if you try to store too large of an integer into 4 bytes. figure out why this wasn't an issue before? |
19 | | -
|
20 | | -- DAC settling: |
21 | | - - Figure out new timing parameters |
22 | | - - SWEEP_DELAY is currently set up with clock cycles. Should change to microseconds. |
23 | | - - Need to add preamp settling time to DAC internal delay. Jeff will tell me what that should be. |
24 | | -
|
25 | | -- Speeding it up: |
26 | | - - Communication is only half the sweep. we can throw the IMU query in there using that nonblocking I2C library. |
27 | | - - ask Jeff how much we can cut down sweep time. |
28 | | - - Very rough test indicates that the interrupts add about 500 us to the sweep time. |
29 | | -
|
30 | | -- IMU: |
31 | | - - Accelerometer and gyro readings are maxing out. Note that we can increase range. |
32 | | - - Should stop sending a zero at end of IMU |
33 | | -*/ |
34 | | -/* |
35 | | -General notes: |
36 | | -
|
37 | | -SWEEP NEEDS TO BE FIRST. imu and sweep cadence most important. that worked. don't change. |
38 | | -
|
39 | | -still jittering. roughly every 400 sweeps, gets slower for 12 sweeps. then back to normal. |
40 | | -when you increase the sweep time, it gets better. when you narrow it, it gets worse. |
41 | | -figure out - at 45 Hz, is the issue waiting or not waiting. |
42 | | -
|
43 | | -when not shortened, there's ~2.5 ms of wiggle room. when shortened, seems like about 600 us - |
44 | | -but that's roughly the length of a step so it seems like there's no break |
45 | | -sweep time drops to about 20 ms. |
46 | | -
|
47 | | -full shortened period lasts 268 ms. |
48 | | -n sweeps: |
49 | | -- 13 |
50 | | -- 13 |
51 | | -- 13 |
52 | | -
|
53 | | -cycle time in shortened period oscillates between ~20.56 ms and ~19.96 ms - 600 us difference that perfectly matches the SPI write time that |
54 | | -happens every other cycle |
55 | | -
|
56 | | -happens consistently and exactly every 404 cycles - based on data set of 3210 cycles (about 70 seconds) |
57 | | -
|
58 | | -issue goes away when you don't send data - includes copying into memory block |
59 | | -
|
60 | | -on the first error, the timer triggers sweep time twice in a row - wait cycle is ignored and next sweep time is set true immediately |
61 | | -
|
62 | | -could be related to the usb to serial converter - unplugging the converter then plugging the board back in, then unplugging the board and plugging the |
63 | | -converter back in caused the issue to happen. |
64 | | -
|
65 | | -Delay between when sweeps start and when UART communication starts. |
66 | | -
|
67 | | -first 13 cycles are short |
68 | | -*/ |
69 | 14 | //========== Libraries ==========// |
70 | 15 | #include <Arduino.h> |
71 | 16 | #include <Pip.hpp> //note, Max1148 isn't included because it's included in Pip |
|
0 commit comments