![]() |
How do you program the navx mxp in labview?
Right now we are just trying to program our navx mxp in teleop so that when we press a certain button and drive forward it corrects the robot and keeps it straight. If anyone has an example code I could look at that would be great.
Thanks! |
Re: How do you program the navx mxp in labview?
I'm unfamiliar with NavX, but what you're talking about would require a PID loop. PID loops take time to tune and basically what you're doing is handing off control of a movement axis to the robot, which is potentially dangerous.
|
Re: How do you program the navx mxp in labview?
Ok, so is there a way to make your robot drive straight in autonomous independent mode using the navx? If so do you have an example code I could look at? Thanks!
|
Re: How do you program the navx mxp in labview?
You'll need to get an angle from the NavX, is there a library function for that? Once you have an angle, you'll need to feed it in as the process variable of a PID loop. Hook up the PID VI's output to your rotation axis of your drive VI. Then, tune the PID loop.
I recommend using Select from the Comparison palette connected to a button on your joystick so that you can switch between manual and loop control by holding down a button for loop control. Also set it up so that the PID loop reinitializes whenever you press or release the button by using "Equal?" and a feedback node (in this case set it to feed forward). |
Re: How do you program the navx mxp in labview?
1 Attachment(s)
See the attached image. What happens is that one side stays at a fixed speed (percent voltage in this case) and the PID loop varies the other side to match it and keep it straight on course.
|
Re: How do you program the navx mxp in labview?
This is what we did last year. Our code is posted here.
There is a Drive subVI in TeleOp. The "Field Centric" case of the large case structure around the drive code never worked correctly...not enough time for testing it. :mad: |
Re: How do you program the navx mxp in labview?
Breakaway has done this for a couple of years now.
Because we use the gyro in both modes, we put Get_YPRHfH.vi and store the gyro's position (yaw) into a global in Periodic tasks, and use that global in auto. ![]() The basic principal is that WPI has already provided great algorithms for a x/y control algorithm (Arcade drive). So we use a PID (target gyro angle as the setpoint, the global from the gyro for the process variable, and work out the tuning) as the x input to the Arcade Drive vi, and usually a constant into the y value. We have found that the gyro updates rapidly enough to support this (we've even translated vision analysis into a desired gyro angle because the gyro was updating fast enough and the vision was not.) The NavX library has updated some since we did this. You could combine this idea with the TeleopRotateToAngle.vi in the navX\Examples folder. |
Re: How do you program the navx mxp in labview?
Quote:
If you have questions please let me know. |
Re: How do you program the navx mxp in labview?
Is there any way to get a continuous fused heading or yaw that doesn't jump at 360/0 or -180/180 degrees? I ask, because we model and correct yaw in an ongoing basis to a modeled value. I know we could reset the gyro if the abs(yaw) > 120 or so, but we want to be able to do a 360 degree closed loop orbit for testing (without sparing at the point where yaw or heading magically jump 360 degrees).
It looks like those values are only being read off a registry, and not calculated in LabVIEW. Is there any way to tell the NavX to put the non-resetting values in those registers? |
Re: How do you program the navx mxp in labview?
1 Attachment(s)
Quote:
|
Re: How do you program the navx mxp in labview?
1 Attachment(s)
Quote:
Attachment 21764 Try it and let me know if you need more capabilities. Thank you for your input, Tim |
Re: How do you program the navx mxp in labview?
Thanks for the replies. I'll check out both of your codes in our setup later on today. We worked up our own code to do this, but it looks like we lose a little bit of truth when we reset the NavX heading to avoid the edge discontinuity.
I apologize for my less than clear explanation. We have some code that filters the user input and models what we want the robot to do. We then compare this desired movement model to the current state of the inertial devices to provide a corrected input to our drive code. We are using a non-traditional holonomic drive, and the robot is not as controllable as we would like. For those who haven't looked it up, holonomic means rolling without slipping. As soon as you push a holonomic wheel hard enough to slip, you've then lost control of your rotation and translation. Likewise, if you accelerate hard enough that one wheel reduces its contact with the ground, you will lose rotation and translation control as holonomic drives work by balancing forces of non-parallel wheels/rollers. This makes your robot look like it is on the Lunacy "ice" rather than the relatively high traction carpeting. Modeling the desired motion, and then doing closed loop control to correct the robot position to match the model, is how we fix this. Maybe a better explanation is that a driver commands velocity, not position, but views the motion of the robot in its trajectory of positions over time. Our model captures the commanded velocities, translates them to realistic positions (both rotational and translational), then controls the robot to hit the expected positions by using feedback to adjust the wheel velocities. You have to model the rotational orientation to be able to seek to that, and it can't be done if you have a discontinuity in the heading when you pass through a trigonometric singularity point. |
Re: How do you program the navx mxp in labview?
1 Attachment(s)
OK here is the revised beta edition that also handles multi devices and has a reset. We may still change the overall function in the next release of this code.
Attachment 21771 |
Re: How do you program the navx mxp in labview?
Okay, this is cool and all, but how do you even OPEN this gyroscope? All our LabView is giving us is Analog and XRS450 SPI. I'm assuming we need to download the code externally (like for our CAN Talons), so does anybody have a link to that?
|
Re: How do you program the navx mxp in labview?
Quote:
http://www.pdocs.kauailabs.com/navx-mxp/software/ There is a tutorial a couple of links under that page http://www.pdocs.kauailabs.com/navx-...aries/labview/ |
| All times are GMT -5. The time now is 19:51. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi