gemellocattivo.com

Which means "Evil Twin". Lets see your projects where you change boring into fun or create the fun from scratch.
It is currently Thu Mar 28, 2024 4:56 am

All times are UTC - 5 hours [ DST ]




Post new topic Reply to topic  [ 30 posts ]  Go to page Previous  1, 2, 3  Next
Author Message
PostPosted: Thu Nov 05, 2015 9:28 pm 
Offline

Joined: Thu Jan 01, 2015 6:47 pm
Posts: 4250
apalrd wrote:
I think a single PID should work. But adding a feed-forward term would be good. That calculates the DC required at a given TPS request. DC would be 0 when TPS request is the spring position, >0 above spring and <0 below spring. Otherwise you're relying on the I term in PID to handle the steady-state motor command and this way it will settle faster and you don't have to worry so much about integral windup.


Maybe. The PID had an integral clamp to prevent windup so that I can handle so I think its worht trying with just the PID function thsts available before I add stuff to it


Top
 Profile Send private message  
 
PostPosted: Tue Nov 10, 2015 11:39 am 
Offline

Joined: Thu Jan 01, 2015 6:47 pm
Posts: 4250
So here's where I'm headed with this.

I've got:
Pedal to TPS translation table so a non-linear relationship can be setup easily....to open the throttle gentle with you have HUGE TBs :)

an idle target RPM value calculated, this will be used when the pedal is at 0% - this should being rpm gently to the target.

There is a cranking TPS position....its just a set point but maybe I'll make it a table vs coolant??

There is a stall saver TPS position so if rpm is below idle target the by a set value the throttle will open to a set position until rpm reaches idle target.

It's a just roughed out at the moment....but it's getting there.


Top
 Profile Send private message  
 
PostPosted: Tue Nov 10, 2015 12:35 pm 
Offline

Joined: Sun Oct 11, 2015 2:07 pm
Posts: 134
Pedal to TPS could also have RPM dependencies. Since you need to open the TB less at low RPM to get the same % of WOT torque.

We crank at the open-loop idle TPS position (5.5% for us), 5.5% is the position we start ETC at when we enter idle mode on all cylinders. In flood clear, you might want to open the throttle or leave it at crank (I can't remember which we do).

In stall saver, if you open the throttle too quickly without a lot of fuel enrichment, you could start to lean out and stall anyway (not much additional torque would be produced by the open throttle). Might need to bump target AFR richer also.

What I do is I first determine a 'torque control ID' which is a number which indicates what requestor sets the torque control values. I have 6 blocks which all take in the Pdl_Load from pedal mapping and output TPS, FA, and FSO. I have:
-Off mode - ETC motor is turned off, Fuel disabled, this mode is entered when key off is detected (but the key should cut relay power anyway)
-Crank mode - ETC motor set to idle open loop TPS, FA set to 1, Fuel enabled
-Idle mode - Idle mode has sub-modes of 2cyl and 1cyl idle. Each has a separate TPS open-loop request and fuel enabled vector, but they both set FA to 0.5 phi (which causes the engine management to hold the lean limit)
-Normal mode - TPS comes from Pdl_Load vs RPM surface, FA is set to 0.5, Fuel enabled
-DFSO mode - TPS comes from a scalar cal for TPS in DFSO, FA is set to 1, fuel disabled
-WOT mode - TPS is set to 100%, FA is set to 1.1, fuel enabled

Determining the number comes from Pdl_Load, Pdl, and RPM.

We don't have a stall saver, but a centrifugal CVT or centrifugal clutch can't stall the engine by engaging at idle so we don't really need it. If we still had manual clutch control we probably would have it.

_________________
"Sometimes, the elegant implementation is a function. Not a method. Not a class. Not a framework. Just a function." ~ John Carmack

"Any sufficiently advanced technology is indistinguishable from magic" ~Arthur C. Clarke


Top
 Profile Send private message  
 
PostPosted: Tue Nov 10, 2015 4:32 pm 
Offline

Joined: Thu Jan 01, 2015 6:47 pm
Posts: 4250
I have some more testing to do but I think I have something that will be functional. Once I'm happy it's doing what I think then I'll add additional safeties. The throttle is NEVER in open loop mode.

Flood clear - if flood clear enabled AND TPS > 90% AND engine NOT running, then fuel = 0

Crank Position - engine NOT running and rpm > 1 AND pedal closed, then Throttle to crank position. There is a clt & cycle count enrichment available as well in the fueling setup

Stall Saver - if engine running AND below the stall saver threshold AND TPS < stall saver position, then stall saver position. So this will engage as soon as the engine fires and crosses the run threshold. Enrichment at startup is handled by the cycle count/clt table as with cranking. After the engine is actually running enrichment is handled by the wall-wetting (x-tau like) enrichment.

Normal mode - The throttle follows a table to translate Pedal position to TPS. The user can set any conversion they please...I have a simple curve set in at the moment shown on the graph

Idle - If idle enabled AND throttle close AND RPM above stall saver AND TPS % below idle limiter the throttle is tied to control to the idle target rpm instead of pedal position with the max TPS limited.

There are 2 separate PID controllers, one for position and 1 for RPM because I'm assuming the same values won't work for both.


Attachments:
Throttle control.JPG
Throttle control.JPG [ 235.87 KiB | Viewed 17270 times ]
Top
 Profile Send private message  
 
PostPosted: Tue Nov 10, 2015 4:51 pm 
Offline

Joined: Sun Oct 11, 2015 2:07 pm
Posts: 134
I meant open-loop idle (without idle control).

The TPS control itself is always closed loop if the engine is spinning. When I enter idle mode, we set the TPS setpoint initially to 5.5% to start idle control. I use that same value in a few places as a sort of default TPS setpoint.

My pedal-map block outputs pdl_load (% of torque to WOT at this RPM), 'closed pedal' flag, and 'wide open pedal' flag. Closed pedal is set below 2% pedal, wide open pedal is set above 95% pedal. I could have used thresholds on pdl_load (e.g. pdl_load <0 = closed, and pdl_load >100 = wide open) instead but the result would be the same.

I already had separate logic to determine engine sync mode - Stall, Crank, Run, so I just use that mode number to directly command Stall or Crank in the torque control ID decision.

_________________
"Sometimes, the elegant implementation is a function. Not a method. Not a class. Not a framework. Just a function." ~ John Carmack

"Any sufficiently advanced technology is indistinguishable from magic" ~Arthur C. Clarke


Top
 Profile Send private message  
 
PostPosted: Tue Nov 10, 2015 7:17 pm 
Offline

Joined: Thu Jan 01, 2015 6:47 pm
Posts: 4250
apalrd wrote:
I meant open-loop idle (without idle control).

The TPS control itself is always closed loop if the engine is spinning. When I enter idle mode, we set the TPS setpoint initially to 5.5% to start idle control. I use that same value in a few places as a sort of default TPS setpoint.


That makes more sense. During cranking and when stall is detected I go to a set TPS only if that point is more than the pedal is asking for. Crank and stall are 2 separate set points....but that may not be necessary.

apalrd wrote:
My pedal-map block outputs pdl_load (% of torque to WOT at this RPM), 'closed pedal' flag, and 'wide open pedal' flag. Closed pedal is set below 2% pedal, wide open pedal is set above 95% pedal. I could have used thresholds on pdl_load (e.g. pdl_load <0 = closed, and pdl_load >100 = wide open) instead but the result would be the same.

I already had separate logic to determine engine sync mode - Stall, Crank, Run, so I just use that mode number to directly command Stall or Crank in the torque control ID decision.


I do some state type testing here and there, run is right up front but crank is not as it's currently only used in the ETC code, same with stall. I have a hysterisis type detector on the Pedal closed position so it goes to pedal closed condition when the pedal drops below 0.5% but doesn't come out until the pedal opens to 1.0%...those are user set points I'll play with once the car is driving.

I don't do a WOT condition yet.

I'm thinking I'll use the rpm control mode for traction control and maybe add cruise control using it too. Traction control should be as simple as if RW speed > FW speed x slip factor AND traction TPS is < Pedal TPS, then control to slip factor RPM. Or I guess I could add a 3rd PID that used wheel speed directly. A problem for another day.


Top
 Profile Send private message  
 
PostPosted: Tue Nov 10, 2015 9:20 pm 
Offline

Joined: Sun Oct 11, 2015 2:07 pm
Posts: 134
If you come up with a torque control ID, you can add more numbers to the ID to add more requestors. Or, you can have a 2-step process, one which determines 'normal mode TPS' and another which determines idle/crank/stall TPS and overrides the other TPS request. Both ways work.

I use crank/stall/run for fueling and spark. Spark is rather retarded when starting and fueling uses raw mg tables, so the same engine run mode was carried over for ETC.

For traction control, continuously look for wheel spin, when it is detected, grab the current TPS request then take control of ETC and do closed-loop control to maintain a given slip ratio (so use the current TPS to initialize the I term). When traction TPS reaches/exceeds pedal commanded TPS in a slightly filtered way, then release the ETC control and reset traction control.

If you design idle control as a min AND max speed controller, you can use it for ETC-based launch RPM control.

_________________
"Sometimes, the elegant implementation is a function. Not a method. Not a class. Not a framework. Just a function." ~ John Carmack

"Any sufficiently advanced technology is indistinguishable from magic" ~Arthur C. Clarke


Top
 Profile Send private message  
 
PostPosted: Tue Nov 10, 2015 10:18 pm 
Offline

Joined: Thu Jan 01, 2015 6:47 pm
Posts: 4250
apalrd wrote:
If you come up with a torque control ID, you can add more numbers to the ID to add more requestors. Or, you can have a 2-step process, one which determines 'normal mode TPS' and another which determines idle/crank/stall TPS and overrides the other TPS request. Both ways work.


I pulled idle out separate because it's rpm based and the other position based. Also the way engine lab works all options are calculated then the desired one selected so I calculate the position for crank, stall, normal then select. Normal is the default (0) and I test if crank or stall should be used instead so 0, 1, 2.

I also calculate the ETC signal base on RPM (currently just idle) then select between RPM or position control signal with position the default.


apalrd wrote:
I use crank/stall/run for fueling and spark. Spark is rather retarded when starting and fueling uses raw mg tables, so the same engine run mode was carried over for ETC.


I build this into the normal operation tables. So for spark there can be say, 0, 200 (cranking), {500, 700, 900}stall and then the normal part of the table so no need to worry about state, the desired result comes automatically.


apalrd wrote:
For traction control, continuously look for wheel spin, when it is detected, grab the current TPS request then take control of ETC and do closed-loop control to maintain a given slip ratio (so use the current TPS to initialize the I term). When traction TPS reaches/exceeds pedal commanded TPS in a slightly filtered way, then release the ETC control and reset traction control.



Isn't that what I said??

apalrd wrote:
If you design idle control as a min AND max speed controller, you can use it for ETC-based launch RPM control.


It just controls to a target so it would work at any rpm....but I'll need a clutch pedal switch for popper launch control.


I'm not sure if I'm going to code any of this yet or wait until the rest is tested......I'll probably rough it out I suppose. I need to do a closed loop mixture too I guess.


Top
 Profile Send private message  
 
PostPosted: Thu Dec 17, 2015 10:01 am 
Offline

Joined: Thu Jan 01, 2015 6:47 pm
Posts: 4250
I'll post this stuff here I guess.

My Actuator appears to be drawing more than the 5A the HW will be happy about so....

Yesterday I tested (on the simulator) a model that uses both internal H-bridges in parallel to get me 10A and it seems to work. The down side here is I'm doing the PWM in the model itself instead of using the HW feature. The full engine model seems to run in about 150usec so that limits the PWM frequency to about maybe 500hz before there could be substantial error.....there are some things I could do with model optimization to get the throttle serviced more frequently, but 1khz is probably the practical limit on this path. I think it will work but is a poor use of fancy software.

Also, the pololu external driver I ordered arrived ( https://www.pololu.com/product/2991) yesterday and I'll write a model for it today. This will handle 20khz with no issue and is 17A so plenty fast and plenty powerful...but it's just a board and I'll need to find or make a case and figure out something for connectors and they say I want to add a capacitor but don't really tell me what capacitor to add so I'm stuck guessing. It will take some time to make it a reliable installation mechanically.

I can't test anything on the real HW at the moment because I broke the ECU somehow....it no longer responds on the USB connection. Jim is going to talk me through connecting and re-loading the FW via serial and see if that sorts it out. I'm not sure what I did exactly but I sure made it angry :(


Top
 Profile Send private message  
 
PostPosted: Thu Dec 17, 2015 10:08 am 
Offline

Joined: Sun Oct 11, 2015 2:07 pm
Posts: 134
How much over 5a?

Can it idle/low TPS under 5a?

It's probably fine.


For an external H bridge, the cap would go on the input (bigger is better). The motor inductance should smooth out everything on the output, but a small cap there (located at the motor) could help with electrical/audible noise. I normally just guess here.

_________________
"Sometimes, the elegant implementation is a function. Not a method. Not a class. Not a framework. Just a function." ~ John Carmack

"Any sufficiently advanced technology is indistinguishable from magic" ~Arthur C. Clarke


Top
 Profile Send private message  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 30 posts ]  Go to page Previous  1, 2, 3  Next

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group