LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

control a stepper

Hi,
I want control a stepper who needs pulses of 5V.With every puls it make one stepp.
I want to increase and control the speed of the pulses.
 
The pulses come from the counter of the connector block.
 
I have a worse resolution (attachment) where this funktion works.But every time the while-loop starts I have a short break in the funktion and this
makes big problems at higher speed.
So what can I do to control the funktion during it runs?
 
Thank you for helping
0 Kudos
Message 1 of 12
(3,927 Views)

You want a loop between your start and stop which will be your control loop inside this loop you can wire the task to use the channel property node and write the CO.Pulse.Frequency and set the frequency on the fly this way you wont have to stop and restart your tasks and will be able to have a smooth update on your stepper.

 

Paul

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 2 of 12
(3,889 Views)

Hi Paul,

thank you for your help.

What loop do you meen? Can you describe it with more detail or pace a pic.

This would be very kind of you.

regards Smoofo

0 Kudos
Message 3 of 12
(3,864 Views)

See the attached, it is a simple program showing a continious update of a pulsetrain out of "dev1/ctr0".  Hope this helps.

Paul

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 4 of 12
(3,857 Views)
Hi Paul,
your the best.This is what I want and surched for.
I didn't know that I could use the ivent structure for this.
Is it from you or have you found it in the libery.
 
Thank you very much.
Smoofo
0 Kudos
Message 5 of 12
(3,849 Views)

Yes this is just a simple example I wrote in about 5 minutes but you can extend it into a full application by placing the entire structure in a while loop and using a state machine design pattern where the possible states are configure, start, stop and update.  With labview you can do just about anything.

 

Paul

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 6 of 12
(3,839 Views)

Hi Paul,

I have one pedition to you.

I have seen that I have now ivent structure one my base version so I can't control your Vi.

So I want make a ramp or were I can say: Start with ca. 100Hz and turn up to 4000Hz or something.

So how can I do this If I have no ivent strukture or control them.

 

I'm going mad with this funktion.

If you had the time it would be nice if you will think about it.

 

Thank you and best regards

0 Kudos
Message 7 of 12
(3,832 Views)

I will remove the event structure and repost it with a ramp.

 

Paul

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 8 of 12
(3,813 Views)

Here is an example with a discrete ramp, you can specify the step size, initial frequency and number of steps as well as the dweel time at each step.

 

Paul

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 9 of 12
(3,811 Views)
Attachment for the last message is here:
Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 10 of 12
(3,809 Views)