Changeset 12221
- Timestamp:
- 10/20/11 17:52:22 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/feedback.cc
r12187 r12221 183 183 return; 184 184 185 const double diff = (25-avg)*0.057; 185 avg /= num; 186 187 188 const float diff = (avg-25)*0.057; 186 189 187 190 vector<float> vec(2*BIAS::kNumChannels); … … 351 354 // Kd = 0; 352 355 353 // -110 / -110 (-23 DAC / -0.51V)354 // Reference voltage: -238 / -203355 // -360 / -343 ( 23 DAC / 0.51V)356 357 // 0.005 A/V358 // 220 Amplitude / 1V359 360 // Gain = 1V / 200 = 0.005361 362 356 // => Kp = 0.01 * gain = 0.00005 363 357 // => Ki = 0.8 * gain/20s = 0.00025 364 358 // => Kd = 0.1 * gain/20s = 0.00003 365 359 366 //valarray<double> correction = - Kp*(PV[2] - PV[1]) + Ki * dT * (SP-PV[2]) - Kd/dT * (PV[2] - 2*PV[1] + PV[0]); 360 //valarray<double> correction = 361 // - Kp * (PV[2] - PV[1]) 362 // + dT * Ki * (SP - PV[2]) 363 // - Kd / dT * (PV[2] - 2*PV[1] + PV[0]); 364 // 365 // - (Kp+Kd/dT1) * (PV[2] - PV[1]) 366 // + dT2 * Ki * (SP - PV[2]) 367 // + Kd / dT1 * (PV[1] - PV[0]); 368 // 369 // - Kp * (PV[2] - PV[1]) 370 // + Ki * (SP - PV[2])*dT 371 // - Kd * (PV[2] - PV[1])/dT 372 // + Kd * (PV[1] - PV[0])/dT; 373 // 367 374 //valarray<double> correction = 368 375 // - Kp*(PV[2] - PV[1]) + Ki * T21 * (SP-PV[2]) - Kd*(PV[2]-PV[1])/T21 - Kd*(PV[0]-PV[1])/T01; … … 373 380 + fKd/T10*(fPV[1]-fPV[0]) 374 381 ); 382 383 /* 384 integral = 0 385 start: 386 integral += (fSP - fPV[2])*dt 387 388 output = Kp*(fSP - fPV[2]) + Ki*integral - Kd*(fPV[2] - fPV[1])/dt 389 390 wait(dt) 391 392 goto start 393 */ 375 394 376 395 vector<float> vec(2*BIAS::kNumChannels); … … 725 744 return 1; 726 745 } 746 747 // -110 / -110 (-23 DAC / -0.51V) 748 // Reference voltage: -238 / -203 749 // -360 / -343 ( 23 DAC / 0.51V) 750 751 // 0.005 A/V 752 // 220 Amplitude / 1V 753 754 // Gain = 1V / 200 = 0.005 727 755 728 756 fGain = 5; // (BIAS)V / (DRS)V ( 1V / 0.22V ) … … 794 822 void PrintHelp() 795 823 { 824 Main::PrintHelp<StateMachineFeedback>(); 825 796 826 /* Additional help text which is printed after the configuration 797 827 options goes here */
Note:
See TracChangeset
for help on using the changeset viewer.