For any add-on boards such as VR conditioners, optos and OEM interface boards
User avatar
By digmorepaka
#56846
flex-ALE wrote: Sat May 07, 2022 10:18 pm A simple PID will not work properly. the direct and reverse PID must be adapted according to the position status.
It is. There are multiple states depending on action, steady state - low difference between throttle position and desired throttle position, transient - large difference between tps and desired, idle - for idle though currently not in use as I will be re-doing idle control, and safety - which is obviously safety.

https://github.com/digmorepaka/DBW-Cont ... l.ino#L396
By JHolland
#56855
flex-ALE wrote: Sat May 07, 2022 10:18 pm the control of a motorized butterfly is particular because there are 2 internal springs. one is 8% in opposition to the close and the other is in opposition to the open. a simple PID will not work properly. the direct and reverse PID must be adapted according to the position status.
You should have a velocity control loop that will vary the torque demand to maintain a constant velocity/acceleration.
By flex-ALE
#56857
JHolland wrote: Sun May 08, 2022 6:11 pm
flex-ALE wrote: Sat May 07, 2022 10:18 pm the control of a motorized butterfly is particular because there are 2 internal springs. one is 8% in opposition to the close and the other is in opposition to the open. a simple PID will not work properly. the direct and reverse PID must be adapted according to the position status.
You should have a velocity control loop that will vary the torque demand to maintain a constant velocity/acceleration.
that's what I do. your code is good but ( abs (inTPS - idleSetPoint) < 5 )
5 is assumed to be the reverse torque tipping threshold. this threshold depends on the motorized butterflies due to their design.
By JHolland
#56872
flex-ALE wrote: Sat May 07, 2022 10:18 pm I can change the pwm frequency, I work at 3khz.
I did some characterisation testing on a Denso throttle body and even at 10kHz the ripple current was fairly high. I also determined that I would need at least 13 bits of PWM to achieve a good resolution around 45 degree or so, the Mega isn't fast enough to support that but I was using an MPC5744 for the product so it wasn't an issue.
The MPC5744 supports ASIL D functional safety so it has EC FLASH, EC RAM, EC buses, independent fast ADCs and a bunch of other features that are required for that level of safety certification.
If you must use a mega then you should at least implement some basic safety features such as a checksum for FLASH, readback of RAM parameters, the brown out detect and the watchdog timer. The brown out detect is important because voltage dips can cause the supply voltage to drop outside of the safe operating area for 16MHz operation.
By NickZ
#56876
i had a little play with this last night, i can only get the throttle plate to open about 1/5th with full pedal travel.
ive run the calibrations.
Is there a setting i might be missing?
By JHolland
#56883
NickZ wrote: Tue May 10, 2022 1:10 am i had a little play with this last night, i can only get the throttle plate to open about 1/5th with full pedal travel.
ive run the calibrations.
Is there a setting i might be missing?
What throttle body and what motor driver are you using?
#56887
NickZ wrote: Tue May 10, 2022 1:10 am i had a little play with this last night, i can only get the throttle plate to open about 1/5th with full pedal travel.
ive run the calibrations.
Is there a setting i might be missing?
You are likely triggering the safety mode! At the moment that maps the APP vs TPS to 1:0.5 with completely linear control. If you turn on the debug menu with `3` it will tell you where it's unhappy, You probably also don't have the safety correlation set up, that can be done with 7. The UI is still extremely janky, as in functional enough to test but not very easy to use.


Procedure:
`1` - calibrate throttle plate
`2` - calibrate pedal
`7` - safety correlation, so there's a 4 point table right now, pedal/tps minimum maximum is always minimum maximum of the safety, that is calibrated in the previous steps, Now it's asking for: "APP1 Second source" meaning where you want the calibration point to be at APP1, then it asks for "APP2 second target" meaning what you expect the safety input to be. EG APP1 = 900, APP2 = 250, and if they are too far apart then it will complain and trigger a safety mode. You can disable this safety mode by commenting out line 237. The same correlation logic applies to throttle plate too. The limitation of this is that the source values, so APP1 and TPS1 HAVE to be ascending. So MinAPP < Second APP1 < Third APP1 < MaxAPP, applies to TPS aswell, doesn't matter for APP2 so target or expected.

`4` - after you're done make sure to save settings to eeprom.
By NickZ
#56888
from what i understand your saying, the Accelerator need one value to be going up and one to be going down?
My Toyota Prius pedal both go up.
throttlepedal.jpeg
throttlepedal.jpeg (51.06 KiB) Viewed 4726 times

you could set 'skip revolutions' to 3, then it wou[…]

Hi, I am trying to assign Signed values to the x-a[…]

blitzbox

I've finally figured out why MAP and Lambda weren'[…]

Hello, I bring news!! Let me tell you that after […]

Still can't find what you're looking for?