# CM4SL Desired Acceleration instead of VC.Gas

**URL:** <https://forums.ipg-automotive.com/t/cm4sl-desired-acceleration-instead-of-vc-gas/952>\
**Category:** CM4SL\
**Created:** [20 May 2024 21:32 UTC](https://forums.ipg-automotive.com/t/cm4sl-desired-acceleration-instead-of-vc-gas/952 "2024-05-20T21:32:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![fahadjudoon](https://forums.ipg-automotive.com/letter_avatar_proxy/v4/letter/f/7bcc69/32.png) [@fahadjudoon](https://forums.ipg-automotive.com/u/fahadjudoon)\
**Post date:** [20 May 2024 21:32 UTC](https://forums.ipg-automotive.com/t/cm4sl-desired-acceleration-instead-of-vc-gas/952/1 "2024-05-20T21:32:11Z")

</div>

I am designing MPC controller in cm4sl which will send acceleration as control input instead of gas pedal. Is there anyway to map acceleration to gas pedal?

Secondly, I also need to map gas pedal to acceleration.

---

<div class="post-metadata">

**Author:** ![bogomil.shtarkalev](https://forums.ipg-automotive.com/letter_avatar_proxy/v4/letter/b/8dc957/32.png) [@bogomil.shtarkalev](https://forums.ipg-automotive.com/u/bogomil.shtarkalev)\
**Post date:** [22 May 2024 08:10 UTC](https://forums.ipg-automotive.com/t/cm4sl-desired-acceleration-instead-of-vc-gas/952/2 "2024-05-22T08:10:16Z")

</div>

Hello,

There are two ACC models written in Simulink that are supplied as examples with every CarMaker installation. I think the AccelCtrl\_ACC model can be very helpful to you. It is described a bit in the Programmer’s Guide in CarMaker:

 ![image](https://forums.ipg-automotive.com/uploads/default/original/1X/745bd46a902945fdd0f0e63c8263305a05e06d78.png)

The model uses a desired and current acceleration to implement a PI controller that actuates the gas and brake.

---

<div class="post-metadata">

**Author:** ![fahadjudoon](https://forums.ipg-automotive.com/letter_avatar_proxy/v4/letter/f/7bcc69/32.png) [@fahadjudoon](https://forums.ipg-automotive.com/u/fahadjudoon)\
**Post date:** [26 July 2024 22:09 UTC](https://forums.ipg-automotive.com/t/cm4sl-desired-acceleration-instead-of-vc-gas/952/3 "2024-07-26T22:09:03Z")

</div>

![image](https://forums.ipg-automotive.com/uploads/default/original/1X/70e07430463265a9a3c23610f86afe33160217b5.png)  
This subblock from above example is working in my case.  
Thanks

---

<div class="post-metadata">

**Author:** ![fahadjudoon](https://forums.ipg-automotive.com/letter_avatar_proxy/v4/letter/f/7bcc69/32.png) [@fahadjudoon](https://forums.ipg-automotive.com/u/fahadjudoon)\
**Post date:** [26 July 2024 22:11 UTC](https://forums.ipg-automotive.com/t/cm4sl-desired-acceleration-instead-of-vc-gas/952/4 "2024-07-26T22:11:03Z")

</div>

![image](https://forums.ipg-automotive.com/uploads/default/original/1X/5308686734680aa845dac40245b9870dfe623792.png)  
This works for my second question
