From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

acceleration Ramp , hold, deacceleration ramp


@Kevin_Price wrote:

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


Frankly, I'm still trying to wrap my head around why the OP is trying to use a single PWM output to control a stepper motor.  

 

What is the motor model.  Link a spec sheet.  You have a basic misunderstanding of your system.


"Should be" isn't "Is" -Jay
0 Kudos
Message 11 of 16
(526 Views)

Hi Jay,

I use MyRio,  Stepper motor (42BYGHW811) and a TB6600 Stepper Motor Driver.

Why i need a different Diver?

0 Kudos
Message 12 of 16
(515 Views)

Hi Kevin,

i don't know how to implement this one

https://forums.ni.com/t5/LabVIEW/Steppermotor-count-steps-and-speed-controll/m-p/4252646/highlight/t...

 

I know how to get the element out of the array and i can not connect  it whit the PWM

 

best regrades

 

0 Kudos
Message 13 of 16
(507 Views)

@Akbaba66x wrote:

Hi Jay,

I use MyRio,  Stepper motor (42BYGHW811) and a TB6600 Stepper Motor Driver.

Why i need a different Diver?


That makes more sense!  The driver converts digital edges into step counts and outputs A and B channel waveforms to the stepper motor.  We needed that information and can ignore the stepper motor and the motor driver concerns (assuming all dip sw settings are correct)  .  DC motors are often controlled by PWM outputs by using a fixed frequency and varying Duty Cycly to control speed.  I'm glad you added your system details.  You are on the right track.  Your ramp frequency will be from 0 to the maximum number of counts per second needed to reach the desired rotation rate.

 

Now, we need to know how to ramp the spin.  Assume you ramp from 0 to 50 or 100 RPM Do you want to:

  • Take the same time to ramp from 0 to 50 RPM as 0 to 100 say 5 second each
  • Limit the ramp rate to a maximum e.g. no more than 10 RPM per second? 5 seconds to 50 RPM and 10 seconds to get all the way to 100 RPM

You can look at the motor specs for the rated torque and calculate the angular momentum of the load on the shaft.  


"Should be" isn't "Is" -Jay
0 Kudos
Message 14 of 16
(505 Views)

I'm going to say this bluntly.  Given the conversation & code so far, you don't seem to be ready to tackle this right now.  I say this to be constructive and save you from wasted time -- my best advice is to prepare to either:

 

1. Spend a *lot* of time learning LabVIEW, stepper motors, and mechanics and dynamics of motion systems while regularly tinkering to "bring the lessons home".  Probably many weeks at minimum, could easily be more if you only have limited time for this.

 

2. Spend a relatively small amount of $ to purchase a stepper controller that can do the trajectory generation for you in response to simple communication commands.

    Sorry, I've been away from any notable stepper work for more than 2 decades, so I don't have any specific recommendation.  My guess is that there are plenty to choose from now in our "Maker era".

 

On the plus side, the pic you shared in another thread makes this look like a pretty simple motion system.  NEMA 42's are lower inertia and thus more forgiving of mediocre frequency trajectories.  The lead screw pitch will help reduce the loads (friction & inertia) seen by the motor.  There's still things for you to learn, but at least the general mechanics of your system aren't pushing the envelope.

 

 

-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 15 of 16
(492 Views)

Hi Kevin,

i know that i am not the best in Labview, so i ask for the help.

The diver part is just a little part of my project so i have not so much time for all that learning.

At my first attampt nearly brake my constriction so try it only digital at first

 

0 Kudos
Message 16 of 16
(461 Views)