limit spooling speed
This commit is contained in:
5
spule.c
5
spule.c
@@ -33,7 +33,6 @@ void timer5_init()
|
||||
OCR5C = 500;
|
||||
|
||||
DDRL |= 1 << 5;
|
||||
|
||||
}
|
||||
|
||||
void do_spule(){
|
||||
@@ -58,6 +57,10 @@ void do_spule(){
|
||||
else{
|
||||
/* speed regulation - keep taenzer at 10% */
|
||||
int32_t tmp = (100 - (int32_t)taenzer_state.pos/1000)*10;
|
||||
|
||||
if(tmp < -75000/abzug_speed/2)
|
||||
tmp = -75000/abzug_speed/2;
|
||||
|
||||
ICR5=75000/abzug_speed + tmp;
|
||||
OCR5C = ICR5/2;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user