nxtway_wheeled_inverted_pendulum_with_gyro_sensor
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
nxtway_wheeled_inverted_pendulum_with_gyro_sensor [2016/11/09 13:54] – dwallace | nxtway_wheeled_inverted_pendulum_with_gyro_sensor [2016/11/09 14:08] (current) – dwallace | ||
---|---|---|---|
Line 12: | Line 12: | ||
HiTechnic also provides an assembly manual for their " | HiTechnic also provides an assembly manual for their " | ||
- | {{dylanw: | + | {{dylanw: |
- | **The goal of this project was to verify HiTechnic' | + | The goal of this project was to verify HiTechnic' |
{{dylanw: | {{dylanw: | ||
Line 90: | Line 90: | ||
Luckily, it is easy to compensate for this newly introduced lag in the controller. This compensation comes in the form of cranking up a gain on the effect of sensed angle (integrated angular velocity from gyro) on the reactionary motor speed. This increases causes smaller tilt angles to cause greater motor speeds than the original gain. With a slower reaction time, a reaction of greater magnitude is necessary to account for lost time! | Luckily, it is easy to compensate for this newly introduced lag in the controller. This compensation comes in the form of cranking up a gain on the effect of sensed angle (integrated angular velocity from gyro) on the reactionary motor speed. This increases causes smaller tilt angles to cause greater motor speeds than the original gain. With a slower reaction time, a reaction of greater magnitude is necessary to account for lost time! | ||
- | < | + | |
- | #define KGYROANGLE | + | #define KGYROSPEED |
- | #define KGYROSPEED | + | #define KPOS 0.07 |
- | #define KPOS 0.07 | + | #define KSPEED |
- | #define KSPEED | + | |
- | </ | + | |
- | < | + | |
- | The completed code for controlling the HTway with the alternative Sparkfun razor IMU can be downloaded here:< | + | |
- | [[File: | + | |
- | < | + | |
- | ''' | + | |
- | ===Video=== | + | The completed code for controlling the HTway with the alternative Sparkfun razor IMU can be downloaded here: |
+ | {{dylanw: | ||
- | < | + | **Keep in mind:** For this to work, the sensor should be mounted in the same orientation and at the same distance from the wheel axis. Also, the sensor should be wired to the first analog input (A0) and be wire on the same size breadboard to maintain a similar moment of inertia about the wheel axis as the my modified HTway. |
- | <iframe width=" | + | |
- | </ | + | ===== Video ===== |
- | '' | + | |
+ | |||
+ | |||
+ | **Note:** If the videos do not load, just refresh the page.< | ||
Thanks for reading! | Thanks for reading! | ||
- | ==NXC Code== | + | ===== NXC Code ===== |
- | <source lang="c" line start=" | + | |
+ | <code c HTWay.nxc> | ||
// | // | ||
// HiTechnic HTWay Version 1.1 | // HiTechnic HTWay Version 1.1 | ||
Line 816: | Line 814: | ||
} | } | ||
- | </source> | + | </code> |
- | <br> | + | |
- | [[File: | + | {{dylanw: |
nxtway_wheeled_inverted_pendulum_with_gyro_sensor.1478728494.txt.gz · Last modified: 2016/11/09 13:54 by dwallace