DIY EBC for £10 up and running successfully - circuit and code here
#31
Scooby Regular
Thread Starter
Join Date: Nov 2000
Location: 32 cylinders and many cats
Posts: 18,658
Likes: 0
Received 1 Like
on
1 Post
![Post](images/icons/icon1.gif)
The problem is the prescaler is tied to that of Timer1 from reading the manual as I read it the first time. So to keep PWM 8 bit (MUCH easier) and the right frequency I am a bit limited with Timer0. I'll look again later at the manual.
#32
Scooby Regular
Join Date: Jul 2000
Location: Lancashire
Posts: 2,209
Likes: 0
Received 0 Likes
on
0 Posts
![Post](images/icons/icon1.gif)
John,
I assume you are refering to the sentence:
on Page 32 of the 90S4433 Datasheet.
I took this to mean that each timer could select prescaling independently of the other.
I also made some grave errors in my calculations, the overflow will be needed to get the lower RPM range pulse intervals even using a prescaler of 1024 on timer0.
Andrew...
I assume you are refering to the sentence:
Timer/Counters 0 and 1 have individual prescaling selection from the same 10-bit prescaling timer.
I took this to mean that each timer could select prescaling independently of the other.
I also made some grave errors in my calculations, the overflow will be needed to get the lower RPM range pulse intervals even using a prescaler of 1024 on timer0.
Andrew...
#33
Scooby Regular
Thread Starter
Join Date: Nov 2000
Location: 32 cylinders and many cats
Posts: 18,658
Likes: 0
Received 1 Like
on
1 Post
![Post](images/icons/icon1.gif)
You are right. Yes I saw that earlier after I had posted and confused myself, and was trying to work it out before I posted again!
Help me with this then - if we have 8MHz, with 1024 prescaler then the counter is running at 7812.5 KHz.
800 RPM is 13.3Hz, 8000 RPM is 133Hz. This means 587 cycles of the 7812.5 KHz clock for 800 RPM (so there would be overflow on an 8 bit timer below about 1800 RPM) and 59 cycles for 8000 RPM.
It depends on the number of pulses per engine revolution too - if there are four pulses we are OK I think!
Help - I need some lunch before my brain melts!
Help me with this then - if we have 8MHz, with 1024 prescaler then the counter is running at 7812.5 KHz.
800 RPM is 13.3Hz, 8000 RPM is 133Hz. This means 587 cycles of the 7812.5 KHz clock for 800 RPM (so there would be overflow on an 8 bit timer below about 1800 RPM) and 59 cycles for 8000 RPM.
It depends on the number of pulses per engine revolution too - if there are four pulses we are OK I think!
Help - I need some lunch before my brain melts!
#34
Scooby Regular
Join Date: Jul 2000
Location: Lancashire
Posts: 2,209
Likes: 0
Received 0 Likes
on
0 Posts
![Post](images/icons/icon1.gif)
John,
Your math looks correct, apart from the 7812.5KHz bit (I think you mean 7812.5Hz), I am even more confused because I am trying to take the timing information and recreate an RPM figure for display on the LCD.
I am testing the RPM stuff on a 2313 @ 4MHz (you can guess why I have one of these) so I can get down to about 900RPM without the carry, however its easy to add in the extra interrupt.
I hadn't considered 4 pulses, I was assuming a crank pickup giving 1 pulse per revolution.
As I said I am going to have a play this weekend and log everything to my laptop and hopefully refine my code on the fly.
I'll let you know how I get on, however, I think it's going to be tight to get everything into 2K!
[Edited by AndrewC - 2/21/2002 3:21:29 PM]
Your math looks correct, apart from the 7812.5KHz bit (I think you mean 7812.5Hz), I am even more confused because I am trying to take the timing information and recreate an RPM figure for display on the LCD.
I am testing the RPM stuff on a 2313 @ 4MHz (you can guess why I have one of these) so I can get down to about 900RPM without the carry, however its easy to add in the extra interrupt.
I hadn't considered 4 pulses, I was assuming a crank pickup giving 1 pulse per revolution.
As I said I am going to have a play this weekend and log everything to my laptop and hopefully refine my code on the fly.
I'll let you know how I get on, however, I think it's going to be tight to get everything into 2K!
[Edited by AndrewC - 2/21/2002 3:21:29 PM]
#35
Scooby Regular
Thread Starter
Join Date: Nov 2000
Location: 32 cylinders and many cats
Posts: 18,658
Likes: 0
Received 1 Like
on
1 Post
![Post](images/icons/icon1.gif)
Due to heavy work/study commitments over the coming months, I have developed this project as far as I am intending for the forseeable future. I have been meaning to get RPM mapping and serial interface sorted out for a few months but have done nothing with it because to be honest I don't have the need and it will overcomplicate it. I am what some would say not a good "finisher".
So as it is it works very well with full closed loop PID boost control with excellent part throttle manners. The user controls are: target boost, base duty cycle, proportional gain, integral gain, differential gain. The inputs are TPS and MAP, the output is the duty cycle.
This way, no in-car programming is required and probably three pots are required - one scales all three of PID "gain", one is "duty", one is "boost". All three could have custom low and high endpoints.
If anyone does want to develop RPM coding feel free - you can see the circuit plan, the code I would suggest is an interrupt for the RPM pulse, use a 8 bit counter (Timer0) with 1024 prescaler, a timer overflow interrupt with another 8 bit variable as a counter for most sig byte, and therefore count a 16 bit 7812Hz counter for each RPM pulse, then a lookup could be:
RPM lookup = (60 * 7812) / (Count * interval)
where interval could be 500 if you want to put a value in every 500RPM, so the lookup would be a position in an array from 0, 500, 1000, 1500, 2000 RPM etc. You could do this for only boost, or for more finesse boost and duty.
There are 256 bytes of EEPROM on the chip available for you to use if you require this facility, which would be plenty even for a few maps.
For me I will be effectively using the functionality of this to the level of the Blitz, HKS EVC and GReddy controllers, but not as far as the AVC-R or HKS EVC Pro which has RPM mapping of duty cycle and boost targets. For my car I just don't need the latter, and it makes a simple project too fussy IMHO.
Now that I have finished development I will build this for my car on a small board - chip, oscillator, three resistors, one cap and three potentiometers, with a driver transistor for the solenoid. I will probably take 5V supply from ECU for the chip, and 12V from an ignition switched line for the solenoid drive.
Hope this project has interested you and is useful! I have enjoyed it and learned a lot.
So as it is it works very well with full closed loop PID boost control with excellent part throttle manners. The user controls are: target boost, base duty cycle, proportional gain, integral gain, differential gain. The inputs are TPS and MAP, the output is the duty cycle.
This way, no in-car programming is required and probably three pots are required - one scales all three of PID "gain", one is "duty", one is "boost". All three could have custom low and high endpoints.
If anyone does want to develop RPM coding feel free - you can see the circuit plan, the code I would suggest is an interrupt for the RPM pulse, use a 8 bit counter (Timer0) with 1024 prescaler, a timer overflow interrupt with another 8 bit variable as a counter for most sig byte, and therefore count a 16 bit 7812Hz counter for each RPM pulse, then a lookup could be:
RPM lookup = (60 * 7812) / (Count * interval)
where interval could be 500 if you want to put a value in every 500RPM, so the lookup would be a position in an array from 0, 500, 1000, 1500, 2000 RPM etc. You could do this for only boost, or for more finesse boost and duty.
There are 256 bytes of EEPROM on the chip available for you to use if you require this facility, which would be plenty even for a few maps.
For me I will be effectively using the functionality of this to the level of the Blitz, HKS EVC and GReddy controllers, but not as far as the AVC-R or HKS EVC Pro which has RPM mapping of duty cycle and boost targets. For my car I just don't need the latter, and it makes a simple project too fussy IMHO.
Now that I have finished development I will build this for my car on a small board - chip, oscillator, three resistors, one cap and three potentiometers, with a driver transistor for the solenoid. I will probably take 5V supply from ECU for the chip, and 12V from an ignition switched line for the solenoid drive.
Hope this project has interested you and is useful! I have enjoyed it and learned a lot.
#39
Scooby Regular
Thread Starter
Join Date: Nov 2000
Location: 32 cylinders and many cats
Posts: 18,658
Likes: 0
Received 1 Like
on
1 Post
![Post](images/icons/icon1.gif)
I am running 18.5PSI with either this or a Dawes and it flies. On track though the intake temps would be too high. On the road it is sweet, but you can't run this without a PPP ECU or raising the fuel cut.
#40
Scooby Regular
Thread Starter
Join Date: Nov 2000
Location: 32 cylinders and many cats
Posts: 18,658
Likes: 0
Received 1 Like
on
1 Post
![Cool](images/icons/icon6.gif)
It is a flying machine now
![Big Grin](images/smilies/biggrin.gif)
0% Duty cycle = 8 PSI
86% Duty cycle = 18.5 PSI
So I am going to use a single pot to control both together as the relationship seems close to linear in between.
The part throttle is much smoother and more progressive than the MBC, even more so after the new code which makes the duty cycle 0% until one throttle position, then ramps it to a second position, and after that all hell breaks loose and the PID is turned on and there is a lovely shove when you go WOT. That shove is the difference between running static duty cycles and PID and is **REALLY** worth having - you can feel it kick in and it puts the car on another plane. The standard ECU does not do this AFAIK.
Bear in mind also a 95% duty cycle on my setup is really very aggressive as I run a restrictor/actuator setup that would peak 22 PSI with the PPP boost control
The good thing is that even with such an aggressive setup it can be controlled with the PID algorithm with surprising quality.
It might be holding a little more boost at the top end too than the Dawes. I think this might be because of the bleed hole on the Dawes being a bit "dumb" whereas the duty cycle is ramped high to hold boost. It might just be the cold evening and placebo.
Overall very happy with it. I will run four pots tomorrow to set DC & target on number 1, P on number 2, D on number 3 and I on number 4.
As Cosie Convert said a bit of peak boost is nice, and will be fiddling with dial 2 to experiment![Big Grin](images/smilies/biggrin.gif)
Just hope the gearbox stands up - a few more noises than normal tonight after changing up![EEK!](images/smilies/eek.gif)
[Edited by john banks - 3/23/2002 11:16:58 PM]
![Big Grin](images/smilies/biggrin.gif)
![Big Grin](images/smilies/biggrin.gif)
![Big Grin](images/smilies/biggrin.gif)
0% Duty cycle = 8 PSI
86% Duty cycle = 18.5 PSI
So I am going to use a single pot to control both together as the relationship seems close to linear in between.
The part throttle is much smoother and more progressive than the MBC, even more so after the new code which makes the duty cycle 0% until one throttle position, then ramps it to a second position, and after that all hell breaks loose and the PID is turned on and there is a lovely shove when you go WOT. That shove is the difference between running static duty cycles and PID and is **REALLY** worth having - you can feel it kick in and it puts the car on another plane. The standard ECU does not do this AFAIK.
Bear in mind also a 95% duty cycle on my setup is really very aggressive as I run a restrictor/actuator setup that would peak 22 PSI with the PPP boost control
![EEK!](images/smilies/eek.gif)
It might be holding a little more boost at the top end too than the Dawes. I think this might be because of the bleed hole on the Dawes being a bit "dumb" whereas the duty cycle is ramped high to hold boost. It might just be the cold evening and placebo.
Overall very happy with it. I will run four pots tomorrow to set DC & target on number 1, P on number 2, D on number 3 and I on number 4.
As Cosie Convert said a bit of peak boost is nice, and will be fiddling with dial 2 to experiment
![Big Grin](images/smilies/biggrin.gif)
Just hope the gearbox stands up - a few more noises than normal tonight after changing up
![EEK!](images/smilies/eek.gif)
[Edited by john banks - 3/23/2002 11:16:58 PM]
#41
![Thumbs up](images/icons/icon14.gif)
Sounds good John
How about a bit of before and after power datalogging with my AP22 ?
I could pop across tomorrow if you are free ? You can feel free to do that comparator mod to my knocklink too
![Smile](images/smilies/smile.gif)
I could pop across tomorrow if you are free ? You can feel free to do that comparator mod to my knocklink too
![Wink](images/smilies/wink.gif)
#43
Scooby Regular
Thread Starter
Join Date: Nov 2000
Location: 32 cylinders and many cats
Posts: 18,658
Likes: 0
Received 1 Like
on
1 Post
![Post](images/icons/icon1.gif)
After a good few hours of fiddling it is hunting for 18 PSI with surprising accuracy in every gear. Few experiments with part throttle to do, but overall it is pretty quick
It holds boost at the upper midrange substantially better (=faster) than the Dawes - we think this is because the Dawes is a proportional controller near to target. We have also abandoned differential control without penalty, and simpler setup ![Smile](images/smilies/smile.gif)
We reduced the spark plug gap to 0.6mm to reduce the on boost hesitation, and also loosened the actuator again (I had previously tightened it 4 turns), as the controller was struggling to keep away from fuel cut on a few occasions.
![](http://upload.turbosport.co.uk/gallery3/2002324165128502865.gif)
Power at wheels in 3rd gear shown after gentle run in 1st and 2nd on Race Technology. Sadly the other graphs did not come out to give comparisons, so it is a little meaningless except that it extrapolates to 293 BHP flywheel based on 18% drivetrain losses - for pub talk only.
[Edited by john banks - 3/24/2002 5:16:19 PM]
![Big Grin](images/smilies/biggrin.gif)
![Smile](images/smilies/smile.gif)
We reduced the spark plug gap to 0.6mm to reduce the on boost hesitation, and also loosened the actuator again (I had previously tightened it 4 turns), as the controller was struggling to keep away from fuel cut on a few occasions.
![](http://upload.turbosport.co.uk/gallery3/2002324165128502865.gif)
Power at wheels in 3rd gear shown after gentle run in 1st and 2nd on Race Technology. Sadly the other graphs did not come out to give comparisons, so it is a little meaningless except that it extrapolates to 293 BHP flywheel based on 18% drivetrain losses - for pub talk only.
[Edited by john banks - 3/24/2002 5:16:19 PM]
#44
![Lightbulb](images/icons/icon3.gif)
John
To run a system like this on a car running higher levels of boost or an FCD (ie mine
) I assume you could not use the original MAP signal for control purposes.
I have found a pressure transducer in RS which may work, Pt No 286-670 0-30psi £19.35. Do you think the voltage signal from this would be suitable ? If so, then it could be housed in the PCB enclosure for neatness
To run a system like this on a car running higher levels of boost or an FCD (ie mine
![Big Grin](images/smilies/biggrin.gif)
I have found a pressure transducer in RS which may work, Pt No 286-670 0-30psi £19.35. Do you think the voltage signal from this would be suitable ? If so, then it could be housed in the PCB enclosure for neatness
![Smile](images/smilies/smile.gif)
#45
Scooby Regular
Thread Starter
Join Date: Nov 2000
Location: 32 cylinders and many cats
Posts: 18,658
Likes: 0
Received 1 Like
on
1 Post
![Post](images/icons/icon1.gif)
Seems ideal - by resistive I take it that you apply a voltage and get back a proportion of it based on a linear relationship to pressure (with an offset) of style Voltage = X * Pressure + C where X and C are constants. This is how I understand the factory 3 bar MAP sensor to work. But I can't seem to get the datasheets to download presently.
So this would be a solution for cars without MAP sensors or those where an unmolested signal is unavailable (ie mechanical type fuel cut defender - you know who you are
)
So this would be a solution for cars without MAP sensors or those where an unmolested signal is unavailable (ie mechanical type fuel cut defender - you know who you are
![Big Grin](images/smilies/biggrin.gif)
![Wink](images/smilies/wink.gif)
#46
![Post](images/icons/icon1.gif)
Who me? ![Stick Out Tongue](images/smilies/tongue.gif)
Could you not just use the MAP signal before it enters the FCD?
i.e. feed the EBC the true signal and feed the ECU the duff one..
Edited to say understand, CC has bleed in MAP hose, silly me
[Edited by Paul_H - 3/25/2002 5:53:09 PM]
![Stick Out Tongue](images/smilies/tongue.gif)
Could you not just use the MAP signal before it enters the FCD?
i.e. feed the EBC the true signal and feed the ECU the duff one..
Edited to say understand, CC has bleed in MAP hose, silly me
[Edited by Paul_H - 3/25/2002 5:53:09 PM]
#47
Scooby Regular
Thread Starter
Join Date: Nov 2000
Location: 32 cylinders and many cats
Posts: 18,658
Likes: 0
Received 1 Like
on
1 Post
![Post](images/icons/icon1.gif)
Most of the issues seem sorted now, just need to drive around with it for a while on the development board before building the proper version. Certainly the part throttle is sorted and smooth through all transitions. An odd missing sensation that was different to that caused by the spark plug gap being too wide is also resolved. You can have 18 PSI in 2nd to 5th gears
Tried 19 PSI and it did not feel as good as 18. Also managed to stop the fuel cuts by sorting out an sign error in the integration code that occasionally caused it to go mad, but it was doing it so quickly that the gauge didn't catch it in time.
Certainly the control is now good enough that I can completely trust it in the dark running held boost within 1 PSI of fuel cut, in the wet with an unlit boost gauge at full throttle on the back roads![Big Grin](images/smilies/biggrin.gif)
The centre console CD/cup holder makes quite a nice enclosure for the two circuit boards
and the whole lot is powered off the ciggie lighter at present ![Smile](images/smilies/smile.gif)
I think I will end up with one control **** which adjusts from 14 to 18 PSI to keep it all very simple.
![Big Grin](images/smilies/biggrin.gif)
Certainly the control is now good enough that I can completely trust it in the dark running held boost within 1 PSI of fuel cut, in the wet with an unlit boost gauge at full throttle on the back roads
![Big Grin](images/smilies/biggrin.gif)
The centre console CD/cup holder makes quite a nice enclosure for the two circuit boards
![Big Grin](images/smilies/biggrin.gif)
![Smile](images/smilies/smile.gif)
I think I will end up with one control **** which adjusts from 14 to 18 PSI to keep it all very simple.
#48
![Post](images/icons/icon1.gif)
john,
is this missing feeling the same as I got at K/hill at 18psi.only happened twice and was definitely not fuel cut (before anyone asks).turned boost down to 16.5psi and never happened again.
is this missing feeling the same as I got at K/hill at 18psi.only happened twice and was definitely not fuel cut (before anyone asks).turned boost down to 16.5psi and never happened again.
#49
Scooby Regular
Thread Starter
Join Date: Nov 2000
Location: 32 cylinders and many cats
Posts: 18,658
Likes: 0
Received 1 Like
on
1 Post
![Post](images/icons/icon1.gif)
There were three different problems. 1. spark plug gap. 2 integration sign error. (both now fixed). 3. problem like 1 if you go too far with the boost. Seems OK at 18.
#50
Scooby Regular
Thread Starter
Join Date: Nov 2000
Location: 32 cylinders and many cats
Posts: 18,658
Likes: 0
Received 1 Like
on
1 Post
![Post](images/icons/icon1.gif)
THE CODE
http://www.i-club.com/forums/attachm...postid=1454274
THE CIRCUIT
![](http://www.i-club.com/forums/attachment.php?s=&postid=1454322)
EDIT -the transistor is a TIP122 not 127 sorry for the typo.
PLUS A CIRCUIT DRAWN A BIT BETTER (by WaC from I-club with plans for surface mount)
Zipped PDF (obscure but I-club doesn't take PDFs as attachments)
http://www.i-club.com/forums/attachm...postid=1454351
[Edited by john banks - 2/5/2002 9:47:00 AM]
http://www.i-club.com/forums/attachm...postid=1454274
THE CIRCUIT
EDIT -the transistor is a TIP122 not 127 sorry for the typo.
PLUS A CIRCUIT DRAWN A BIT BETTER (by WaC from I-club with plans for surface mount)
Zipped PDF (obscure but I-club doesn't take PDFs as attachments)
http://www.i-club.com/forums/attachm...postid=1454351
[Edited by john banks - 2/5/2002 9:47:00 AM]
#51
Scooby Regular
Join Date: Jun 2002
Location: Scotland
Posts: 1,664
Likes: 0
Received 0 Likes
on
0 Posts
![Post](images/icons/icon1.gif)
I know the dust has loooong since settled on this thread, but it came up in a search so I'm curious to see how this project has went for those who used it originally. It took place before I came into the scooby fold and all the i-club threads are now dead so if anyone has copies of the original info that would be useful.
With the benefit of hindsight would this be a better solution than a Dawes for a MY97 UK car?
Paul
With the benefit of hindsight would this be a better solution than a Dawes for a MY97 UK car?
Paul
![Smile](images/smilies/smile.gif)
#52
![Cool](images/icons/icon6.gif)
Paul
Try changing the url for the i-club threads from http://www.i-club.comblahblah to http://www.nasioc.comblahblah. i-Club lost out on the use of its name and has changed to North American Subaru Impreza Owners Club.
As for using it, well I think John blew most peoples minds, and then along came EcuTek which gives a better map as well as more boost.
Duncan
Try changing the url for the i-club threads from http://www.i-club.comblahblah to http://www.nasioc.comblahblah. i-Club lost out on the use of its name and has changed to North American Subaru Impreza Owners Club.
As for using it, well I think John blew most peoples minds, and then along came EcuTek which gives a better map as well as more boost.
Duncan
![Wink](images/smilies/wink.gif)
#53
Scooby Regular
Thread Starter
Join Date: Nov 2000
Location: 32 cylinders and many cats
Posts: 18,658
Likes: 0
Received 1 Like
on
1 Post
![Post](images/icons/icon1.gif)
As Duncan says with Ecutek. It was better than the Dawes in that it controlled boost well but gave very smooth part throttle. I moved onto a fuel cut lifter using the ECU to control boost closed loop at a higher level, then Ecutek, then a 3 port solenoid with Ecutek which is the best yet.
If you want an easy smooth driving solution find the DIY FCD threads and use the ECU to control boost at a higher level.
If you want an easy smooth driving solution find the DIY FCD threads and use the ECU to control boost at a higher level.
#54
Scooby Regular
Join Date: Jun 2002
Location: Scotland
Posts: 1,664
Likes: 0
Received 0 Likes
on
0 Posts
![Post](images/icons/icon1.gif)
Ecutek does sound like a better solution but isn't an option for me with a MY97 ECU. Probably the worst version to tune the ECU since pre 96 have the DIY remap thing as well. Can't afford a Link/Motec etc hence why I found this thread quite interesting.
BTW I'm not sure I'd need to raise fuel cut, am I correct in saying the MY97 runs 0.9 bar standard and has fuel cut at 1.15 or 1.2 bar? Since the turbo is a TD04 I wouldn't be looking for much of an increase (say 1.1 bar), more interested in getting the boost in earlier although even at present I quite like the characteristics of the TD04 since it starts producing usable boost around 2000 and feels like full boost at 3000.
Thanks for the info, I'm off to look up some of the threads from the defunct i-club now. PS Why does i-Club still have an Impreza forum if they lost the rights to the name?
Cheers.
BTW I'm not sure I'd need to raise fuel cut, am I correct in saying the MY97 runs 0.9 bar standard and has fuel cut at 1.15 or 1.2 bar? Since the turbo is a TD04 I wouldn't be looking for much of an increase (say 1.1 bar), more interested in getting the boost in earlier although even at present I quite like the characteristics of the TD04 since it starts producing usable boost around 2000 and feels like full boost at 3000.
Thanks for the info, I'm off to look up some of the threads from the defunct i-club now. PS Why does i-Club still have an Impreza forum if they lost the rights to the name?
Cheers.
#55
Scooby Regular
Join Date: Jun 2002
Location: Scotland
Posts: 1,664
Likes: 0
Received 0 Likes
on
0 Posts
![Post](images/icons/icon1.gif)
Just re-read your reply and I'm guessing I may have misinterpreted it. Are you saying the FCD will actually control the boost even if I don't need to remove fuel-cut? TBH I'd like to leave the standard fuel cut in place (at least for now) since it's a good safety net if anything goes ****-up
![Smile](images/smilies/smile.gif)
#56
Scooby Regular
Thread Starter
Join Date: Nov 2000
Location: 32 cylinders and many cats
Posts: 18,658
Likes: 0
Received 1 Like
on
1 Post
![Post](images/icons/icon1.gif)
Yes, it also makes sense to run a higher fuel cut if you are running higher held boost. Watch out for injector maxxing out and get a knocklink and AFR to be safe.
Thread
Thread Starter
Forum
Replies
Last Post
Mattybr5@MB Developments
Full Cars Breaking For Spares
28
28 December 2015 11:07 PM