LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

acceleration Ramp , hold, deacceleration ramp

 

Hi Guys,

i try to build this  movement plot for my stepper motor. For that I use myRio and control the motor with PWM Frequency.

i already try it with the ramp vi but the result is an array , which i can not use for my frequency .

Can somebody help me ??

trap_move.png

Best Regrades

Akbaba

0 Kudos
Message 1 of 16
(1,107 Views)

Hi Akbaba,

 


@Akbaba66x wrote:
 

 

i already try it with the ramp vi but the result is an array , which i can not use for my frequency .


Why can't you use the array for your PWM generation?

(Why don't you attach your current VI?)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 16
(1,081 Views)

I

I don't have a actually VI. i just testing it with a Ramp_Pattern.

 

 

Unbenannt.jpg

0 Kudos
Message 3 of 16
(1,064 Views)

It would really help if you sent the code not as screenshot, but as a file or snippet. Others than can work on your case and quickly show you their ideas.

 

These Express VIs you use work with single frequency value. You can use these, but you basically need to write the frequency value every N milliseconds. So a for loop would be needed where you feed a new value of frequency one by one. I think there are also VIs where you input the desired sequence all at once and the sequence is automatically outputted at a given sampling frequency, which would be more precise.

 

0 Kudos
Message 4 of 16
(1,056 Views)

Sorry, i forget the vi.

I thick the automatically outputted at a given sampling frequency is better

 

 

0 Kudos
Message 5 of 16
(1,050 Views)

Ramp pattern will work if you use it correctly. 

 

First, you want to chose start and stop values corresponding to the frequencies you want to output.  You can create a dwell array too!  Just append the ramp up, dwell, and ramp down arrays.

 

Then, you need a loop to pass each value element by element to the PWM frequency input. A For Loop with an autoindexing input would work well.  Add some time delay to the loop to set the dt.

 

You might want to use some low pass filter as well to prevent the hardware from jerking as it changes acceleration.


"Should be" isn't "Is" -Jay
0 Kudos
Message 6 of 16
(1,031 Views)

Hi

Do you have in example vi.

I don´t now how to do it.

 

Best Regardes

0 Kudos
Message 7 of 16
(1,015 Views)

Made any progress with prior, moderately detailed suggestions?   What's the sticking point?

 

Maybe it's time to consider buying a stepper controller that can do the trajectory generation for you...

 

 

-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 8 of 16
(1,002 Views)

I try a test version of the acceleration. but i get always 0.

I have know idea why?

0 Kudos
Message 9 of 16
(981 Views)

1. Starting from 0 freq -- not truly possible for a stepper.  0 freq takes infinite time!

2. Not specifying # samples in the ramp.  It isn't 0, but you need to be in control of this.

3. You auto-index a loop with your ramp values.  Then you turn each scalar into a 1 element array.  Then you index into that array with an ever-increasing index value, asking for elements that don't exist.  So LabVIEW gives you the default value for your datatype -- 0.

4. You don't auto-index with the output, so you only retain the very last value from all that For Loop iteration.

5. The whole thing is wrapped up in a While Loop that basically erases all your work as soon as its done.

 

I added an illustration of ramp generation to your code.  Spot the differences!   (But please be aware, this is still only a *very*, *very* small step toward your end goal of general trajectory generation for position control.)

 

 

-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 10 of 16
(968 Views)