MEGAsquirt A place to collectively sort out this megasquirt gizmo

Alternator Control box for standalone MS install for NB

Thread Tools
 
Search this Thread
 
Old 05-28-2009, 01:34 PM
  #61  
Senior Member
 
WestfieldMX5's Avatar
 
Join Date: Nov 2007
Location: Belgium
Posts: 999
Total Cats: 73
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 02:52 PM.
WestfieldMX5 is offline  
Old 05-28-2009, 02:18 PM
  #62  
Elite Member
iTrader: (10)
 
Reverant's Avatar
 
Join Date: Jun 2006
Location: Athens, Greece
Posts: 5,977
Total Cats: 356
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  
Old 05-28-2009, 09:30 PM
  #63  
Elite Member
 
JasonC SBB's Avatar
 
Join Date: Jul 2005
Posts: 6,420
Total Cats: 84
Default

What's the voltage at the center point of the TL431 when at 14.4V?
JasonC SBB is offline  
Old 05-29-2009, 01:09 AM
  #64  
Elite Member
 
JasonC SBB's Avatar
 
Join Date: Jul 2005
Posts: 6,420
Total Cats: 84
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  
Old 05-29-2009, 01:24 AM
  #65  
Elite Member
iTrader: (10)
 
Reverant's Avatar
 
Join Date: Jun 2006
Location: Athens, Greece
Posts: 5,977
Total Cats: 356
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  
Old 05-29-2009, 11:31 AM
  #66  
Senior Member
 
WestfieldMX5's Avatar
 
Join Date: Nov 2007
Location: Belgium
Posts: 999
Total Cats: 73
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 02:22 PM.
WestfieldMX5 is offline  
Old 05-29-2009, 12:47 PM
  #67  
y8s
2 Props,3 Dildos,& 1 Cat
iTrader: (8)
 
y8s's Avatar
 
Join Date: Jun 2005
Location: Fake Virginia
Posts: 19,338
Total Cats: 573
Default

Originally Posted by Reverant
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  
Old 05-29-2009, 02:24 PM
  #68  
Elite Member
 
JasonC SBB's Avatar
 
Join Date: Jul 2005
Posts: 6,420
Total Cats: 84
Default

Originally Posted by f_devocht
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  
Old 05-29-2009, 02:31 PM
  #69  
Elite Member
 
JasonC SBB's Avatar
 
Join Date: Jul 2005
Posts: 6,420
Total Cats: 84
Default

Originally Posted by Reverant
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  
Old 05-29-2009, 03:49 PM
  #70  
Senior Member
 
WestfieldMX5's Avatar
 
Join Date: Nov 2007
Location: Belgium
Posts: 999
Total Cats: 73
Default

Originally Posted by JasonC SBB
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  
Old 05-29-2009, 03:50 PM
  #71  
Elite Member
iTrader: (10)
 
Reverant's Avatar
 
Join Date: Jun 2006
Location: Athens, Greece
Posts: 5,977
Total Cats: 356
Default

Originally Posted by y8s
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  
Old 05-29-2009, 04:02 PM
  #72  
Elite Member
iTrader: (10)
 
Reverant's Avatar
 
Join Date: Jun 2006
Location: Athens, Greece
Posts: 5,977
Total Cats: 356
Default

Originally Posted by JasonC SBB
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.

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

Originally Posted by JasonC SBB
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)

Originally Posted by JasonC SBB
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  
Old 05-29-2009, 04:08 PM
  #73  
Boost Pope
iTrader: (8)
 
Joe Perez's Avatar
 
Join Date: Sep 2005
Location: Chicago. (The less-murder part.)
Posts: 33,027
Total Cats: 6,593
Default

Originally Posted by Reverant
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  
Old 05-29-2009, 04:55 PM
  #74  
Elite Member
 
JasonC SBB's Avatar
 
Join Date: Jul 2005
Posts: 6,420
Total Cats: 84
Default

Originally Posted by f_devocht
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  
Old 05-29-2009, 04:59 PM
  #75  
Elite Member
 
JasonC SBB's Avatar
 
Join Date: Jul 2005
Posts: 6,420
Total Cats: 84
Default

Originally Posted by Reverant
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  
Old 05-29-2009, 06:40 PM
  #76  
Senior Member
 
WestfieldMX5's Avatar
 
Join Date: Nov 2007
Location: Belgium
Posts: 999
Total Cats: 73
Default

Originally Posted by JasonC SBB
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 07:16 PM.
WestfieldMX5 is offline  
Old 05-30-2009, 05:22 AM
  #77  
Elite Member
iTrader: (10)
 
Reverant's Avatar
 
Join Date: Jun 2006
Location: Athens, Greece
Posts: 5,977
Total Cats: 356
Default

Originally Posted by Joe Perez
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  
Old 05-30-2009, 11:20 AM
  #78  
Boost Pope
iTrader: (8)
 
Joe Perez's Avatar
 
Join Date: Sep 2005
Location: Chicago. (The less-murder part.)
Posts: 33,027
Total Cats: 6,593
Default

Originally Posted by Reverant
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  
Old 06-23-2009, 08:32 PM
  #79  
Elite Member
iTrader: (3)
 
AbeFM's Avatar
 
Join Date: Aug 2006
Location: San Diego, CA
Posts: 3,047
Total Cats: 12
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  
Old 06-23-2009, 09:15 PM
  #80  
Elite Member
 
JasonC SBB's Avatar
 
Join Date: Jul 2005
Posts: 6,420
Total Cats: 84
Default

In the daddy ecu section.
JasonC SBB is offline  


Quick Reply: Alternator Control box for standalone MS install for NB



All times are GMT -4. The time now is 02:16 PM.