11-09-2010 09:20 PM
I am a college student currently and my school has a Labview class and
we are using Lego's Mindstorm for a fun application to the labview
programming
I have been having alot of problems with calibration, well not alot just 1, I am using a NXT-G calibration
program that I found on these forums, it works great until about 10 or
15 seconds into my original labview PID line following program, then it
reverts back to the original values,
I have tried to make a calibration program in labview but I can not make heads or tails of the calibration
block, I have tried many things, but keep getting errors when I try to
run the program, I have uploaded .cal file from my brick to try and look
at the contents and how it is writen to try and create a program that
would create my own .cal file but I can not veiw the symbol's it seems
just wondering if any of you have had this problem or have had any
experience with Labview and the nxt toolkit. any information would be
great, because when the sensor is not calibrated I am only getting
around 20 values, and i personally think that is not enough values for
that style of line following
11-11-2010 09:49 AM
Hi Chris,
Are you building something like this? And you're having an issue with the calibration of the sensors? How do the calibration values revert to the original?
If you could clarify your issue, and perhaps attached the related code, I may be able to have some further insight.
All the best,
11-11-2010 10:34 PM
Hello Fred,
I will try to clarify as best I can
That link that you put up is actually the site I got my calibration program from.
I have attached a file of my simple PID navigation program, the calibration is from the NXT Line Follower Website.(ran in NXT -G inviroment)
My Vi is fairly simple, it uses 2 simple line equation formulas, you enter in X = (scale Value of light sensor) and it will output desired motor speed,
It uses 2differant formulas one of which is for when the Scale Value is > or = to 50, the other formula is for when the /scale Value is <50,
The reason that I need/want the calibration is that having a full range of 100 scale values will give me greater resolution for motor corrections. My light sensor with ought the calibration is giving me a scale value, with the min of 40 and about a max value of 62, and that will be dependent on ambient light conditions.
So if the light changes with uncalibrated values I would in turn have to change my formulas every time I pull the robot out, which is why I would much rather just run a calibration program before each run.
Now that I feel that I have given sufficient background now to dive into the actual problem I am having.
The calibration program that I have been running works great. It creates a light sensor.cal file on my brick and when I run the "view light 3" program the scale value stays calibrated to the 0 to 100 scale indefinitely. (one thing when I go to class tomorrow I will be making a labview vi to simply display the light values like the "view light 3" nxt-g program so see if it is a problem with labview overriding the calibration) I will update you after class about that
When I run my portable robot.vi it works great also, for the first 10 - 15 seconds, reading from the calibration file and producing the correct values of 0 for the black line and 100 for the white area around the line. after about 10 -15 seconds with MY vi running the displayed scale values revert back to the original scale values of 40 for the black line and 62 for the white area,
this does not seem to be a problem with the calibration file, because when I restart my vi, the same thing happens, it starts out with calibrated values, then reverts back to default readings.
I have tried various ways of using the actual labview calibration block from the "NTX Native I/O" pallet. I port the code over to the brick and get an error when I try to run the code, there is no error message other than "error"
I have tried taking the calibration file off the brick and viewing it, with no success, to find out later that I need to view it with a binary editor. I will be doing this soon; one of my partners took the robot home to redesign the chassis so I will be doing that tomorrow also.
I have also contemplated trying to simply creating my own calibration file through labview once I view the layout of the original light sensor.cal file
in summary,As of now I am thinking that Labview is overriding the use of the calibration file, I do not know how or why. also I think being able to make an actual labview calibration program would help out alot, I will look into the math behind the calibration in order to create a program.
I tried to articulate my problem to the best of my ability (writing is not my strong suit)
Any help would be great and I hope this added info will be helpful to you
11-15-2010 10:41 AM
Hi Chris,
I've taken a look at your code, and everything seems to be in order. I'm not actually sure how the NXT calibration process works; it's like a black box, so I don't know why it would lose it's calibrated value after 15 seconds.
Have you been able to look at the calibration file directly?
Creating a LabVIEW VI to create the calibration file, and then explicitly read those values into your control program sounds like the best idea. That way you aren't dependent on unknown code maintaining the calibration values for you.
Let me know how it's working out for you.
Hope this helps,