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 revisionPrevious revision
Next revision
Previous revision
nxtway_wheeled_inverted_pendulum_with_gyro_sensor [2016/11/09 13:54] dwallacenxtway_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 HTWay" and sample code that allows it to balance and be controlled by and infrared transmitting controller. HiTechnic also provides an assembly manual for their "HiTechnic HTWay" and sample code that allows it to balance and be controlled by and infrared transmitting controller.
  
-{{dylanw:HiTechnicHTWayAssembly.pdf}}{{:HiTechnicHTWayNXCcode.nxc.zip}}+{{dylanw:HiTechnicHTWayAssembly.pdf}} {{dylanw:HiTechnicHTWayNXCcode.nxc.zip}}
  
-**The goal of this project was to verify HiTechnic's controller using their gyro, then modify the controller to work with an analog [[http://www.sparkfun.com/products/9431|Sparkfun 6-axis IMU]] (sku: SEN-09431, Retired):+The goal of this project was to verify HiTechnic's controller using their gyro, then modify the controller to work with an analog [[http://www.sparkfun.com/products/9431|Sparkfun 6-axis IMU]] (sku: SEN-09431, Retired):
  
 {{dylanw:razorIMU.jpeg}}\\  {{dylanw:razorIMU.jpeg}}\\ 
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.1478728494.txt.gz · Last modified: 2016/11/09 13:54 by dwallace