Jump to content
Sign in to follow this  
VisSim Forum Archives

how to repeat ramp function in vissim embedded

Recommended Posts

Submitted by pete on Wed, 03/09/2016 - 20:36.

Hi Yogesh, There are a couple ways to do this depending on what you're looking for.

  • For a floating point fixed frequency repeating ramp, use
    Blocks > Signal Producer > sawtooth

  • For a fixed-point fixed frequency repeating ramp, use
    Diagrams > Toolbox > Fixed-point > Ramp16
    Diagrams > Toolbox > Fixed-point > Ramp32

  • For a fixed-point variable frequency repeating ramp, use
    Diagrams > Toolbox > Fixed-point > VariableFrequencyRamp32

Share this post


Link to post
Share on other sites

Submitted by pete on Fri, 03/11/2016 - 11:50.

The msp430G2553 is a 16MHz device so each instruction takes .0625 usec. If we make a simple for loop that takes 3 ticks per iteration, we'll need 53 iterations. See how to do it in the attached diagram. (You must be signed in to download)

10-usec-pulse.vsm

Share this post


Link to post
Share on other sites

Submitted by Yogesh K on Wed, 04/06/2016 - 16:26.

hii sir . its working but the result is not so proper.sometime it is not showing, may be this is because of off time . for proper working off time for this sensor should be 60 msec.so i calculate the for 60 msec 0.0625Usec * X = 60000 usec X= 960000 iteration i am right if yes how it implement in vissim emebdded. thanking you....

VNIT

Share this post


Link to post
Share on other sites

Submitted by pete on Wed, 04/06/2016 - 19:56.

Yogesh, You don't want to do a "spin" loop for 60 millisecs, that's way too long. Instead use a hardware timer, or counter based off the control timer interrupt that runs the diagram. Post the diagram you are currently using and I'll modify it for you. It will be a bit tricky since you only have one timer on the part you are using.

Share this post


Link to post
Share on other sites

Hi Yogesh, As sound travels .344 meters /millisec, we can just count the millisecs until we get the return pulse, and distance is millisec count * .344/2.
See attached file below. Note that I don't know which GPIO you are listening on, nor do I know what you want to do with the distance, so you'll have to handle that yourself. I am sending it to an external variable right now.
You may have to add some blanking logic to ignore a sensor pulse that you get when you initially send the pulse out.
Here is an image of the diagram:
distance sensor diagram Pete

ultra2.vsm

Share this post


Link to post
Share on other sites

Submitted by Yogesh K on Tue, 04/26/2016 - 16:04.

hii sir i want to compare " distanceMeasure" with my reference value. and output gives to the motor,but when i connected to my launchpad , it is not showing any high value , may be this is because of variable i used wrong syntax. if any changes tell me . thanking you

ultra3.vsm

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
You are posting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...