Please take a minute to review and accept our Terms of Use.
Welcome to the PLECS User Forum, where you can ask questions and receive answers from other members of the community.

Many technical questions regarding PLECS are answered on the Technical Solutions page of our website. Tutorial videos, specific application examples, and pre-recorded webinars are available on our YouTube page. Please follow us on LinkedIn for the latest Plexim news.

input signal to reset the TI C2000 encoder

0 votes
hi I'm using PLECS with TI C2000 Code Generation target support package. Is there a way to force the reset counter of the encoder with a software input?

In the quadrature counter encoder tab there is the possibility to choose the counter reset method. We can choose between free running and index impulse. Then there is the possibility to choose <reference>. What does <reference> means?
asked Sep 2 by Luca Mincato (32 points)

1 Answer

0 votes
Best answer
There is not a software input to reset the counter.  You could construct some logic to reset the count in your model subject to some external condition, for example by latching the count when the condition is met and subtracting the latched count from the current count.  The tricky bit will be handling the various types of rollover that can happen and in both directions.

The <Reference> is not a particular mode, but rather allows you to use a variable to select the available modes. The <Reference> convention is common any component in PLECS which uses the “Combo Box” type of parameter entry.

For example, in the Model Initialization Commands (accessible from the Initialization tab in the Simulation + Simulation parameters… drop-down) one could define a variable titled “reset_mode = 1” and then enter “reset_mode” into the reference field. A value of 1 corresponds to the second menu option (Free running), a value of 2 corresponds to the second item (Index pulse), and so on.  Then you can change this in the initialization script.
answered Sep 2 by Bryan Lieblick (1,291 points)
selected Sep 4 by Luca Mincato