how to repeat ramp function in vissim embedded

Altair Forum User
Altair Forum User
Altair Employee
edited October 2020 in Community Q&A

Submitted by Yogesh K on Wed, 03/02/2016 - 14:45 

 

i am new one with vissim embedded. i am trying to generate ramp function which repeat at particular time. how i generate this ramp function . thanks..

Tagged:

Answers

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited June 2016

    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

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited June 2016

    Submitted by Yogesh K on Thu, 03/10/2016 - 10:35.

    thanks for ur answer.. i want generate 10 microsec pulse for ultrasonic sensor interfaced with msp430G2553. for triggering purpose, how will i generate this . thanks..

    VNIT

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited November 2020

    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)

    Unable to find an attachment - read this blog

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited June 2016

    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

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited June 2016

    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.

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited November 2020

    Submitted by Yogesh K on Thu, 04/07/2016 - 11:04.

    sir i am new ith vissim embedded,i do not know about how to use timer interrupt in vissim embedded.pleasr give some intro about how to use the interrupt after you solved the problem. thanking you..

    Unable to find an attachment - read this blog

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited November 2020

    Submitted by pete on Fri, 04/08/2016 - 20:42.

    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

    Unable to find an attachment - read this blog

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited June 2016

    Submitted by Yogesh K on Mon, 04/25/2016 - 12:46.

    ok thanks sir. here 'distanceMeasure' is a variable if i want to use this variable, how can i used it.

    VNIT

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited June 2016

    Submitted by pete on Mon, 04/25/2016 - 19:26.

    You use it however you want. You can display it on an LCD, you could send it out over a serial port, you could use it as input to your robot control.
    What do you want to do?

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited November 2020

    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

    Unable to find an attachment - read this blog