Go to Post Dedicated students inspire parents and mentors, dedicated mentors inspire students. - Akash Rastogi [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 15-08-2012, 10:33
bradleybaldwin bradleybaldwin is offline
Registered User
FRC #3242
 
Join Date: Jan 2011
Location: Florida
Posts: 5
bradleybaldwin is an unknown quantity at this point
Encoder with CAN for Drive Train

Hello,
During the offseason our team is trying to use mechanum wheels so we can move side to side. When we first put the wheels on the robot it moved diagonally instead of side to side. We attempted to fix this by switching from PWM to CAN and by adding encoders to each wheel. We then attempted to tune each pid controller with minimal success. Is this the best way to go about solving this problem and if it is then what is the optimal way to tune the PID controllers.
Reply With Quote
  #2   Spotlight this post!  
Unread 15-08-2012, 10:36
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,065
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Encoder with CAN for Drive Train

Quote:
Originally Posted by bradleybaldwin View Post
Hello,
During the offseason our team is trying to use mechanum wheels so we can move side to side. When we first put the wheels on the robot it moved diagonally instead of side to side. We attempted to fix this by switching from PWM to CAN and by adding encoders to each wheel. We then attempted to tune each pid controller with minimal success. Is this the best way to go about solving this problem and if it is then what is the optimal way to tune the PID controllers.
1) Can you post a picture of how you have the mecanum wheels mounted so we can look at it? This is among the most common mistakes made by teams using mecanums for the first time.

2) Are you using LabVIEW's built-in mecanum robot-drive VI, or did you use a home-brew mecanum algorithm?

3) Put the robot up on blocks and give it a sideways command. Carefully observe each wheel and note which direction it is spinning, and post your results here.



Last edited by Ether : 15-08-2012 at 10:40.
Reply With Quote
  #3   Spotlight this post!  
Unread 15-08-2012, 10:43
bradleybaldwin bradleybaldwin is offline
Registered User
FRC #3242
 
Join Date: Jan 2011
Location: Florida
Posts: 5
bradleybaldwin is an unknown quantity at this point
Re: Encoder with CAN for Drive Train

Hopefully this is enough, if not I will be able to take pics Thursday. We are using Labviews Holonomic Drive, is there another config for mecanum wheels in Begin?
Attached Thumbnails
Click image for larger version

Name:	2012-robot1.jpg
Views:	57
Size:	137.4 KB
ID:	12931  
Reply With Quote
  #4   Spotlight this post!  
Unread 15-08-2012, 10:46
Clinton Bolinger's Avatar
Clinton Bolinger Clinton Bolinger is offline
FF - PureMichigan
FRC #2337 (EngiNERDs)
Team Role: Coach
 
Join Date: Dec 2006
Rookie Year: 2001
Location: Grand Blanc, MI
Posts: 475
Clinton Bolinger has a reputation beyond reputeClinton Bolinger has a reputation beyond reputeClinton Bolinger has a reputation beyond reputeClinton Bolinger has a reputation beyond reputeClinton Bolinger has a reputation beyond reputeClinton Bolinger has a reputation beyond reputeClinton Bolinger has a reputation beyond reputeClinton Bolinger has a reputation beyond reputeClinton Bolinger has a reputation beyond reputeClinton Bolinger has a reputation beyond reputeClinton Bolinger has a reputation beyond repute
Re: Encoder with CAN for Drive Train

Wheels look correct (Can't see the 4th wheel).

Refer to this with strafing left and right:

http://www.vexrobotics.com/catalog/p...5/image/26308/

-Clinton-
__________________
Reply With Quote
  #5   Spotlight this post!  
Unread 15-08-2012, 11:07
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,065
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Encoder with CAN for Drive Train

Quote:
Originally Posted by Ether View Post
3) Put the robot up on blocks and give it a sideways command. Carefully observe each wheel and note which direction it is spinning, and post your results here.
Attached pic shows how each of the four wheels should be turning for a strafe right (slide right) command.

Picture is TOP view of robot.

Arrow inside each wheel shows direction wheel should be spinning, e.g., Front Left wheel should be spinning "forward".


Attached Thumbnails
Click image for larger version

Name:	strafe.jpg
Views:	38
Size:	49.7 KB
ID:	12932  
Reply With Quote
  #6   Spotlight this post!  
Unread 15-08-2012, 17:07
Levansic's Avatar
Levansic Levansic is offline
Registered User
AKA: Len Evansic
FRC #0585 (Cyber Penguins)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2008
Location: Tehachapi, CA
Posts: 185
Levansic has much to be proud ofLevansic has much to be proud ofLevansic has much to be proud ofLevansic has much to be proud ofLevansic has much to be proud ofLevansic has much to be proud ofLevansic has much to be proud ofLevansic has much to be proud ofLevansic has much to be proud ofLevansic has much to be proud of
Re: Encoder with CAN for Drive Train

Do you have a gyro setup and connected to the holonomic drive?

The default for the cartesian holonomic drive is a field-centric control, meaning a forward command would move the robot away from the driver, no matter which way the robot actually faced. It sounds like you may have a drifted gyro accumulator, which makes the vi interpret your side to side commands as a diagonal movement, relative to the local coordinates of the robot.

Our robot could rotate much faster than our gyro could handle. This would "upset" the gyro accumulator, and cause the robot to move in un-intended directions. The gyro vi may need to be sent a reset signal.

On the drive wheel encoders for mechanum wheels and CAN Jaguars, good luck. We attempted to do that this year, but the onboard PID in the Jaguars was just too fragile. Maybe that's not the correct word, but is probably the most euphemistic I can muster today. Probably the best example we hit this year to illustrate the difference between theory and practice. In our case, no matter how much we practiced, we could not make it match the perfect theory. In the end, we just used %VBus, and attempted to scale our inputs so that we wouldn't approach the rotation speeds that upset our gyro.

-- Len

Last edited by Levansic : 15-08-2012 at 17:19.
Reply With Quote
  #7   Spotlight this post!  
Unread 15-08-2012, 18:52
bradleybaldwin bradleybaldwin is offline
Registered User
FRC #3242
 
Join Date: Jan 2011
Location: Florida
Posts: 5
bradleybaldwin is an unknown quantity at this point
Re: Encoder with CAN for Drive Train

No gyro, could this be part of the reason for the diagonal drift?
Reply With Quote
  #8   Spotlight this post!  
Unread 15-08-2012, 19:03
Levansic's Avatar
Levansic Levansic is offline
Registered User
AKA: Len Evansic
FRC #0585 (Cyber Penguins)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2008
Location: Tehachapi, CA
Posts: 185
Levansic has much to be proud ofLevansic has much to be proud ofLevansic has much to be proud ofLevansic has much to be proud ofLevansic has much to be proud ofLevansic has much to be proud ofLevansic has much to be proud ofLevansic has much to be proud ofLevansic has much to be proud ofLevansic has much to be proud of
Re: Encoder with CAN for Drive Train

It could be. I don't recall what the default value is, if the gyro input is not connected. Are you connecting a rotational control input, like a joystick twist or throttle axis?

At a minimum, I would have three joystick axes connected (X, Y, Z-rotate), and a gyro read. You can wire a joystick button to a case that encloses a gyro-reset vi, so that you can reset the accumulator at any time.

-- Len
Reply With Quote
  #9   Spotlight this post!  
Unread 15-08-2012, 19:04
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,065
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Encoder with CAN for Drive Train

Quote:
Originally Posted by bradleybaldwin View Post
No gyro, could this be part of the reason for the diagonal drift?
Do you have access to the robot?


Reply With Quote
  #10   Spotlight this post!  
Unread 15-08-2012, 20:42
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,751
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Encoder with CAN for Drive Train

There doesn't really seem to be enough symptom to diagnose the issues. I'll just list a few things.

1. Make sure that the VI being used is Mecanum Cartesian. The Polar version is not intended for direct joystick inputs, but rather mathematically based autonomous.
2. Check the wheel orientations. The two shown clearly in the photo are correct. The other two should be the mirror image left-to-right of what is shown.
3. On blocks, check other joystick inputs and summarize the results. Observe what pure Y, pure -Y, pure X, pure -X, look like. also use the twist or rotation parameter with no X and Y.

Perhaps a bigger set of correct and incorrect results will help identify the issue.

Also, I don't believe a gyro or lack of gyro is the issue, as the VI I was looking at has no knowledge of a gyro. Perhaps there is an example that incorporates a gyro, but the default expectation seems to be a robot-centric holonomic drive system.

Greg McKaskle
Reply With Quote
  #11   Spotlight this post!  
Unread 15-08-2012, 21:38
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,065
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Encoder with CAN for Drive Train

Quote:
Originally Posted by Greg McKaskle View Post
The two shown clearly in the photo are correct.
If you look closely, the third wheel is also correct.

Putting the bot up on blocks was suggested in post2. I get the impression the OP doesn't have access to the robot until tomorrow.



Last edited by Ether : 15-08-2012 at 21:43.
Reply With Quote
  #12   Spotlight this post!  
Unread 16-08-2012, 01:26
Levansic's Avatar
Levansic Levansic is offline
Registered User
AKA: Len Evansic
FRC #0585 (Cyber Penguins)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2008
Location: Tehachapi, CA
Posts: 185
Levansic has much to be proud ofLevansic has much to be proud ofLevansic has much to be proud ofLevansic has much to be proud ofLevansic has much to be proud ofLevansic has much to be proud ofLevansic has much to be proud ofLevansic has much to be proud ofLevansic has much to be proud ofLevansic has much to be proud of
Re: Encoder with CAN for Drive Train

Quote:
Originally Posted by Greg McKaskle View Post
Also, I don't believe a gyro or lack of gyro is the issue, as the VI I was looking at has no knowledge of a gyro. Perhaps there is an example that incorporates a gyro, but the default expectation seems to be a robot-centric holonomic drive system.
I agree with all of your suggestions, but our cartesian holonomic vi had a gyro input by default. I don't doubt that there may be instances of that vi that don't have that input, but ours had a gyro terminal. I just really wish I had a few screen shots of how our code was set up.

If Bradley's vi has that terminal, he could just wire a zero constant to it, and that should force robot-centric control.

-- Len
Reply With Quote
  #13   Spotlight this post!  
Unread 16-08-2012, 07:15
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,751
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Encoder with CAN for Drive Train

I looked again and found the gyro angle input. I was looking for a gyro refnum during the Open.

The gyro input has a default of 0 if not wired, so not wiring it shouldn't be a problem. Wiring in a changing value would cause a changing orientation, even when you were sending in 0,0,0. So that is another good vector to test on the robot.

Greg McKaskle
Reply With Quote
  #14   Spotlight this post!  
Unread 16-08-2012, 13:12
bradleybaldwin bradleybaldwin is offline
Registered User
FRC #3242
 
Join Date: Jan 2011
Location: Florida
Posts: 5
bradleybaldwin is an unknown quantity at this point
Re: Encoder with CAN for Drive Train

Sorry but I won't be able to access the robot now until Friday. I will make sure to check the following though.
1. Robot Wheel orientation.
2. Wheel direction when moving sideways.
3. Wheel speed?
4. The holonomic drive code.
Reply With Quote
  #15   Spotlight this post!  
Unread 18-08-2012, 10:05
bradleybaldwin bradleybaldwin is offline
Registered User
FRC #3242
 
Join Date: Jan 2011
Location: Florida
Posts: 5
bradleybaldwin is an unknown quantity at this point
Re: Encoder with CAN for Drive Train

Okay so all the wheels were in the correct orientation and they were spinning in the correct direction. The problem though was that the back two wheels were spinning slower than the front two wheels. According to the build team this is because of a gear ratio problem. If they cannot fix it what are my other alternatives?
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 10:54.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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