From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
02-24-2012 11:58 AM
Hi all. I am in need of some help and suggestions . I'd like to make my code more efficient and reduce the likelihood of errors. Specifically i'd like to know how to create a simple algorithm in LabVIEW to control the steps and direction of my stepper motors. At present I am just repeating my code for each stepper in several states to control the same stepper but moving a different number of steps and direction. I have one stepper that controls a pump mechanism hence the flow rate. One stepper that controls front/back motion of an sample injector block system. One stepper that controls up/down motion of the injector block. I am also using an Arduino Mega 2560 ( all the drivers etc and installed) .
Solved! Go to Solution.
02-25-2012 11:18 AM
Hi Charles
I have look your code , but i don't understand your process. Can you describe it step buy step if you want i help you.
Eric Bobillier (France)
02-25-2012 12:10 PM
Sure. The process is as follows:
1. First set the flow rate. Stepper number one will run at constant speed to mantain the pump flow rate at whatever the user inputs.
2. When prompted to sample
3. Stepper number one will run at constant speed to mantain the pump flow rate at the input value.
Charles
02-25-2012 06:30 PM
Hi Charles
Here is my version, can you test it (i don't have arduino card at home) but i think it's ok. Take care i have modify pump pin numbers (show diagram).
Eric
02-25-2012 09:13 PM
Ok, so I am still going through your code but first things first... thank you for your help. I will post my feedback when I test it .
02-26-2012 03:32 AM
My first release is buggy.
Here one another version who run better when you stop. Eric
05-28-2012 03:20 AM
I know its been a while but I am back again. I would like some help in modifying the current code to do the following.
1. Add a second pump (12vdc) to the stepper sequence.
2. Turn a fan on/off for five minute intervals.
3. Use a hall effect sensor to measure rpm and control pump speed.
The new step by step sequence is now as follows :
1. First set the flow rate/ pump speed for stepper number one .
2. When prompted to sample
* There are 4 different sampling positions so stepper number two and three will move different steps each time the user hits sample.
3. Turn fan on/off for five minute intervals.
I have two questions. Firstly is there a better way to do the five minute intervals. In my current code I think the event structure will only read when there is a value change ( sample button) instead of the specified time interval. Secondly how do i incorporate the hall effect sensor measurement and control to the current code. I would appreciate any help before I butcher the code that was given to me.
Thanks in advance
Charles