|
Kirjoittaja |
Viesti |
longgo
|
Viestin otsikko: VDO Marelli Idle motor driver Lähetetty: 30.09.2016 11:17 |
Viestit: 23 Paikkakunta: Rauma
|
Hi Have you ever try to clean that sh*t VDO Marelli? Yep, is much more easy if you have something to drive it at home. Taking piston out, moving both ways, check for noise and so on. Here is my "test bench" - 1 x test board - 1 x arduino UNO - 2 x push buttons - 2 x 10k resistors - 1 x L293D driver - some wires  Code for arduino is: Koodi: #define motor_pin_1 2 //arduino digital 2 #define motor_pin_2 3 //arduino digital 3 #define motor_pin_3 4 //arduino digital 4 #define motor_pin_4 5 //arduino digital 5
int spin[32] = { 1,0,0,0, 1,0,1,0, 0,0,1,0, 0,1,1,0, 0,1,0,0, 0,1,0,1, 0,0,0,1, 1,0,0,1 };
void setup(){ pinMode(motor_pin_1,OUTPUT); pinMode(motor_pin_2,OUTPUT); pinMode(motor_pin_3,OUTPUT); pinMode(motor_pin_4,OUTPUT); pinMode(8,INPUT); pinMode(9,INPUT); }
void loop(){ if(digitalRead(8) == HIGH){ forward(1,3); } if(digitalRead(9) == HIGH){ backward(1,3); } }
void forward(int rep,int dly){ for(int x=0; x<rep;x++){ for(int t=0; t<32; t+=4){ digitalWrite(motor_pin_1, spin[t]); digitalWrite(motor_pin_2, spin[t+1]); digitalWrite(motor_pin_3, spin[t+2]); digitalWrite(motor_pin_4, spin[t+3]); delay(dly); } } digitalWrite(motor_pin_1, LOW); digitalWrite(motor_pin_2, LOW); digitalWrite(motor_pin_3, LOW); digitalWrite(motor_pin_4, LOW); }
void backward(int rep,int dly){ for(int x=0; x<rep;x++){ for(int t=32; t>=0; t-=4){ digitalWrite(motor_pin_1, spin[t]); digitalWrite(motor_pin_2, spin[t+1]); digitalWrite(motor_pin_3, spin[t+2]); digitalWrite(motor_pin_4, spin[t+3]); delay(dly); } } digitalWrite(motor_pin_1, LOW); digitalWrite(motor_pin_2, LOW); digitalWrite(motor_pin_3, LOW); digitalWrite(motor_pin_4, LOW); }
And some video in "action" http://www.youtube.com/watch?v=w8tOh3dsAzU
Let the LHM be with you... Citroen C5 mk2 2.0 16v RFJ KIA Ceed
|
|
|
|
 |
ds-jekkeri
|
Viestin otsikko: Re: VDO Marelli Idle motor driver Lähetetty: 30.09.2016 13:31 |
Viestit: 2666
|
nice project. well done
Miehellä on elämässään yksi suuri valinta; harrastaako huonoja naisia vai huonoja autoja.
|
|
|
|
 |
zemial
|
Viestin otsikko: Re: VDO Marelli Idle motor driver Lähetetty: 01.10.2016 09:25 |
Viestit: 182
|
|
|
|
 |
longgo
|
Viestin otsikko: Re: VDO Marelli Idle motor driver Lähetetty: 12.12.2016 18:09 |
Viestit: 23 Paikkakunta: Rauma
|
And to shrink little more the project: - Atmel tiny 85 (@ 16Mghz / 4.8V - PLL) - L293D - 10k , 22k, 220k - 2x push buttons - 7805 , 1uF , 10F caps Liitteet:
att85.jpg [ 54.65 KiB | Katsottu 6586 kertaa ]
Koodi: #define motor_pin_1 0 // pin 5 coil 1 #define motor_pin_2 1 // pin 6 coil 1 #define motor_pin_3 3 // pin 2 coil 2 #define motor_pin_4 4 // pin 3 coil 2
int spin[32] = { 1,0,0,0, 1,0,1,0, 0,0,1,0, 0,1,1,0, 0,1,0,0, 0,1,0,1, 0,0,0,1, 1,0,0,1 };
void setup(){ pinMode(motor_pin_1,OUTPUT); pinMode(motor_pin_2,OUTPUT); pinMode(motor_pin_3,OUTPUT); pinMode(motor_pin_4,OUTPUT); }
void loop(){ int buttonRead = analogRead(A1); delay(5); if(buttonRead > 10 && buttonRead < 200){ backward(); }else if(buttonRead > 200 && buttonRead < 600){ forward(); }else{ park(); } }
void forward(){ for(int t=0; t<32; t+=4){ digitalWrite(motor_pin_1, spin[t]); digitalWrite(motor_pin_2, spin[t+1]); digitalWrite(motor_pin_3, spin[t+2]); digitalWrite(motor_pin_4, spin[t+3]); delay(3); } }
void backward(){ for(int z=32; z>=0; z-=4){ digitalWrite(motor_pin_1, spin[z]); digitalWrite(motor_pin_2, spin[z+1]); digitalWrite(motor_pin_3, spin[z+2]); digitalWrite(motor_pin_4, spin[z+3]); delay(3); } }
void park(){ digitalWrite(motor_pin_1, LOW); digitalWrite(motor_pin_2, LOW); digitalWrite(motor_pin_3, LOW); digitalWrite(motor_pin_4, LOW); }
Let the LHM be with you... Citroen C5 mk2 2.0 16v RFJ KIA Ceed
|
|
|
|
 |
|
|