User Tools

Site Tools


nxtway_wheeled_inverted_pendulum_with_gyro_sensor

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Last revision Both sides next 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:03]
dwallace
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!
  
-<​pre>​ +  ​#define KGYROANGLE ​ 10    // originally 7.5 
-#define KGYROANGLE ​ 10    // originally 7.5 +  #define KGYROSPEED ​ 1.15 
-#define KGYROSPEED ​ 1.15 +  #define KPOS        0.07 
-#define KPOS        0.07 +  #define KSPEED ​     0.1
-#define KSPEED ​     0.1 +
-</​pre>​ +
-<​br>​ +
-The completed code for controlling the HTway with the alternative Sparkfun razor IMU can be downloaded here:<​br>​ +
-[[File:​nxtway_justIMU.nxc.zip]]<​br>​ +
-<​br>​ +
-'''​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.<​br><​br>​+
  
-===Video===+The completed code for controlling the HTway with the alternative Sparkfun razor IMU can be downloaded here: 
 +{{dylanw:​nxtway_justIMU.nxc.zip}}
  
-<​html>​ +**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="​853"​ height="​480"​ src="​http://​www.youtube.com/​embed/​Tc93WCm2uPU"​ frameborder="​0"​ allowfullscreen></​iframe>​ + 
-</​html><​br>​ +===== Video ===== 
-''​Note:'' ​If the videos do not load, just refresh the page.<​br>​+ 
 + 
 + 
 +**Note:** If the videos do not load, just refresh the page.<​br>​
 Thanks for reading! Thanks for reading!
  
-==NXC Code== +===== NXC Code ===== 
-<source lang="c" line start="​1"​>+ 
 +<code HTWay.nxc>
 //​===================================================================== //​=====================================================================
 // HiTechnic HTWay Version 1.1 // HiTechnic HTWay Version 1.1
Line 816: Line 814:
 } }
  
-</source+</code
-<br> + 
-[[File:​nxtway_justIMU.nxc.zip]]<​br>​+{{dylanw:​nxtway_justIMU.nxc.zip}}
nxtway_wheeled_inverted_pendulum_with_gyro_sensor.txt · Last modified: 2016/11/09 14:08 by dwallace