08-21-2012 12:14 PM
Hi GerdW
Got it. I hadn't been defining P,S and M in the LabVIEW program which I had defined in the controller one.
Now it works great with PID control block as well.
'Thank you so much for the help.
08-22-2012 02:47 AM
Okay now my problem is:-
When I send the command to controller for getting the speed feedback it is giving me almost instantly (0.5ms - 2ms) the number of counts.
But when I interface it with the LabVIEW and I put the delay of 5ms in it, the VI is still not giving me any response(speed reading), its almost 22ms-25ms delay in the VI when the response speed is given back by the LabVIEW.
How can I minimize this delay for getting the response?
08-22-2012 02:49 AM
08-22-2012 02:51 AM
In your basic VI with comes shipped in LabVIEW examples the default delay given there is 500ms so if that reduced to 5ms I don't get any response.
But if increased to 22ms-25ms the speed count is given.
How can I reduce that delay to 5ms or less?
08-22-2012 03:00 AM
This is the VI which I am working on.
08-22-2012 03:16 AM
Ok now when I remove the property of bytes at port and just give a constant on VISA read of how many bytes do I have to read I am getting the speed response at 2ms also.
Is it the right way?
08-22-2012 03:21 AM
Hi Sunny,
yes, that's definitely the way to go. "Bytes at Port" isn't needed for proper serial communication using TermChar...
I removed some of those locals (and race conditions) in your VI. Sequences aren't needed so often. (See attachment.)
You shouldn't use the "STOP" function in your VI. Not at all...
08-23-2012 12:30 AM
Thanks a lot Sir.
02-07-2013 05:31 AM
Hi
Im a begginer and want to do a PI control on a dc motor speed via avr. I have made a diagram but I think it must have some problems especially with the feedback.
your help really needed.
If there is any problem please tell me.
The other question is that can i send and recieve more than one type of data from one serial port? i mean for e.g having two feedback, one for speed and the other for motor current.
Thanks a lot.
02-07-2013 05:48 AM
Hi Deovalente,
using the Simulation toolkit for a simple PI control is surely overkill...
- Do your really need to typecast your PI output to string? What kind of data does your "avr" expect?
- Does the "avr" really send you a DBL casted to a string, so you need to cast it back to DBL?
- Yes, your "avr" might send more than one value per message. It's up to you to decode that message in LabVIEW...
- Why do you close the serial port when you receive a message? You still want to receive further messages...
- Why do you use BytesAtPort when your serial port is set to use termination chars? Simply receive messages that are terminated by that char...