DUE PWM Frequency

// Serial is for testing only rem out for use
/*
Serial.print (ahdat[x]);
Serial.print ("  ");
Serial.print (aldat[x]);
Serial.print ("  ");
Serial.print ("/");
Serial.print ("  ");
Serial.print (bhdat[x]);
Serial.print ("  ");
Serial.print (bldat[x]);
Serial.print ("  ");
Serial.print ("/");
Serial.print ("  ");
Serial.print (chdat[x]);
Serial.print ("  ");
Serial.print (cldat[x]);
Serial.print ("  ");
Serial.print ("/");
Serial.print ("  ");
Serial.println (); */


//delay (1500);
 xa = xa + index;
 xb = xb + index;
 xc = xc + index;
 }
}

 void loop() {
   
     y = ((y) + 1);//index y value for reading sine table
   
   //Feedback loop reading based on motor amps
   feedv = (analogRead(feed));
   feedc = feedc + feedv;
   feedv = feedc / 15;
   feedc = feedc - feedv;
   feedv = (feedv * sqrt(v));
   if (decel == 0) {
   if ((feedv) > (200)) { hexpass = (hexpass + ((sqrt(hexpass)) / (7))); }
   }
   decel = 0;
   //POT READING throttle position
   potval = (sq((analogRead(pot) * .0250829) + 6.32455));
   
   // PROCESS POT DATA
   potvali = potval;
   
   if ((potvali) > (hexdrive)) { hexpass = (hexpass + (sqrt(hexpass) / 400)); decel = 1;}  //LINEAR DECELERATION
   if (feedv < 195) {
   if ((potvali) < (hexdrive - 5)) { hexpass = (hexpass - (sqrt(hexpass) / 65)); } //LINEAR ACCELERATION
   }  
   
   hexdrive = hexpass;
   
   //DRIVE VOLTAGE ADJUSTMENT V1.7 Production
   
   //AJUST APPLIED VIRTUAL VOLTAGE TO COMPENSATE FOR FREQUENCY
   // .78 SINE TO 1.7 SINE
   
   if ((hexdrive) > (1007)) {
    v = (.76);
    hexdrive = 1024;
   }
  else {
   hexv = (1014 - ((potvali + hexpass) / 2));
   // vc = (((hexv) * (.0139475)) * ((hexv) * (.0139475)) * ((hexv) * (.0139475)));
   vc = (sq (sq((hexv) * (.006912))));
   vc = (vc / 1000); 
   vc = vc + .74;
   if (vc > v) { v = vc ; }
   else { if (decel = 1) { v = vc; }
  // vcf = v - vc;
   //if (vcf > .45) { v = (v - .005); }
   }
   
  }
  
     ahdatu[y] = (ahdat[y] * v);
     if ((ahdatu[y]) >= (250)) { ahdatu[y] = 255 ; }
     aldatu[y] = (aldat[y] * v);
     if ((aldatu[y]) >= (250)) { aldatu[y] = 255 ; }
     bhdatu[y] = (bhdat[y] * v);
     if ((bhdatu[y]) >= (250)) { bhdatu[y] = 255 ; }
     bldatu[y] = (bldat[y] * v);
     if ((bldatu[y]) >= (250)) { bldatu[y] = 255 ; }
     chdatu[y] = (chdat[y] * v);
     if ((chdatu[y]) >= (250)) { chdatu[y] = 255 ; }
     cldatu[y] = (cldat[y] * v);
     if ((cldatu[y]) >= (250)) { cldatu[y] = 255 ; }
    
  
  
   hexinverter();
   }
   
  void hexinverter() {

  analogWrite(ahigh, (ahdatu[y]));
  analogWrite(alow, (aldatu[y]));
  analogWrite(bhigh, (bhdatu[y]));
  analogWrite(blow, (bldatu[y]));
  analogWrite(chigh, (chdatu[y]));
  analogWrite(clow, (cldatu[y]));
  delayMicroseconds(hexdrive);
  if (y >= 60) { y = (0); }
}

As you can see I am not a real slick programer. It seemed to me that those example codes had to do with software serial and playing music. I just want to make all the PWM the same except a pair of them to drive the inverter that runs the drive pump. Leaf Labs Maple will do this line for line just have to rename the timers and swap a pin or two. So it looks like there will no open source arduino electric car it will be a Leaf Labs car. Provably I am trying to do something that should not be done, and am not the one who should be doing it anyway. My Grandfather said that anything worth doing will involve sweat. So far all due has yeald is a head ache. I did however win the bet with my friend and made a truck move with electricity, it will be a maple that takes it out on the town.

Thank you all,
James