PWM regelung Kategorie: Programmierung (von Guido - 11.07.2004 18:08) | ||
| ||
Hallo ich habe mal wieder ein Problem und hoffe Ihr könnt mir helfen. Ich habe einen thread geschrieben der mir zwei Pumpen über PWM steuern soll. Leider habe ich folgendes Problem die Pumpen werden ca 30 sec angesteuert und dann 30 sec nicht.?? hier der code zu meonem proggi thread main { int t1, t2, t3, t4 ; byte tim1, minute1; plm.settimebase(0,5); plm.settimebase(1,5); plm.setmode(0,0); plm.setmode(1,0); plm.setperiod(0,15000); plm.setperiod(1,15000); plm.out(0,regelung3.plm1); plm.out(1,regelung3.plm2); loop { t1=tempaus.value[4];//Holzkessel t3=tempaus.value[0];// �lkessel tim1=0; minute1=system.second(); while tim1<30 { wait minute1!=system.second(); minute1=system.second(); tim1=tim1+1; } t2=tempaus.value[4]; //Holzkessel t3=tempaus.value[0]; //�lkessel if t1 //drehz hoch P1 regelung3.plm1=regelung3.plm1+10; if regelung3.plm1<30 regelung3.plm1=30; regelung3.plm1=regelung3.plm1*150-1; plm.out(0,regelung3.plm1); } if t2 regelung3.plm1=regelung3.plm1-10; if regelung3.plm1<30 regelung3.plm1=30; regelung3.plm1=regelung3.plm1*150-1; plm.out(0,regelung3.plm1); //drehz runter P1 } if pcf.get(000,2)!=0 plm.out(0,0); if t3 regelung3.plm2=regelung3.plm2+10; if regelung3.plm2<30 regelung3.plm2=30; regelung3.plm2=regelung3.plm2*150-1; plm.out(0,regelung3.plm2); //drehz hoch P2 } if t4 regelung3.plm2=regelung3.plm2-10; if regelung3.plm2<30 regelung3.plm2=30; regelung3.plm2=regelung3.plm2*150-1; plm.out(0,regelung3.plm2); //drehz runter P2 } if pcf.get(000,3)!=0 plm.out(1,0); } } danke für eure Hilfe Mfg Guido | ||
Antwort schreiben Antworten: ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |