UKHAS Wiki

UK High Altitude Society

User Tools

Site Tools


projects:ukhas_glider_project:code

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
projects:ukhas_glider_project:code [2007/12/08 16:54] – Zagi code laurencebprojects:ukhas_glider_project:code [2008/07/19 23:33] (current) – external edit 127.0.0.1
Line 151: Line 151:
  || gpsGetInfo()->VelHS.updates<=updatecounterHS)                     //while we still have some old data  || gpsGetInfo()->VelHS.updates<=updatecounterHS)                     //while we still have some old data
  {  {
-  nmeaProcess(Rxbuff0);                                               //look for new data +  nmeaProcess(Rxbuff0);   
-  updatecounterLLA=gpsGetInfo()->PosLLA.updates; +                                             //look for new data 
-  updatecounterENU=gpsGetInfo()->VelENU.updates; + updatecounterLLA=gpsGetInfo()->PosLLA.updates; //set the update counters correctly 
-  updatecounterHS=gpsGetInfo()->VelHS.updates; + updatecounterENU=gpsGetInfo()->VelENU.updates; 
- + updatecounterHS=gpsGetInfo()->VelHS.updates;
  
  
Line 282: Line 282:
  
 <code c> <code c>
-// this is under construction+// initialisation code
 // - Laurenceb // - Laurenceb
 #include "init.h" #include "init.h"
Line 321: Line 321:
 { {
  char teststr[15];   char teststr[15]; 
-sbi(DDRD,5);                      //lcd is output+sbi(DDRD,5);                      //led is output
 sbi(DDRB,5); sbi(DDRB,5);
 sbi(DDRB,6);                      //pwm outputs  sbi(DDRB,6);                      //pwm outputs 
 +sbi(DDRG,3);                      //direction led
 +sbi(DDRG,4);
 +sbi(DDRD,6);                      //cutdowns
 +sbi(DDRD,7);
 +sbi(PORTD,4);
 uartInit();                       //init uarts uartInit();                       //init uarts
 uartSetBaudRate(0,4800);          //GPS+radio uartSetBaudRate(0,4800);          //GPS+radio
Line 378: Line 383:
 printf("initialisation complete, bye\r\n"); printf("initialisation complete, bye\r\n");
 } }
 +
  
  
Line 599: Line 605:
   }   }
   pwmpitch=(pitchrunningaverage*PP)+(deltapitchrunningaverage*DP)+(pitchintegral*IP);   pwmpitch=(pitchrunningaverage*PP)+(deltapitchrunningaverage*DP)+(pitchintegral*IP);
-  pwmroll=(rollrunningaverage*PR)+(rollrunningaverage*DR)+(rollintegral*IR)+tweakfactor;+  pwmroll=(rollrunningaverage*PR)+(deltarollrunningaverage*DR)+(rollintegral*IR)+tweakfactor;
   servoa=trimAgain*(pwmpitch+pwmroll)+trimAbias;                                    // V tail mixing in SW   servoa=trimAgain*(pwmpitch+pwmroll)+trimAbias;                                    // V tail mixing in SW
   if (servoa>(trimAbias+limitA))   if (servoa>(trimAbias+limitA))
projects/ukhas_glider_project/code.1197132873.txt.gz · Last modified: 2008/07/19 23:32 (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki