LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Stepper Motor Ramping with a DAQ 6211.

Hi Guys.

 

I've got a quick question regarding the automatic ramping of a stepper motor using the DAQ 6211. From it's counter output, the 6211 sends a pulse train frequency to the pulse input of my stepper driver. In the attached VI, (Stepper Motor Variable Frequency 1), I can achieve ramping quite easily but only if I do it manually using the stepper motor speed control.

 

However, I want this to happen automatically over time for a given duration. I tried to do something simple like in the second attached VI, (Stepper Motor Variable Frequency 2), by just letting the frequency increase over time using an elapsed time sub VI but I think im using the wrong approach.  

 

Can anyone suggest a better modification of the first VI, to achieve the automatic ramping of the output frequency.

 

Thanks for reading guys and any help is much appreciated.

0 Kudos
Message 1 of 6
(2,702 Views)
Does anyone have an idea about this guys??. I'm thinking that the timer won't work because it needs some action by the user on the control panel to update the frequency.
0 Kudos
Message 2 of 6
(2,692 Views)

Hi Banjo B,

 

I can only recommend a couple of changes that would be worth implementing:

 

  • We should take your correctly functioning code in Stepper Motor Variable Frequency 1.vi that we know is operational and build this new functionality on top of it. This will make debugging a lot easier later on.
  • If you were to replace the Stepper Speed Control with a constant, you could still wire it into the Shift Registers of your While Loop and properly initialise the Pulse Frequency. The reason I'm saying this is because we want to abstract any suggestion that User Input is required to automate the motor speed. Therefore, through the use of dataflow, we'd be able to remove the Stepper Speed local variable altogether.
  • I would then suggest that on each iteration of the While Loop, you update the value fed into the Stepper Speed shift register based on whatever algorithm you intend to use. For example, you could just increment the Pulse Frequency value on each iteration of the loop, or you could base your frequency algorithm on time through the use of Timestamps (Using the Get Date/Time in Seconds VI). 

 

To summarise, I believe that your While Loop requires some form of iterative algorithm to directly modify and update the value which is wired to the Pulse Frequency property of your Counter task.

 

You're very close!


Alex Thomas, University of Manchester School of EEE LabVIEW Ambassador (CLAD)

0 Kudos
Message 3 of 6
(2,674 Views)
Hi there. Thanks very much for your reply.

I think have solved the problem just here this morning by utlizing a 'value' property node from the stepper speed numeric control.

By using this property node I have set up a timed sequence to increment the numeric control, keep it steady and then decrement it.

Your suggestion would be perfect also and if I have any problems going forward I'll give it a go. Thanks again for your input.
0 Kudos
Message 4 of 6
(2,665 Views)

Hey Banjo B,

 

That's really great news. It sounds like it will work fine. My method only differs in that we wouldn't be using a Numeric Control at all; just dataflow. It really depends on the behaviour you're after though!

 

Best of luck with the rest of your application.


Alex Thomas, University of Manchester School of EEE LabVIEW Ambassador (CLAD)

0 Kudos
Message 5 of 6
(2,660 Views)
The more I think about it, the better I like your idea so I'm going to try implement it this week and let you know how it goes.

Ideally I would like to eliminate that Numeric control and I was thinking of not making it visible to the user. Your suggestion would do that for me by not using it at all.

Thanks again for your help.
0 Kudos
Message 6 of 6
(2,658 Views)