# Limit the current from a voltage source?

**URL:** <https://forum.plexim.com/t/limit-the-current-from-a-voltage-source/552>\
**Category:** PLECS\
**Tags:** limit, current, power, supply\
**Created:** [September 24, 2018, 9:01am UTC](https://forum.plexim.com/t/limit-the-current-from-a-voltage-source/552 "2018-09-24T09:01:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![TimAllan](https://avatars.discourse-cdn.com/v4/letter/t/b9bd4f/32.png) [@TimAllan](https://forum.plexim.com/u/TimAllan)\
**Post date:** [September 24, 2018, 9:01am UTC](https://forum.plexim.com/t/limit-the-current-from-a-voltage-source/552/1 "2018-09-24T09:01:52Z")

</div>

Hi

How do I simulate/model the current limit of a voltage power supply?

---

<div class="post-metadata">

**Author:** ![Oliver\_Schwartz](https://dub1.discourse-cdn.com/flex006/user_avatar/forum.plexim.com/oliver_schwartz/32/6_2.png) [@Oliver\_Schwartz](https://forum.plexim.com/u/Oliver_Schwartz)\
**Post date:** [September 25, 2018, 2:26am UTC](https://forum.plexim.com/t/limit-the-current-from-a-voltage-source/552/2 "2018-09-25T02:26:07Z")

</div>

Tim,

you’d need to combine an ideal voltage source with an ideal current source and switch between them. If the current through the voltage source exceeds your threshold current you’d switch to the current source. If the voltage across the current source exceeds the threshold voltage, you’d switch back to the voltage source.

An open current source will lead to a simulation error, so you’d have to short-circuit the current source when not used (or provide another path for the current).

Kind regards,

Oliver Schwartz

---

<div class="post-metadata">

**Author:** ![Jonny](https://avatars.discourse-cdn.com/v4/letter/j/47e85d/32.png) [@Jonny](https://forum.plexim.com/u/Jonny)\
**Post date:** [January 19, 2022, 9:49am UTC](https://forum.plexim.com/t/limit-the-current-from-a-voltage-source/552/3 "2022-01-19T09:49:55Z")

</div>

Tim, I’m sure you will have moved on from this problem now, but I’ll post my solution in case someone else finds it useful…

I had a similar problem modelling a current and power limited capacitor charging power supply. In the end I replaced the voltage source with a current source controlled by the capacitor voltage. See model attached.

Regards,

Jonny

[Charging Power Supply example.plecs](https://forum.plexim.com/uploads/short-url/1gqWAHh4y99HUW80T7GYQMAT4rM.plecs) (12.6 KB)
