# Dual active Bridge Demo Continuous to Discrete Signal

**URL:** <https://forum.plexim.com/t/dual-active-bridge-demo-continuous-to-discrete-signal/2252>\
**Category:** PLECS\
**Tags:** c-script, variable-phase, dual-active-bridge\
**Created:** [June 8, 2025, 11:13pm UTC](https://forum.plexim.com/t/dual-active-bridge-demo-continuous-to-discrete-signal/2252 "2025-06-08T23:13:17Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![kalana](https://avatars.discourse-cdn.com/v4/letter/k/77aa72/32.png) [@kalana](https://forum.plexim.com/u/kalana)\
**Post date:** [June 8, 2025, 11:13pm UTC](https://forum.plexim.com/t/dual-active-bridge-demo-continuous-to-discrete-signal/2252/1 "2025-06-08T23:13:17Z")

</div>

Hi,  
I am trying to develop a DAB using the model given in the demo version. But however when I change the inputs like Vo, Pin, fsw etc. program crashes.

I think its because of the transfer function given in the model. I think if I do a Bilinear transformation it will fix the issue. Can you please suggest how to implement this or if there is another work around ? I am trying to develop the Single phase shift controls

 ![Screenshot 2025-06-08 161007](https://europe1.discourse-cdn.com/flex006/uploads/plecs/original/2X/5/5eae39844fd09d8260d0c073295f039ec8dcd00d.png)

Thank you

---

<div class="post-metadata">

**Author:** ![kalana](https://avatars.discourse-cdn.com/v4/letter/k/77aa72/32.png) [@kalana](https://forum.plexim.com/u/kalana)\
**Post date:** [June 9, 2025, 3:05pm UTC](https://forum.plexim.com/t/dual-active-bridge-demo-continuous-to-discrete-signal/2252/2 "2025-06-09T15:05:10Z")

</div>

@Plexim_Support_Team can you please let me know how to get this model work for other input, output values ?  
I think the issue is with the transfer function and if I do a Bilinear transform it should fix it. I am not aware how to do it on plecs.

---

<div class="post-metadata">

**Author:** ![Bryan\_Lieblick](https://dub1.discourse-cdn.com/flex006/user_avatar/forum.plexim.com/bryan_lieblick/32/10_2.png) [@Bryan\_Lieblick](https://forum.plexim.com/u/Bryan_Lieblick)\
**Post date:** [June 9, 2025, 8:06pm UTC](https://forum.plexim.com/t/dual-active-bridge-demo-continuous-to-discrete-signal/2252/3 "2025-06-09T20:06:16Z")

</div>

There is not enough information here to assist you. The control parameters for the demo model were based upon that specific power converter. If you change the controller and/or DAB circuit, then the controls will need to be reworked. Your discrete transfer function potentially introducing an instability is a reasonable hypothesis, but without a model I cannot provide much guidance.

If you have a continuous transfer function for your controller you can directly perform a bilinear transform in the PLECS Standalone Model Initialization Commands using the [c2d function](https://gnu-octave.github.io/pkg-control/@lti_c2d.html).

---

<div class="post-metadata">

**Author:** ![kalana](https://avatars.discourse-cdn.com/v4/letter/k/77aa72/32.png) [@kalana](https://forum.plexim.com/u/kalana)\
**Post date:** [June 9, 2025, 8:25pm UTC](https://forum.plexim.com/t/dual-active-bridge-demo-continuous-to-discrete-signal/2252/4 "2025-06-09T20:25:26Z")

</div>

I am trying to do a dual phase shift simulation and i am building it off of the Demo DAB. How would I do the Bilinear transformation in Plecs ?  
Can you please provide an example for that ?

Thank you

---

<div class="post-metadata">

**Author:** ![Bryan\_Lieblick](https://dub1.discourse-cdn.com/flex006/user_avatar/forum.plexim.com/bryan_lieblick/32/10_2.png) [@Bryan\_Lieblick](https://forum.plexim.com/u/Bryan_Lieblick)\
**Post date:** [June 9, 2025, 10:35pm UTC](https://forum.plexim.com/t/dual-active-bridge-demo-continuous-to-discrete-signal/2252/5 "2025-06-09T22:35:52Z")

</div>

Attached is a simple example showing the discretization of a second order system using tustin and tustin with prewarp. The only slightly tricky aspect is the LTI dataclass in the Octave Control package returns cell arrays which have to be handled appropriately.  
[c2d\_example.plecs](https://forum.plexim.com/uploads/short-url/5ASqfHDKTBfrnwpsxwRpILAITRY.plecs) (7.7 KB)
