Alternator Control box for standalone MS install for NB - Page 4 - Miata Turbo Forum - Boost cars, acquire cats.

Welcome to Miataturbo.net   Members
 


MEGAsquirt A place to collectively sort out this megasquirt gizmo

Reply
 
 
 
LinkBack Thread Tools
Old 05-28-2009, 02:34 PM   #61
Senior Member
 
Join Date: Nov 2007
Location: Belgium
Posts: 939
Total Cats: 59
Default

Mmm, I get raising amps with raising voltage:
10.7mA at 11.5V
11.1mA at 12.0V
12.1mA at 13.0V
13.1mA at 14.0V
14.0mA at 14.9V

mmm, seems something is not right here. I should be getting lower charge current at higher voltages, no?

Any clue what might be wrong?

I wish I had your skills Jim ... and Jason for that matter

Last edited by WestfieldMX5; 05-28-2009 at 03:52 PM.
WestfieldMX5 is offline   Reply With Quote
Old 05-28-2009, 03:18 PM   #62
Supporting Vendor
iTrader: (10)
 
Reverant's Avatar
 
Join Date: Jun 2006
Location: Athens, Greece
Posts: 5,441
Total Cats: 198
Default

Pics.

Configurable options:

Cranking RPM (below cranking you are in non-running mode)
Min non-running voltage (flashing battery light when below, steady light when above)
Min running voltage (flashing battery light when below, light switched off when above)
Basic target voltage (trimmed based on air temp)
Max error voltage (deadband)
P Gain
I Gain
D Gain

Settings are saved in internal EEPROM so no battery is required to retain the settings.

Jim
Attached Thumbnails
Alternator Control box for standalone MS install for NB-dsc_0035_1.jpg   Alternator Control box for standalone MS install for NB-dsc_0036_1.jpg   Alternator Control box for standalone MS install for NB-dsc_0037_1.jpg   Alternator Control box for standalone MS install for NB-dsc_0038_1.jpg  
Reverant is offline   Reply With Quote
Old 05-28-2009, 10:30 PM   #63
Elite Member
 
Join Date: Jul 2005
Posts: 6,454
Total Cats: 80
Default

What's the voltage at the center point of the TL431 when at 14.4V?
JasonC SBB is offline   Reply With Quote
Old 05-29-2009, 02:09 AM   #64
Elite Member
 
Join Date: Jul 2005
Posts: 6,454
Total Cats: 80
Default

Reverant,

As a microcontroller stud, would you want to tackle closed loop boost control?
Here's what *I* need.

I have an AEM. It has:

1) a 3D boost target table with RPM and TPS as axes,
2) a 3D table for base solenoid duty cycle with RPM and MAP as axes
3) a 2D table for additional duty cycle vs. boost target
4) a 2D table for additional duty cycle vs. boost error (like a nonlinear 'P' in PID)
5) and an 'I' gain term for the I in PID

Features 1 to 4 rock for enabling one to tune throttle and RPM based boost and to instantly get CLOSE to boost target (within 1 psi).

However it has a fatal flaw in its closed loop control, which makes it overshoot or oscillate. IT HAS NO 'D'. In addition, its 'I' parameter should ONLY kick in once boost is closed (like say within 2 PSI), AND it should RESET to zero just before it kicks in.

So... Given the AEM's capability, I'd like to use its tables 1 - 4. I'd like the microcontroller to have an internal boost target vs. RPM and TPS table internally which is fixed, and mirrors that in the AEM - and I'd like the micro to implement the I and the D. This I and D should each have 2 gain parameters - a gain term when above, and a gain term when below, target boost. And it should have an adjustable "window" (e.g. 2 psi) - I and D are zeroed out (i.e. system runs open loop) when target boost minus actual boost is greater than this window.

Is it possible to first implement the algorithm in a high level language such as MATLAB/SIMULINK or C, and run on a PC->USB gizmo, before writing the code into a micro? This way the algorithm can be developed on a platform wherein datalogging and tracing is easy.

Sound like fun?
JasonC SBB is offline   Reply With Quote
Old 05-29-2009, 02:24 AM   #65
Supporting Vendor
iTrader: (10)
 
Reverant's Avatar
 
Join Date: Jun 2006
Location: Athens, Greece
Posts: 5,441
Total Cats: 198
Default

Jason, I wouldn't mind tackling such a project, though I would first prefer to go closed loop on my VVT controller (vs open loop right now). The fact that I run N/A will not make things easy.

FYI I always code in Codevision C, with very little assembly in interrupt handlers.

Jim
Reverant is offline   Reply With Quote
Old 05-29-2009, 12:31 PM   #66
Senior Member
 
Join Date: Nov 2007
Location: Belgium
Posts: 939
Total Cats: 59
Default

I have

2.31V at 14.0V
2.34V at 14.2V
2.39V at 14.4V
2.43V at 14.6V
2.46V at 14.8V

Last edited by WestfieldMX5; 05-29-2009 at 03:22 PM.
WestfieldMX5 is offline   Reply With Quote
Old 05-29-2009, 01:47 PM   #67
y8s
2 Props,3 Dildos,& 1 Cat
iTrader: (8)
 
y8s's Avatar
 
Join Date: Jun 2005
Location: Fake Virginia
Posts: 19,038
Total Cats: 407
Default

Quote:
Originally Posted by Reverant View Post
Jason, I wouldn't mind tackling such a project, though I would first prefer to go closed loop on my VVT controller (vs open loop right now). The fact that I run N/A will not make things easy.

FYI I always code in Codevision C, with very little assembly in interrupt handlers.

Jim
small request to have your controller output a stock ECU friendly signal to prevent OBDII codes?
y8s is offline   Reply With Quote
Old 05-29-2009, 03:24 PM   #68
Elite Member
 
Join Date: Jul 2005
Posts: 6,454
Total Cats: 80
Default

Quote:
Originally Posted by f_devocht View Post
I have

2.31V at 14.0V
2.34V at 14.2V
2.39V at 14.4V
2.43V at 14.6V
2.46V at 14.8V
Keep raising the voltage. Looks like your setpoint is close to 15V.
The reason it's so high is maybe the 1% resistors you used are wrong, or are 5% resistors. Or your voltmeter is inaccurate.
JasonC SBB is offline   Reply With Quote
Old 05-29-2009, 03:31 PM   #69
Elite Member
 
Join Date: Jul 2005
Posts: 6,454
Total Cats: 80
Default

Quote:
Originally Posted by Reverant View Post
Jason, I wouldn't mind tackling such a project, though I would first prefer to go closed loop on my VVT controller (vs open loop right now). The fact that I run N/A will not make things easy.

FYI I always code in Codevision C, with very little assembly in interrupt handlers.

Jim
Reverant, did you see my post in the ECU section of my observations of the VVT? The physical model and its characteristics is crucial in architecting the feedback system.

Point one - it inherently has an integrator built in. It CANNOT run in open loop, it will always integrate towards full advance or full retard.

Point two - the output of your feedback loop should be a solenoid CURRENT command, not a duty cycle.


BTW re: alternator control. A very simple effective control is a hysteretic controller, which is what my circuit does. No need for PID. And the output must be PWM. Turn alternator on if voltage is below 14.3. Turn it off if >14.35. After turning on or off, stay in that state a minimum of 50 uS, then make new decision. Polling for new decision should be at 10 uS sampling.

And, if RPM is dropping and is below 800 Hz, progressively drop voltage setpoint in order to help prevent the engine from stalling. (my circuit doesn't do this).
JasonC SBB is offline   Reply With Quote
Old 05-29-2009, 04:49 PM   #70
Senior Member
 
Join Date: Nov 2007
Location: Belgium
Posts: 939
Total Cats: 59
Default

Quote:
Originally Posted by JasonC SBB View Post
Keep raising the voltage. Looks like your setpoint is close to 15V.
The reason it's so high is maybe the 1% resistors you used are wrong, or are 5% resistors. Or your voltmeter is inaccurate.
Sure enough, setpoint is at 15.27V (2.53Vref).
In the car, I measured 15.1V with running engine.
My el cheapo DVM must be off a bit.
I guess it's best if I lower my setpoint to the same voltage I have in the car (15.1V).

Is this just a matter of changing the values of R4 and R11 so that Vref is a bit lower in this formula?

15.1V=Vref*(1 + R4/R11)
WestfieldMX5 is offline   Reply With Quote
Old 05-29-2009, 04:50 PM   #71
Supporting Vendor
iTrader: (10)
 
Reverant's Avatar
 
Join Date: Jun 2006
Location: Athens, Greece
Posts: 5,441
Total Cats: 198
Default

Quote:
Originally Posted by y8s View Post
small request to have your controller output a stock ECU friendly signal to prevent OBDII codes?
Please explain, your request is not clear enough.

Jim
Reverant is offline   Reply With Quote
Old 05-29-2009, 05:02 PM   #72
Supporting Vendor
iTrader: (10)
 
Reverant's Avatar
 
Join Date: Jun 2006
Location: Athens, Greece
Posts: 5,441
Total Cats: 198
Default

Quote:
Originally Posted by JasonC SBB View Post
Reverant, did you see my post in the ECU section of my observations of the VVT? The physical model and its characteristics is crucial in architecting the feedback system.

Point one - it inherently has an integrator built in. It CANNOT run in open loop, it will always integrate towards full advance or full retard.
Sorry, I haven't read your post, I only read the Megasquirt section on mt.net (I'm N/A and have no interest in other ECUs, duh)

My current system uses feedback from the oil pressure sensor I have. Its not much, but it roughly working.

Quote:
Originally Posted by JasonC SBB View Post
Point two - the output of your feedback loop should be a solenoid CURRENT command, not a duty cycle.
Please explain.

Quote:
Originally Posted by JasonC SBB View Post
BTW re: alternator control. A very simple effective control is a hysteretic controller, which is what my circuit does. No need for PID. And the output must be PWM. Turn alternator on if voltage is below 14.3. Turn it off if >14.35. After turning on or off, stay in that state a minimum of 50 uS, then make new decision. Polling for new decision should be at 10 uS sampling.
I understand what your circuit does, I try to emulate the stock ECU as much as possible though (hence the 250Hz, 2V PWM control signal)

Quote:
Originally Posted by JasonC SBB View Post
And, if RPM is dropping and is below 800 Hz, progressively drop voltage setpoint in order to help prevent the engine from stalling. (my circuit doesn't do this).
I'm not following here.

Jim
Reverant is offline   Reply With Quote
Old 05-29-2009, 05:08 PM   #73
Boost Pope
iTrader: (8)
 
Joe Perez's Avatar
 
Join Date: Sep 2005
Location: Delicious and Moist.
Posts: 26,326
Total Cats: 1,926
Default

Quote:
Originally Posted by Reverant View Post
I'm not following here.
He means to start lightening the load on the alternator (by turning down the output voltage) to reduce its drag on the engine if RPM falls below a certain level. This will prevent stalls / make idle recovery easier.
Joe Perez is offline   Reply With Quote
Old 05-29-2009, 05:55 PM   #74
Elite Member
 
Join Date: Jul 2005
Posts: 6,454
Total Cats: 80
Default

Quote:
Originally Posted by f_devocht View Post
Sure enough, setpoint is at 15.27V (2.53Vref).
In the car, I measured 15.1V with running engine.
My el cheapo DVM must be off a bit.
I guess it's best if I lower my setpoint to the same voltage I have in the car (15.1V).

Is this just a matter of changing the values of R4 and R11 so that Vref is a bit lower in this formula?

15.1V=Vref*(1 + R4/R11)
The equation is correct, where Vref is 2.49 or 2.5V (TL431 spec).

Are you using 1% resistors?

I think step 1 is to get a more accurate voltmeter.
JasonC SBB is offline   Reply With Quote
Old 05-29-2009, 05:59 PM   #75
Elite Member
 
Join Date: Jul 2005
Posts: 6,454
Total Cats: 80
Default

Quote:
Originally Posted by Reverant View Post
Sorry, I haven't read your post, I only read the Megasquirt section on mt.net (I'm N/A and have no interest in other ECUs, duh)

My current system uses feedback from the oil pressure sensor I have. Its not much, but it roughly working.
Reading oil pressure is not feedback, it's feed-forward.

The oil control solenoid responds to current, not PWM duty cycle. The current will change for a given duty cycle as system voltage changes. So the output of the PID plant should command a current, and a 2nd, faster, inner feedback loop should control the solenoid current by sensing it and outputting a PWM signal. This will prevent the cam angle from changing when there's an abrupt change in system voltage (lights or fans turning on, for example).

Find my post and read it, then ask questions there.

Cheers!
JasonC SBB is offline   Reply With Quote
Old 05-29-2009, 07:40 PM   #76
Senior Member
 
Join Date: Nov 2007
Location: Belgium
Posts: 939
Total Cats: 59
Default

Quote:
Originally Posted by JasonC SBB View Post
The equation is correct, where Vref is 2.49 or 2.5V (TL431 spec).

Are you using 1% resistors?

I think step 1 is to get a more accurate voltmeter.
Ah, I used a 5% for 10K. Must have used a spare one from the MS build. That explains the higher values I'm seeing.
Will replace it with a 1% (and get a better DVM as well ).
Glad the circuit works though. Another step closer to MS2E completion. About getting time as well after 6 months .
thx for your help.

Last edited by WestfieldMX5; 05-29-2009 at 08:16 PM.
WestfieldMX5 is offline   Reply With Quote
Old 05-30-2009, 06:22 AM   #77
Supporting Vendor
iTrader: (10)
 
Reverant's Avatar
 
Join Date: Jun 2006
Location: Athens, Greece
Posts: 5,441
Total Cats: 198
Default

Quote:
Originally Posted by Joe Perez View Post
He means to start lightening the load on the alternator (by turning down the output voltage) to reduce its drag on the engine if RPM falls below a certain level. This will prevent stalls / make idle recovery easier.
That's easy to do. However, at least on my car, anything less than 13V makes the engine want to stall anyway (on the stock ECU).

Jim
Reverant is offline   Reply With Quote
Old 05-30-2009, 12:20 PM   #78
Boost Pope
iTrader: (8)
 
Joe Perez's Avatar
 
Join Date: Sep 2005
Location: Delicious and Moist.
Posts: 26,326
Total Cats: 1,926
Default

Quote:
Originally Posted by Reverant View Post
That's easy to do. However, at least on my car, anything less than 13V makes the engine want to stall anyway (on the stock ECU).
That's quite odd. During cranking, the alternator isn't making any power and the battery voltage is going to be somewhere in the 9-10v range, yet this is quite enough to get the engine started and running.

Is the mechanical load of the alternator going up for some reason as you reduce the field supply and drop the voltage? I can't imagine why it would, but then I can't find any other explanation for this behavior either.

Consider the situation of the alternator failing during engine operation, due to a broken belt for instance. The engine keeps running, being supplied only by battery voltage.
Joe Perez is offline   Reply With Quote
Old 06-23-2009, 09:32 PM   #79
Elite Member
iTrader: (3)
 
AbeFM's Avatar
 
Join Date: Aug 2006
Location: San Diego, CA
Posts: 3,048
Total Cats: 8
Default

Jason, PM's full.

Thanks for catching that, I took a "R9, 1k" and made it "9k". Will Fix.


Yeah - I'm with Joe, low voltage sounds like a symptom, not a cause. The motor should run fine without the alternator on all the time. I've thought about opening an air leak or cutting the alternator on low RPM, but haven't implemented it yet.

Jason: I like the current on the VVT idea, where do you talk about this?
AbeFM is offline   Reply With Quote
Old 06-23-2009, 10:15 PM   #80
Elite Member
 
Join Date: Jul 2005
Posts: 6,454
Total Cats: 80
Default

In the daddy ecu section.
JasonC SBB is offline   Reply With Quote
 
 
Reply

Related Topics
Thread Thread Starter Forum Replies Last Post
Another Cast Manifold Corky Bell Prefabbed Turbo Kits 18 11-22-2016 10:01 PM
OTS Bilstein to motorsports ASN conversion stoves Suspension, Brakes, Drivetrain 5 04-21-2016 04:00 PM
Back to Stock Part Out!! Turbo Parts, MS2 Enhanced 01-05, Suspension, and MOAR! StratoBlue1109 Miata parts for sale/trade 16 10-02-2015 10:39 AM
Walbro 255lph Fuel Pump $50 lsc224 Miata parts for sale/trade 2 10-01-2015 10:17 AM
Another Alternator thread ihiryu General Miata Chat 9 09-28-2015 11:22 AM


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT -4. The time now is 09:28 AM.