I need do float pid calculation and write: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D //all var are float type, in bank1,,, int pid(int error, int pv) { output=3D(float)error/pid_devide_value_into_percent; =20 = output_i+=3Dpid_ki*((float)(error+error_0)/((float)2*pid_devide_value_int= o_percent))*pid_delta_t;=20 if(output_i>pid_i_max)output_i=3Dpid_i_max; if(output_i100)output=3D100; //over may cause nagtive then 0 run_value if(output<0)output=3D0;=20 return output; //////////////////////////bbbbbbbbbbbbbbbbb } =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D it works fine in f877a. then I tried to put into f876a, got = problem,,,//////////////bbbbbbbbbbbb:::always is 100... then I tried one f874a. all other works, /////bbbbb problem not existing = any more. but got problem at //////aaaaaaaaaaaaaaa, output_i reach 0.3 stop to increas and then decreas, stay at = 0.01........ why is like this?????????? picc v802 pl1` compiled.... _______________________________________________ http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist