Members Login
Username 
 
Password 
    Remember Me  
Post Info TOPIC: Nitrous and boost solendoid duty cycle control


Guru

Status: Offline
Posts: 2338
Date:
Nitrous and boost solendoid duty cycle control



During past few week I have been thinking at the back of the head about what is the best control mechanism for nitrous and boost solenoid control. So lets document here the thinking process so far.


Initially I was thinking the same method as with shifter, just hang it into the main loop and at every trigger cycle calculate based on the rpm if the duty cycle should be on or off. Anyway I have been hesitant to add any more stuff to the main loop just knowing how critical the timer calculations particularly for ignition pulses are.


Alternatively I have been thinking about adding a new timer to the ECU and use that, but once again without fully understanding how ATU (sh7052 timer) is programmed and what parts of the code are dependent on what I feel that its not really a good idea to add any more timers.

Today it suddenly come into the mind - an alternate way of hanging the duty control for a solenoid. There is already a couple of interrupts that are executed based on the timer function. One is for reading the AD sensors and other is for outputting the gauge data which may anyhow be just a bit too slow for solenoid control. Anyhow it feels very natural to hang the solenoid duty control algorithm to something that is executed at less fast intervals than fuel and ignition calculation.


Good place to start could be the either of the AD conversion loops to check out how often those are executed...
ROM:000002F8                 .data.l IRQ_ADIO_loc_254A
ROM:00000308                 .data.l IRQ_ADI1_loc_25B4


Then the second thing comes down to how the solenoid could be physically connected to the ecu. In practise there is a few options:
1) Airbox flap control output
2) Pair control output and Exhaust sensor power output (but these are avail for EU ecus only)
3) Using any of the Yoshbox input pins after checking if any can be used for output depending on how the the circuitry on the pch is done


Easiest would be the airbox flap control output, but then we loose the shift light etc in US models. With EU models the shift light is preferred to be connected to Pair control output anyway and flap control signal is used for window switch so if we are talking about nitrous control its just reusing the airbox flap control for a bit more advanced nitrous control. Unless a major discovery about yoshbox is done then I will most likely go for airbox flap control output.


So this is the starting point...



__________________

When asking a question, you can also consider posting it to facebook:

http://www.facebook.com/ecueditorcom



Guru

Status: Offline
Posts: 2338
Date:

AD conversion seems to be triggered by external input, not a timer. Need to find an alternative.

ROM:00003052                 mov     #0, r4
ROM:00003054                 mov.b   r4, @r6
ROM:00003056                 mov.w   @(h'7A,pc), r7 ; [000030D4] = h'FF
ROM:00003058                 mov.w   @(h'7A,pc), r3 ; [000030D6] = h'F76E ; ADTRG0
ROM:00003058                                         ; bit7=ADTRG external signal triggers conversion
ROM:0000305A                 mov.b   r7, @r3
ROM:0000305C                 add     #h'21, r6 ; '!'
ROM:0000305E                 mov.b   @r6, r2
ROM:00003060                 mov.b   r5, @r6
ROM:00003062                 mov.w   @(h'72,pc), r5 ; [000030D8] = h'F838 ; ADCSR1
ROM:00003064                 mov.b   @r5, r1
ROM:00003066                 mov.b   r4, @r5
ROM:00003068                 mov.w   @(h'6E,pc), r2 ; [000030DA] = h'F72E ; ADTRG1
ROM:00003068                                         ; bit7=ADTRG external signal triggers conversion


__________________

When asking a question, you can also consider posting it to facebook:

http://www.facebook.com/ecueditorcom



Guru

Status: Offline
Posts: 2338
Date:

Lets look an option to enable one of the osi8 timer interrupts, same as gaugedata.

Channel 8 runs prescaler / 2, but only 8M and 8N are enabled.
ROM:00000284                 .data.l IRQ_OSI8J_loc_20BC
ROM:00000288                 .data.l IRQ_OSI8K_loc_20EE
ROM:0000028C                 .data.l IRQ_OSI8L_loc_2120
ROM:00000290                 .data.l IRQ_OSI8M_loc_2152 ; Gauge Data Output Interrupt
ROM:00000294                 .data.l IRQ_OSI8N_loc_2186 ; active...
ROM:00000298                 .data.l IRQ_OSI8O_loc_21E0

If e.g OSI8O is to be enabled then bit 14 needs to be added to the initialization routine.
ROM:00002E72 loc_2E72:                               ; CODE XREF: Set_timer_prescalers+1A0j
ROM:00002E72                 mov.w   @(h'D2,pc), r3 ; [00002F48] = h'F662 ; Channel 8 (ignition) Timer connection register
ROM:00002E74                 mov.w   r2, @r3
ROM:00002E76                 mov.w   @(h'D0,pc), r1 ; [00002F4A] = h'F00
ROM:00002E78                 mov.w   @(h'D0,pc), r2 ; [00002F4C] = h'F664 ; Channel 8 (ignition) one shot pulse termination register
ROM:00002E7A                 mov.w   r1, @r2
ROM:00002E7C                 mov.w   @(h'CE,pc), r0 ; [00002F4E] = h'3000 ; bit 12&13: 11 0000 0000 0000
ROM:00002E7E                 mov.w   @(h'CE,pc), r1 ; [00002F50] = h'F66C ; Timer Interrupt enable
ROM:00002E80                 mov.w   r0, @r1         ; OSI8N and OSI8M enabled

The gaugedata OSI8M seems to be used so that at the end of the each OSI8M interrupt a value of 640 is loaded to Downcounter register.
continue_loc_4124:                      ; CODE XREF: SCI3_RXI3_loc_4080:continue_loc_4114j
ROM:00004124                 sts.l   pr, @-r15
ROM:00004126                 bsr     Return_RAM_variable_values_sub_41D0
ROM:00004128                 nop
ROM:0000412A                 mov.w   @(h'1E,pc), r4 ; [0000414C] = h'F732 ; PBCRH port B control register
ROM:0000412C                 mov.l   @(h'48,pc), r3 ; [00004178] = h'FFFE ; bit 0; 1111 1111 1111 1110
ROM:0000412E                 mov.w   @r4, r2
ROM:00004130                 and     r3, r2          ; SET PB0 as general input output not driven by ATU
ROM:00004132                 mov.w   r2, @r4
ROM:00004134                 mov.w   @(h'16,pc), r1 ; [0000414E] = 640
ROM:00004136                 mov.w   @(h'16,pc), r0 ; [00004150] = h'F658 ; Down counter 8M
ROM:00004138                 mov.w   r1, @r0
ROM:0000413A                 mov.w   @(h'14,pc), r2 ; [00004152] = h'1000 ; start DCNT8M bit 12: 1 0000 0000 0000
ROM:0000413C                 mov.w   @(h'14,pc), r1  ; F666, down count register
ROM:0000413E                 lds.l   @r15+, pr
ROM:00004140                 rts
ROM:00004142                 mov.w   r2, @r1
ROM:00004142 ; End of function SCI3_RXI3_loc_4080

For OSI8M,N,O,P channel2 down count trigger is disabled. For OSI8M the settings looks like the following:

Freq 10000000Hz
tcr8 /8 internal clock speed, counting at clock /8
dcnt8 640downcounter value
osi8m 1953.125Hz

Based on the above code reading it preliminary looks like the gaugedata output is triggered at rate 1953.125Hz. This means that gaugedata interrupt may well be fast enough for solenoid duty cycle subroutine too.

...to be continued...




-- Edited by PetriK at 15:08, 2008-10-21

__________________

When asking a question, you can also consider posting it to facebook:

http://www.facebook.com/ecueditorcom



Guru

Status: Offline
Posts: 2338
Date:

/*

duty cycle based port on/off should be as simple as this...

Initialization - just modify the code to set bit 14 ...
ROM:00002E7C mov.w @(h'CE,pc), r0 ; [00002F4E] = h'3000 ; bit 12&13: 11 0000 0000 0000

Also modify osi8o interrupt so that it calls this subroutine

*/

INT_OSI8O()
{

/* Gear and rpm based duty cycle definition here */

dutypulse++;
if (dutypulse >= 100 )
tick=0;

if (duty >= (dutypulse/10))
solenoidport=port_on;
else
solenoidport=port_off;

DCNT8O = 12500; // runs at 100Hz
DSTR = bit14; // start downcounter
}






__________________

When asking a question, you can also consider posting it to facebook:

http://www.facebook.com/ecueditorcom



Guru

Status: Offline
Posts: 1247
Date:

Petrik,
Perhaps putting pulse frequency as an variable input may be be of benefit to fine tune for different solenoids. This is what was done with the megasquirt softwqare for nitrous, at least at one time.


Are there additional pins in the ECU connector that are connected to traces back to the processor that would open up the possibility for future hard coding for additional I/O?


John

-- Edited by sportbikeryder at 20:04, 2008-10-21

__________________


Guru

Status: Offline
Posts: 2338
Date:

Yes, everything needs to be parametrized. At this stage of any new idea development I am just writing notes as sometimes I dont work on things like this for weeks and then come back.

Input to ECU is easy - we could even use the "Antitheft" AD pin which is completely unused for most of the time. Output is something which I need to investigate further, currently in usa ecu there is only the flap control which is free. We europeans have more choises with pair being avail to us too.

My notes say that the yoshbox programming switches say that those only have a couple of resistors there, most likely pullup and something in series. So if we are lucky it may be possible to program those for output - but thats a longer road to investigate. Would also need to even mask those out from port reading.

There is so much to do and so little time...

Here are signal paths for those yoshbox signals for any future reference.
16 COS2 43 PH7 7 FFFFF72C c206, r214, r222, PH7
15 COS1 41 PH6 6 FFFFF72C c205, r218, r221, PH6


__________________

When asking a question, you can also consider posting it to facebook:

http://www.facebook.com/ecueditorcom



Guru

Status: Offline
Posts: 953
Date:

this is a very neat idea, that ability to have 6 different boost levels using 1 $30 solenoid would be great!

__________________


Guru

Status: Offline
Posts: 2338
Date:

Requires a bit more than just a slolenoid, e.g. driver electronics... I will try to get the proof of concept software ready first and then see how it works on the desktop and oscilloscope. After that it should be fairly eazy to start planning how to add driver electronics ...



__________________

When asking a question, you can also consider posting it to facebook:

http://www.facebook.com/ecueditorcom



Guru

Status: Offline
Posts: 1247
Date:

smithabusa wrote:

this is a very neat idea, that ability to have 6 different boost levels using 1 $30 solenoid would be great!



For dragracing, probably only time based ramping is needed for Nitrous or Boost rather than gear based. Seems that is what all of the fast guys use, and would probably be easier to program at first.



__________________


Guru

Status: Offline
Posts: 2338
Date:

Good suggestion - been thinking about it for some months now... Gear based may be easier as the exact launch is difficult to determine without an arm switch. We toyed an idea of including clutch, rpm and gear to determine when launch takes place but did not fully figure an algorithm which would allow no arm on warm up and then arm on launch. When we can figure out a condition how to set up a launch then we can also generate traction control algorightm - or should I say ignition retard based on time or rpm increase. One of our local teams is running a time based control and they are saying its very difficult as if you back up from the throttle then the time based unit resets. Of course that is how the unit is programmed but comes back to generating an algorithm on how to detect how the time is calculated.

The gear is easy to read directly from the ecu code. Thats how we already are putting a different shift light on point on eu models based on gear. Also the shift kill function works so that there is no kill on 6th by determining the gear.

Then few notes about a different element to be resolved whilst on this topic.

Resolving how to add fuel based on nitrous solenoid duty could be done utilizing the Yoshbox TPS variable. Also its possible to read directly the AD converter and use one of the Yoshbox pins for pressure to add fuel on a turbos based on boost.


Initally it looks like this is the place where the fuel can be added...


Yoshbox ADJ B, TPS H = FFFF852B -> 8528


ROM:0000F7BC                 mov.l   @(h'A8,pc), r2 ; [0000F868] = h'FFFF8528 ; Yoshbox compensation ADJB TPS ???
ROM:0000F7BE                 shlr8   r3
ROM:0000F7C0                 shlr2   r3
ROM:0000F7C2                 extu.b  r0, r0
ROM:0000F7C4                 add     r1, r0
ROM:0000F7C6                 mul.l   r0, r3
ROM:0000F7C8                 mov.b   @r2, r0
ROM:0000F7CA                 sts     macl, r3
ROM:0000F7CC                 shlr8   r3
ROM:0000F7CE                 shlr    r3
ROM:0000F7D0                 extu.b  r0, r0
ROM:0000F7D2                 add     r4, r0
ROM:0000F7D4                 mul.l   r0, r3
ROM:0000F7D6                 sts     macl, r3



__________________

When asking a question, you can also consider posting it to facebook:

http://www.facebook.com/ecueditorcom



Guru

Status: Offline
Posts: 1247
Date:

Sounds great PetriK. If you can use the gear position to trigger nitrous, that will work well.

As for the fueling, could you maybe use the injector size or fuel pressure compensation algorithm to tie in with the nitrous controller?

Basically, for higher nitrous solenoid duty cycle, the software goes to a different injector size or fuel pressure compensation value, then adding X% more fuel from the base map to some max amount at 100% solenoid duty cycle.

Maybe even modify the ram air compensation to be based on duty cycle of the nitrous solenoid rather than the speed or air pressure or calculated speed.

I am basing this logic on old tricks for using dry nitrous such as spraying the cold nitrous directly onto the intake air sensors to get the fuel enriched, etc... Basically anything that causes linear or mapped fuel enrichment might be able to be used.

John

-- Edited by sportbikeryder at 16:33, 2008-10-25

__________________


Guru

Status: Offline
Posts: 2338
Date:

Yes - you are right, injector size could be used as well but would require a bit more maths and changing a constant to variable.

 fuel = pulsewidthfrommap * compensations * 1 / injectorsize_constant

 fuel = pulsewidthfrommap * compensations * yoshbox_variable

Not a big deal which ever route take. The calculation happens anyhow at different place of the main loop. The yoshbox variable calculation happens when calculating compensations in various subroutines early in fuel calculations. Injectorsize is one of the last multipliers after several subroutines. Using yoshbox variable means that we can use yoshbox and the value will be copied in the beginning of the pulsewidth calculation cycle.

The reason to come up with yoshbox variable is mainly because  that you can monitor directly on the ECUeditor engine data monitoring screen which may be beneficial particularly when dynoing. A new injector size can not be monitored without extra work.

When testing I may change my mind, but right now the data monitoring speaks on behalf of using yoshbox variable - just for simplicity to see any testing data directly on data monitoring screen.









__________________

When asking a question, you can also consider posting it to facebook:

http://www.facebook.com/ecueditorcom



Guru

Status: Offline
Posts: 2338
Date:

Sorry, forgot to comment on the ram air compensation.

Guy (2fast4u) has got me convinced that the ram air effect to some degree compensates the drop of the bottle pressure. That most likely means that he has used tre when saying so.

So there is one important factor that relates to the duty cycle calculation. That is the bottle temperature. I am sure that at least in the beginning wont be building a temperature sensor connected to the bottle and to the AD converter of the yoshbox connector - but we have discussed this on the finnish board (amongst nitrous drivers) that is of course should be target to modify the duty cycle based on bottle temperature. And as we know that the bottle temperature drops over time leading to reduced pressure this really is something to be kept in mind.

The ram air compensation maps are so beneficial for particularly mildly tuned nitrous (<50hp) that dont really want to make any changes to those maps.

btw. the quick reply cuts out a lenghty message which means retyping ...

-- Edited by PetriK at 19:02, 2008-10-25

__________________

When asking a question, you can also consider posting it to facebook:

http://www.facebook.com/ecueditorcom



Guru

Status: Offline
Posts: 2338
Date:

I really hope that I can soon get back from "quaranteeing the legality of operations" for everyone throug licensing and with 100 quaranteed reflashes back to this core business which is to further develop tools to tune my own bike. Which is in this case the duty cycle driver for nitrous or turbo solenod based on a gear.





__________________

When asking a question, you can also consider posting it to facebook:

http://www.facebook.com/ecueditorcom



Member

Status: Offline
Posts: 7
Date:

PetriK,
Don't know if you remember, but I emailed you awhile back several times about all this and I just wanted to say thanks for all your hard work. This has all really come a long way this year and the software looks really great! I saw smithbusa's programming boxes on Schnitz's website as well...it all looks really good! We've got  couple turbo bikes here who are greatful for all your dedication!

Also, what's the story with the licensing of the software? Do we need to purchase something?

Brian

__________________


Guru

Status: Offline
Posts: 2338
Date:

Hi Brian, Thanks for the kind feedback.

Licensing means that the initial terms did only allow private use - now have found to use new terms which should better reflect the intentions with wider free use still avoiding a situation where software as such is a sellable item. Please look at the separate thread on licensing and also related explanations of so called BSD licensing terms. Those look pretty straight forward to just mainly limiting the references to names. E.g. smithabusa has asked a permission to use the software link and name petrik and of course got that permission.

About the need to purchase something. In general I am not involved into selling anything on this field. Too busy to get involved with individual cases. Regarding interface you need to do it d.i.y or purchase a ready made - but I am not involved in that. So yes - you need to purchase the interface: d.i.y or ready made, that can not be helped.

With the above (preivious) comment on licensing I am just annoyed that someone who is writing this stuff for free like me as a hobby gets involved with licensing matters - which I do understand as e.g. in EU copyright seems to be tightly controlled and may make users worried without allowing copyright clauses - but not in the context where this issue of licensing was initially presented, which was at least interesting compared to just asking clarification or if licensing terms can be changed. Rather than time thinking about licensing a free to use software would spend time on the hobby itself which is to have better tuneability of my own bike and offer this same versatility for anyone.

Above all - I am very interested to hear of feedback on this board on the license terms suitability and willing to modify those for clearer benefits of individual users.

Hope this clarifies what was meant to say above and in the bsd licensing thread.



__________________

When asking a question, you can also consider posting it to facebook:

http://www.facebook.com/ecueditorcom



Guru

Status: Offline
Posts: 1344
Date:

PetriK wrote:

/*

duty cycle based port on/off should be as simple as this...

Initialization - just modify the code to set bit 14 ...
ROM:00002E7C mov.w @(h'CE,pc), r0 ; [00002F4E] = h'3000 ; bit 12&13: 11 0000 0000 0000

Also modify osi8o interrupt so that it calls this subroutine

*/

INT_OSI8O()
{

/* Gear and rpm based duty cycle definition here */

dutypulse++;
if (dutypulse >= 100 )
tick=0;

if (duty >= (dutypulse/10))
solenoidport=port_on;
else
solenoidport=port_off;

DCNT8O = 12500; // runs at 100Hz
DSTR = bit14; // start downcounter
}






petrik,how much info can we hang in the subroutine?and on the gear to defitions,can we add more,like atimer based defition?

 



__________________

09 busa.????? now what....still got what it takes.......!

I got what you need...!
www.poweredbyford.com

www.marc@poweredbyford.com

 



Guru

Status: Offline
Posts: 1344
Date:

PetriK wrote:

Requires a bit more than just a slolenoid, e.g. driver electronics... I will try to get the proof of concept software ready first and then see how it works on the desktop and oscilloscope. After that it should be fairly eazy to start planning how to add driver electronics ...



we would need an solenoid driver,it could consist of an external relay circut driven from 12v,all we need is an output signal to control it,i already have the concept drawn up for this.

 



__________________

09 busa.????? now what....still got what it takes.......!

I got what you need...!
www.poweredbyford.com

www.marc@poweredbyford.com

 



Guru

Status: Offline
Posts: 1247
Date:

Great work digging his back up Stocker. Any external drivers would need to be solid state for long term (although I suppose a mechanical setup could work for testing). Not sure what driver is used in the currently available progressive nitrous contrllers? Might be able to use something similar to what the Megasquirt guys use for their PWM boost control circuits.

__________________


Guru

Status: Offline
Posts: 1344
Date:

john,i have a stout driver /relay setup that would be inexpensive to build and it would function perfectly for that application,all we need is a o/p signal to control the driver/relay setup....

__________________

09 busa.????? now what....still got what it takes.......!

I got what you need...!
www.poweredbyford.com

www.marc@poweredbyford.com

 



Guru

Status: Offline
Posts: 1344
Date:

building a soild state would be easy and not to relitevly inexpensive also...a pcb could be drawn up and produced relitvely inexpensive,transistors,ic's and diodes can come from mouser.....all we need is a output signal to drive it....i aready have one of theese on the drawing board ready to build....

__________________

09 busa.????? now what....still got what it takes.......!

I got what you need...!
www.poweredbyford.com

www.marc@poweredbyford.com

 

Page 1 of 1  sorted by
 
Quick Reply

Please log in to post quick replies.

Tweet this page Post to Digg Post to Del.icio.us


Create your own FREE Forum
Report Abuse
Powered by ActiveBoard