04-09-2020 08:03 AM
Hello All,
I am working on a project I have to do controlling of air bearing system.
What controls I have to make,
Absolute Zero : when I click this button air bearing should rotate back to initial zero degree position
Absolute 360 : when I click this button air bearing should rotate to 360 degree degree position
Absolute move: it should rotate to certain commanded degree position (Ex: when I command to position of 20 degree it should reach to 20 degree position)
Relative Move : I should rotate to commanded degree further. (Ex : when I command 20 it should further rotate to 20 degree from current position)
Stop Profiler : it should stop profiler (Rotational bearings).
Command means:
UM=5; : operation mode
MO=1; : Motor ON
PA=xxxx; : Absolute position
PR=xxx; : Relative position
SP=xxxx; : Velocity of the rotation
BG; : begin motion or rotation
I have created VI to do the same operation, have created event structure do the operation whenever we command the signals, but facing some issues.
VI structure:
First I initialize the VISA
initialize the rotational air bearing system
1) Time out : doing nothing
2) Absolute move : Event structure value change _ sending position command and velocity then command to begin operation
3) Relative Move : Even structure value change _ sending position command and velocity then command to begin operation
4) Absolute Zero : Even structure value change _ sending position command (Zero degree position) and velocity then command to begin operation
5) Absolute 360 degree : Even structure value change _ sending position command (360 degree position) and velocity then command to begin operation
6) Stop profiler : Even structure value change _ Stop rotation of the air bearing system
Problem:
Whenever I click absolute zero it moves to zero degree position, when I click to absolute 360 degree sometime it moves sometimes not, absolute move /Relative move : it does not work (when I click on light bulb from labveiw and do the operation in slow it performs the task.
whenever i change the velocity value, it does not update every time,
I also have attached video for more information
Do anyone have idea why absolute move and relative move does not perform in real time and only performs the operation in slow execution.
I have attached the VI
04-09-2020 09:27 AM - edited 04-09-2020 09:29 AM
Hi mi,
@mi1111 wrote:
What controls I have to make,
Absolute Zero : when I click this button air bearing should rotate back to initial zero degree position
Absolute 360 : when I click this button air bearing should rotate to 360 degree degree position
Do anyone have idea why absolute move and relative move does not perform in real time and only performs the operation in slow execution.
Is there a difference between 0° and 360°? IMHO it's the same position!
Several problems with your VI:
All control terminals belong into their event cases to ensure reading the correct values.
No need for all those boolean local variables when you change the button to latched switching mode!
No need for a TimeOut event when nothing happens inside the event case…
The string formatting can be simplified by using FormatIntoString…
No need for sequence frames inside those event cases!
Does your device ever responds to your commands - or can you request its current status?
04-09-2020 10:10 AM
Hi,
Thank you very much for prompt response.
Absolute zero and absolute 360, if we see the position then i look same, but zero is initial position and 360 is end position. it will be helpful in my application.
All controls sending right commands and signals, I place probe and checked.
I will remove useless local variable used inside VI (They should effect the operation right ?)
Can I remove the timeout event? (Does it effect the operation?)
I change decimal to string with format to string.
I remove sequence frame
My concern about the VI is when I run absolute move and relative move (event change) in slow operation it works and performs, but when i run the same operation in regular mode it does not rotate the air bearings.
It is not same for absolute 360 , in absolute 360 some times it performs and sometime does not.
while absolute zero works fine. (in all operation commands are almost same only position value changes )
Note: I am using LabVIEW 32 bit version in laptop which has 64 bit configuration can it be a problem?
Why VI works fine in slow operation and not in regular mode , I think it is a timing issue.
04-09-2020 11:15 AM
If, by "slow mode" you mean "highlighted execution" mode, then that usually means you have an incomplete understanding of the communications protocol. A corollary to that is if you have to put hard waits between your writes and reads, same thing - you probably have an incomplete understanding of the communications protocol, as well.
04-09-2020 02:02 PM
Could you just let me know what should I do , what means incomplete understanding, could you describe little deeply , where is the problem what could be the solution.
"Incomplete understanding" statement it self looks incomplete with out explanation.
Thanks
04-09-2020 02:20 PM
More people will be in a position to help if you back-save your vi to an earlier LabVIEW version. (File menu -> Save for Previous Version...)
I'd recommend saving back to LV 2016.
-Kevin P
04-09-2020 04:43 PM - edited 04-09-2020 04:46 PM
@mi1111 wrote:
Could you just let me know what should I do , what means incomplete understanding, could you describe little deeply , where is the problem what could be the solution.
"Incomplete understanding" statement it self looks incomplete with out explanation.
Thanks
My apologies; you are correct. Let me see if I can explain it, because it's about the concept more than anything.
Now the following is pure conjecture, but this is a scenario I can envision:
The code works in lightbulb mode because you are actually supposed to wait for a response before issuing the next command. Since lightbulb mode slows the code down immensely, it gives the machine time to get ready for the next command. When executed at normal speed, you don't have the lightbulb to slow you down, so you send commands before the machine is ready to process the next command. It will skip some commands while executing others, depending whether it was ready or not.
That is what I meant by "incomplete" understanding of the communications protocol, and that is why GerdW asked you if you were expecting a response.
Again, sorry about the vagueness of my last post, and I hope this helps you to understand what (GerdW and) I meant.
04-10-2020 01:44 AM
I try on Tuesday and make more comments afterwards,
I put some delay between commands I am sending.
Btw thank you very much dear for your response and explanation.
04-10-2020 08:19 AM
@mi1111 wrote:
I try on Tuesday and make more comments afterwards,
I put some delay between commands I am sending.
Btw thank you very much dear for your response and explanation.
Yes, this is what I meant about "incomplete" understanding of the communications protocol. With most protocols - and I say "most" because I've run into one power supply that actually specified that you needed to wait x msec for the power supply to process the command before sending another one - you don't need to include a hard-coded wait. Normally, the instrument/equipment will tell you when it is done so all you do is wait for the instrument to tell you that, then you can send the next command.
At this point, if there is a manual to read, I suggest trying to re-read it, and also uploading it here so we can read it and maybe give suggestions.
04-14-2020 08:35 AM
Now air bearing system start responding, after I put delay in between commands. Thank you very much for your kind help.
But now new problem popped up, hahaha.
I added one more even to know the position of the profiler.
Problem is when I try to find the position of the profiler I mean position of the profiler in degree.
When I call profiler position event, it gives me position along with some previous command (ST[1];;PX;157859), you can see output in below screenshot.
while the position should be only PX;157859.
And when I call the same event second time it gives me position what I need. (PX:157859)
I have attached both screenshot.
commands : PX; gives current position of the profiler
I read 16 byte information
Do you have idea why it does not give me position on first call.
I have attached changed VI.
I am using command from Elmo language. I have attached the manual