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 6:37 pm

All times are UTC - 5 hours [ DST ]




Post new topic Reply to topic  [ 30 posts ]  Go to page 1, 2, 3  Next
Author Message
PostPosted: Sat Oct 31, 2015 7:05 am 
Offline

Joined: Thu Jan 01, 2015 6:47 pm
Posts: 4251
This is now pretty high on my to do list but I'm missing almost all knowledge here.... :(

I know I want redundant TPS and pedal signals
I know I want to compare those signal and kick out if they mismatch by too much.
I know the drive signal comes out of something called a 1/2 bridge

That is the full extent of my knowledge......can any one here school me a bit?


Top
 Profile Send private message  
 
PostPosted: Sat Oct 31, 2015 12:05 pm 
Offline

Joined: Sun Oct 11, 2015 2:07 pm
Posts: 134
It's a full H bridge.

A 1/2 bridge would be a high side and low side driver connected together to one motor lead. Usually half-bridge driver chips are common and you can build either a H bridge, 3-phase bridge, bipolar stepper, etc. out of several of them, or use them as general-purpose high or low side spare outputs. They're also used to control recirculation in solenoids (so the high side and low side alternate when recirculation is on, but the high side doesn't come on when recirculation is off).

A full H bridge has a half bridge connected to each side of a brushed motor (with the motor facing with its leads to each side in a schematic, this forms an 'H'). With this arrangement, the motor can be switched between off (both sides connected to ground or +batt), positive (m+ connected to batt and m- connected to ground), or reverse. So the motor can be PWM'd to any voltage between battery and the inverse of battery.

To save on PWM channels (this arrangement could require 4 PWM channels if built with discrete MOSFETS), some bridge chips have control inputs which are arranged to allow simpler H bridge control. One example has an input for each 1/2 bridge which selects + or -, and two enable inputs which shut down the bridge entirely (or turn on both of the ground FETs in some versions). For sign-magnitude rectification you can set the Enable and one of the bridge control pins as GPIO and the other bridge control pin as PWM. Depending on which half the GPIO 1/2 bridge is set to, determines the direction of the motor, and PWMing the other half determines the PWM voltage. For locked anti-phase, you need two synchronized PWM channels which alternate (so during the 'on' period the motor would be connected to + and -, and the 'off' period it's connected backwards, instead of both sides to ground or +batt during the 'off' period). Two enable inputs are provided so an external ASIC or logic circuit (e.g. processor watchdog or power supply monitor) can shut down the bridge independent of the micro.


With two full H bridges you can drive a bipolar stepper motor. In this case, each H bridge is connected to one winding. When stepping, the windings are turned on in either direction or off. This can be done with a lot of GPIO pins and a SW routine called at each step, or an eTPU function to generate the step outputs (this requires an eTPU channel for each pin, which would be 4).

H bridges are also useful for more than just ETC throttles, really new engines are using them for other valves like new EGR valves, VNT turbos, and even turbo wastegates for more precise control. You can also have multiple ETC throttles (e.g. one per bank or truly individual throttles). I'm stuck with the older 565 ECU because it has 3 H bridges, the newer modules only have 1.


For the majority of ETC failures, the solution is not to shutoff the engine but to go into 'power free' mode where the throttle power is removed but the engine still runs at the throttle spring position. This is usually enough to drive at a low speed.

You can either go with basic ETC where there's just a table between the pedal and the throttle, possibly with overrides (e.g. we have an override when in DFSO to increase throttle request by about 25% to reduce engine braking), or 'torque-based' control. With torque based control, the pedal input is converted into a torque (in Nm) and it is passed to the engine management which calculates everything required to hit that torque. Throttle is a side effect of this calculation, it can also use spark advance, F/A ratio, etc. as necessary and depending on engine limits (e.g. min spark advance for EGT, lean limit, rich limit, max torque at this altitude and RPM, ...). In general throttle is the main output, but for supercharged engines the throttle and supercharger bypass together control the torque (bypass is open until throttle gets to near wide-open, then bypass takes over to control engine with boost).

Torque control requires some model-based engine control, especially for airflow. You could do some rudimentary torque-based control by mapping pedal values to desired MAP or charge without fully converting to torque. If you have throttle flow data vs TPS you can solve back for TPS required for target MAF using a few nozzle flow equations. The TPS request will vary based on RPM since TPS is a flow not a charge. This will also require a throttle upstream pressure sensor for boosted engines.

_________________
"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: Sat Oct 31, 2015 6:00 pm 
Offline

Joined: Thu Jan 01, 2015 6:47 pm
Posts: 4251
What frequentcy for the PWM?

Spring close or reverse polarity?


Top
 Profile Send private message  
 
PostPosted: Sat Oct 31, 2015 7:06 pm 
Offline

Joined: Sun Oct 11, 2015 2:07 pm
Posts: 134
Spring close is usually somewhere around 10% throttle. Reverse polarity is needed to get below this for warm idle and sometimes cruising.

No idea on frequency. We ran the position closed-loop control at 500hz so I'd imagine the PWM frequency is at least 1khz. The setpoint math is done at 100hz.

We use a basic PIDF (PID with feed-forward) control but it isn't very good. I'm sure there are better ways of doing position 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 03, 2015 12:45 pm 
Offline

Joined: Thu Jan 01, 2015 6:47 pm
Posts: 4251
I just finished rearranging pins so my pinout matches the AEM pinout.....I'm officially out of delaying tactics, time to start teh ETC code :)


Top
 Profile Send private message  
 
PostPosted: Tue Nov 03, 2015 2:07 pm 
Offline

Joined: Thu Jan 01, 2015 6:47 pm
Posts: 4251
I found this site with basic info about how its supposed to work:

https://www.picoauto.com/library/traini ... ly-by-wire


Top
 Profile Send private message  
 
PostPosted: Tue Nov 03, 2015 3:43 pm 
Offline

Joined: Thu Jan 01, 2015 6:47 pm
Posts: 4251
I'm starting to lay this out now. I'm thinking rather than compare the sensor readings I'll calculate the error and desired output using the data from the 2 sets of sensors and compare the results...that will test as much of the the code as possible as well as the sensors I think.


Top
 Profile Send private message  
 
PostPosted: Wed Nov 04, 2015 6:42 am 
Offline

Joined: Thu Jan 01, 2015 6:47 pm
Posts: 4251
apalrd wrote:
Spring close is usually somewhere around 10% throttle. Reverse polarity is needed to get below this for warm idle and sometimes cruising.

No idea on frequency. We ran the position closed-loop control at 500hz so I'd imagine the PWM frequency is at least 1khz. The setpoint math is done at 100hz.

We use a basic PIDF (PID with feed-forward) control but it isn't very good. I'm sure there are better ways of doing position control.


I look at what motec has for their default settings...8000hz so I'll just copy that and see how it works.

On the reverse polarity. Playing a little with the engine lab PID function the output seems to always be positive which doesn't exactly lend itself to reversing polarity. Because the actuator is spring loaded closed I guess the forward loop will be doing the vast majority of the work so I could make it the primary but when it's got an output of 0 I know to reverse polarity and use the secondary PID until until it goes to 0 then switch back to the primary. I'll try this and see what happens.


Top
 Profile Send private message  
 
PostPosted: Wed Nov 04, 2015 10:37 am 
Offline

Joined: Thu Jan 01, 2015 6:47 pm
Posts: 4251
mk e wrote:
On the reverse polarity. Playing a little with the engine lab PID function the output seems to always be positive which doesn't exactly lend itself to reversing polarity. Because the actuator is spring loaded closed I guess the forward loop will be doing the vast majority of the work so I could make it the primary but when it's got an output of 0 I know to reverse polarity and use the secondary PID until until it goes to 0 then switch back to the primary. I'll try this and see what happens.


I was not setting it up correctly.....getting the PID function to output -100 to 100 is no problem so I can just flip the H-bridge on a negative output. Easy.


Top
 Profile Send private message  
 
PostPosted: Wed Nov 04, 2015 4:24 pm 
Offline

Joined: Sun Oct 11, 2015 2:07 pm
Posts: 134
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.

_________________
"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 1, 2, 3  Next

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 5 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