09-22-2022 07:55 AM - edited 09-22-2022 08:01 AM
@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.
09-22-2022 09:21 AM
Hi Jay,
I use MyRio, Stepper motor (42BYGHW811) and a TB6600 Stepper Motor Driver.
Why i need a different Diver?
09-22-2022 10:37 AM
Hi Kevin,
i don't know how to implement this one
I know how to get the element out of the array and i can not connect it whit the PWM
best regrades
09-22-2022 10:52 AM - edited 09-22-2022 11:11 AM
@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:
You can look at the motor specs for the rated torque and calculate the angular momentum of the load on the shaft.
09-22-2022 12:11 PM
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
09-23-2022 02:48 AM
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