Changeset 12160 for trunk/FACT++/src/feedback.cc
- Timestamp:
- 10/02/11 13:28:28 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/feedback.cc
r12067 r12160 301 301 // Kd = 0; 302 302 303 // -110 / -110 (-23 DAC / -0.51V)304 // Reference voltage: -238 / -203305 // -360 / -343 ( 23 DAC / 0.51V)306 307 // 0.005 A/V308 // 220 Amplitude / 1V309 310 // Gain = 1V / 200 = 0.005311 312 303 // => Kp = 0.01 * gain = 0.00005 313 304 // => Ki = 0.8 * gain/20s = 0.00025 314 305 // => Kd = 0.1 * gain/20s = 0.00003 315 306 316 //valarray<double> correction = - Kp*(PV[2] - PV[1]) + Ki * dT * (SP-PV[2]) - Kd/dT * (PV[2] - 2*PV[1] + PV[0]); 307 //valarray<double> correction = 308 // - Kp * (PV[2] - PV[1]) 309 // + dT * Ki * (SP - PV[2]) 310 // - Kd / dT * (PV[2] - 2*PV[1] + PV[0]); 311 // 312 // - (Kp+Kd/dT1) * (PV[2] - PV[1]) 313 // + dT2 * Ki * (SP - PV[2]) 314 // + Kd / dT1 * (PV[1] - PV[0]); 315 // 316 // - Kp * (PV[2] - PV[1]) 317 // + Ki * (SP - PV[2])*dT 318 // - Kd * (PV[2] - PV[1])/dT 319 // + Kd * (PV[1] - PV[0])/dT; 320 // 317 321 //valarray<double> correction = 318 322 // - Kp*(PV[2] - PV[1]) + Ki * T21 * (SP-PV[2]) - Kd*(PV[2]-PV[1])/T21 - Kd*(PV[0]-PV[1])/T01; … … 324 328 ); 325 329 330 /* 331 integral = 0 332 start: 333 integral += (fSP - fPV[2])*dt 334 335 output = Kp*(fSP - fPV[2]) + Ki*integral - Kd*(fPV[2] - fPV[1])/dt 336 337 wait(dt) 338 339 goto start 340 */ 341 326 342 vector<float> vec(2*BIAS::kNumChannels); 327 343 for (int i=0; i<BIAS::kNumChannels; i++) … … 337 353 Info("Sending correction to feedback."); 338 354 339 dic_cmnd_service((char*)"BIAS_CONTROL/ADD_REFERENCE_VOLTAGES",340 (void*)(vec.data()+416), 416*sizeof(float));355 DimClient::sendCommandNB("BIAS_CONTROL/ADD_REFERENCE_VOLTAGES", 356 (void*)(vec.data()+416), 416*sizeof(float)); 341 357 342 358 /* … … 607 623 return 1; 608 624 } 625 626 // -110 / -110 (-23 DAC / -0.51V) 627 // Reference voltage: -238 / -203 628 // -360 / -343 ( 23 DAC / 0.51V) 629 630 // 0.005 A/V 631 // 220 Amplitude / 1V 632 633 // Gain = 1V / 200 = 0.005 609 634 610 635 fGain = 5; // (BIAS)V / (DRS)V ( 1V / 0.22V ) … … 676 701 void PrintHelp() 677 702 { 703 Main::PrintHelp<StateMachineFeedback>(); 704 678 705 /* Additional help text which is printed after the configuration 679 706 options goes here */
Note:
See TracChangeset
for help on using the changeset viewer.