Thanks for the link, I saw it somewhere (you probably did show me it before).
Okay, the PWM is working, it was a just mix of a bridge and and dumb mistake.
The transistor saturates nicely, and holds at 1A. The injector never reaches the 4A peak, but I don't really care about that.
This is Vce, you can see the line at Vbat, then zero when the transistor saturates, and later it comes the PWM ringing from 0 to Vzener. The zener is 33v, althoug the PWM climbs up until 37v or so.
And current graphs:
The switching frequency is high, nearly 50khz. I played for a while with two configuration resistors that have influence over the switching frequency, but it doesn't seem to do anything.
According to the datashet,
octave:33> f = (Rs/L) * (RA/RB) * (VBATT/VZ) * (1 - VBATT/VZ)
f = 3841.19790278148 hertz
I changed RB from 2ohm to 12 ohm, and could't notice the difference, so something weird is happening in there. I always see 50khz. I'll check the behavior of the 2N6045 just to make sure is not a difference in the SMT darlington.
50 commutations per milisecond is a lot, and unnecessary given the mass and inductance of an injector, hence the efforts trying to make it slower. I'd like 10khz to 15khz. Keep in mind its a 37v excursion. Also, I find higher frequencies harder to filter, and lots of stuff that I don't like could appear everywhere.
Its cold outside (6°C) to do a temperature test. Probably because its 3:41 am in the winter. I like winter, but these things are noisy and I don't want to bother my neighbors with this, this late. Tomorrow I'l put the board working for a while to see the temperature rise of the transistor, and especially of the zener.
So, slow down the frequency, then check temperatures, then measure noise in the test board, in the mbed, at the battery, and in different grounds of the car. I believe noise won't be a problem having the dirty/clean ground setup, many folks do this out in the field.
Also, thanks jim for the mail, I read it but at that time I didn't try anything of this to write a worthy reply :-)