Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   Mecanum - use of gyro (http://www.chiefdelphi.com/forums/showthread.php?t=87714)

Jon236 14-12-2010 12:50

Re: Mecanum - use of gyro
 
Greg,

I'm curious....why does the PID.vi itself use a regular while loop, rather than a timed loop?

kamocat 14-12-2010 23:03

Re: Mecanum - use of gyro
 
Quote:

Originally Posted by Jon236 (Post 985516)
Greg,

I'm curious....why does the PID.vi itself use a regular while loop, rather than a timed loop?

In this case, the While loop is actually not used to loop the PID function (if it were, the PID function would never get new inputs). It is instead simply for its shift registers. Note that the loop is set to end on the first iteration, and none of the shift registers are initialized (meaning they retain their values between calls).
It is also a reentrant VI, storing the shift register data separately for each instance.

The other way to accomplish this is to use feedback nodes (found in the structures palette). However, shift registers often create cleaner and more readable code, and so are more commonly used.

Greg McKaskle 15-12-2010 10:09

Re: Mecanum - use of gyro
 
Since the PID VI is a subVI, it is intended to be placed after the sensor and before the actuator. Placing this into a user's loop, timed loop, or callback lets the user control the timing and priority. If these are placed into a timed loop set at a higher priority, the PID and other VIs will inherit the higher priority.

If this were flipped and the PID were an object that owned the loop, you could do this by registering the sensor, actuator, timing, priority, and other elements with it. I believe this is how it was done with Java and C++.

I'm assuming this was useful because the PID may need to spin up a new thread and this handles it for the user. Meanwhile in LV, it is easy to draw a parallel loop if that is what you want.

Different strokes.
Greg McKaskle

Ether 19-12-2010 23:14

Re: Mecanum - use of gyro
 
bump.

@mwsmith78: haven't heard from you in almost 2 weeks. could you give us an update on where you're at with this? did you resolve it successfully, or did you move on to other issues?



keericks 10-01-2011 15:10

Re: Mecanum - use of gyro
 
Quote:

Originally Posted by mwsmith78 (Post 984083)
Lots of posts since my last one ... I will try to knock off all the questions.

Using 6" Mecanum wheels with tapered rollers (from AndyMark). Wheels are correctly mounted. The robot drives correctly w/o PID loop - although it does tend to have rotation error. Given that it works well before attempting closed-loop control, I believe that points to the software.

If I understand correctly about the PID post - the I & D gain values are time constants and for tuning purposes should start HIGH and work down. Meanwhile, the proportion gain should start low and work up. That may explain why we were having trouble tuning. When we inserted I and/or D values, we started very small. If we want it to function as a P-only loop, is setting I and D to zero correct?


http://www.youtube.com/watch?v=KL7iZXCRtPw

In the video above, I notice the person pushing the robot and it responds to return back to a specific pointing direction. Is this based on vision camera, gyro, wheel encoders? Thanks!


All times are GMT -5. The time now is 01:37.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi