LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Ramp up, Ramp Down

I have searched around and found an example that is very close to what I need.  I would like to be able to set a high current limit of, let's say 20, and a low current limit of 0.  This examle works, but I would like to delete the burn in time and instead have a switch that will select between ramping up or down.  If you are at current 0 and select "ramp up", it will begin ramping up towards the set current value, if it reaches the set current, it holds there.  If at any time you move the switch to "ramp down", it will begin ramping down at the same speed, until it hits 0 and holds there. Perhaps a 3-way switch of up, off, down? Can someone help?

0 Kudos
Message 1 of 8
(4,081 Views)

Hi Tron,

 

some pseudocode:

ramprate := current/time
out := 0
mode := up
WHILE not stop
  SWITCH mode
    up: out := out + ramprate
    down: out := out - ramprate
    off: out:= out
  END_SWITCH
  out := InRange(min, out, max)
  IF InRange.OutOfRange THEN
   mode := off
WEND

You need an enum for the mode, a case structure for the SWITCH and the InRangeAndCoerce function…

(You might also build up a real state machine from this simple approach.)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 8
(4,073 Views)

Thank you for the reply.  I should have mentioned that I am very new to labview, therefore I don't actually understand any of your answer.  I was hoping someone would be able to modify my example vi and I could look at it to understand.

0 Kudos
Message 3 of 8
(4,069 Views)

Hi Tron,

 

so you want someone else to solve your homework instead of trying to learn LabVIEW on your own?

(Learn LabVIEW)

 

I told you which items you would need. (I forgot to mention shift registers!)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 8
(4,062 Views)

I hope you don't sprain your arm patting yourself on the back.

0 Kudos
Message 5 of 8
(4,033 Views)

Here is something that may help you get started.  Open "Ramp Up Down.vi"

CLA
0 Kudos
Message 6 of 8
(4,019 Views)

@TronCarter wrote:

I hope you don't sprain your arm patting yourself on the back.


I didn't read this thread that way.  You asked for help, detailed help was given.  You said you didn't understand it due to your lack of LabVIEW knoledge, a link to learning LabVIEW was given (mentioning homework was a bit of an assumption I'll admit).

 

If you have a particular function, or feature you are unfamiliar with please ask away and we can be more helpful.  But stating you don't understand anything makes me think you should start with the basics.  Here's a couple more general links given out.

 

NI Learning Center

NI Getting Started

-Hardware Basics

-MyRIO Project Essentials Guide (lots of good simple circuits with links to youtube demonstrations)

-LabVEW Basics

-DAQ Application Tutorials

-cRIO Developer's Guide 

Learn NI Training Resource Videos

6 Hour LabVIEW Introduction
Self Paced training for students
Self Paced training beginner to advanced, SSP Required

Message 7 of 8
(4,011 Views)

Hi terickson,

 

while using "PID output rate limiter" really eases Trons problem I don't think it's a good idea to upload renamed VIs grabbed from LabVIEW toolkits…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 8
(3,971 Views)