Go to Post I don't just participate in FIRST, and it’s not part of my life. FIRST is my life. - sciguy125 [more]
Home
Go Back   Chief Delphi > Technical > Electrical
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 20-01-2017, 16:46
Aslihanokur Aslihanokur is offline
Registered User
FRC #2905
 
Join Date: Jan 2017
Location: Turkey
Posts: 2
Aslihanokur is an unknown quantity at this point
swerve drive

Hi teams,
This year we want to use swerve drive thus we tried it but there is a problem: We used the codes from team 1640. On the 1640's programme, cables are wired from encoder to analog. We cannot wire the cables to analog because cables have 8 outputs but the roborio has 4 inputs in the analog part. Therefore we searched it on the internet and found that we should wire the cables which come from encoder to roborio's dio part. We did it in this way but the code didn't work. In the programme that we used, the wheels don't move synchronously.
We cannot determine the source of the issue. Is it because of electronics or programme? What should we done? Can you help us please? Thank you
Reply With Quote
  #2   Spotlight this post!  
Unread 20-01-2017, 17:23
GeeTwo's Avatar
GeeTwo GeeTwo is offline
Technical Director
AKA: Gus Michel II
FRC #3946 (Tiger Robotics)
Team Role: Mentor
 
Join Date: Jan 2014
Rookie Year: 2013
Location: Slidell, LA
Posts: 3,762
GeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond repute
Re: swerve drive

I'm not familiar with 1640's code, but if it is written for analog inputs and you're wiring it to DIOs, you will need to (at a minimum) modify the code so that the tracking info comes from that source; I would also expect that some sort of rescaling would be required.

Also, I don't really know how to say this, so I'll just rip the bandage off. If no one on your team understands the control system well enough to have already realized what I wrote above, you're a long way from getting swerve working right; you really ought to reconsider putting this on the shelf until after STEAMworks is done and do a different drive chassis this year.
__________________

If you can't find time to do it right, how are you going to find time to do it over?
If you don't pass it on, it never happened.
Robots are great, but inspiration is the reason we're here.
Friends don't let friends use master links.
Reply With Quote
  #3   Spotlight this post!  
Unread 20-01-2017, 17:32
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,128
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: swerve drive

Quote:
Originally Posted by Aslihanokur View Post
We cannot determine the source of the issue. Is it because of electronics or programme? What should we done? Can you help us please?
Apply a forward, strafe right, and rotate clockwise command and look at what speed and steering angle your code is sending to each wheel.

Look at those 4 pairs of speed/angle (one for each wheel) to see if the computation is being done correctly in your code.

And then take GeeTwo's advice in the previous post.



Reply With Quote
  #4   Spotlight this post!  
Unread 20-01-2017, 17:59
rich2202 rich2202 is offline
Registered User
FRC #2202 (BEAST Robotics)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Wisconsin
Posts: 1,279
rich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond reputerich2202 has a reputation beyond repute
Re: swerve drive

I'm guessing there are 2 encoders per module, thus the 8 outputs (4 per encoder).

While the RoboRio has 4 labeled Analog Input ports, the MXP Port provides 4 more Analog Input ports.

If you use something like the NavX board, it will translate the i/o ports available on the MXP to traditional plug compatible connections.
__________________


Last edited by rich2202 : 20-01-2017 at 18:02.
Reply With Quote
  #5   Spotlight this post!  
Unread 20-01-2017, 19:36
page2067's Avatar
page2067 page2067 is offline
Registered User
AKA: rick page
FRC #2067 (Apple Pi)
Team Role: Mentor
 
Join Date: Oct 2008
Rookie Year: 2008
Location: Guilford CT
Posts: 111
page2067 has a spectacular aura aboutpage2067 has a spectacular aura aboutpage2067 has a spectacular aura about
Re: swerve drive

Quote:
Originally Posted by Aslihanokur View Post
Hi teams,
This year we want to use swerve drive thus we tried it but there is a problem: We used the codes from team 1640. On the 1640's programme, cables are wired from encoder to analog. We cannot wire the cables to analog because cables have 8 outputs but the roborio has 4 inputs in the analog part. Therefore we searched it on the internet and found that we should wire the cables which come from encoder to roborio's dio part. We did it in this way but the code didn't work. In the programme that we used, the wheels don't move synchronously.
We cannot determine the source of the issue. Is it because of electronics or programme? What should we done? Can you help us please? Thank you

It sounds like your encoders are Quadrature encoders - given that they have 2 outputs per. Quadrature encoders do wire to 2 DIO's each, however You want to have Analog or Absolute encoders for most swerve codes, I am pretty sure including Sabotage's code - this is also what we have
used in past. If not familiar - search on the many threads on CD on this.
Typically also with absolute encoders on a swerve the encoder is reading 1:1 the steering output - depending on your set up you may need an auxiliary gear, agin there are several CD posts that cover this that you can search on.

It is possible to use quadrature, (relative) encoders that you have - but I do not recommend. It involves different code of course to read and use the quadrature readings, and other considerations (initialization) and is not favored by most teams (at least by my informal observation) that run swerve. Though I believe 973's old off-season swerve may have used relative encoder.

Good Luck!
Reply With Quote
  #6   Spotlight this post!  
Unread 22-01-2017, 00:02
laura1640 laura1640 is offline
Registered User
FRC #1640
 
Join Date: Dec 2014
Location: Downingtown
Posts: 7
laura1640 is a jewel in the roughlaura1640 is a jewel in the roughlaura1640 is a jewel in the rough
Re: swerve drive

Hello,

On our swerve modules, we use two different sensors. One is to determine the angle that the wheel is pointed to. Like others have said, this is an absolute analog sensor. This is helpful because regardless of what angle the swerve modules are facing when the robot is powered on, they will still read the correct angle. Each of these sensors gets plugged into one of the 4 analog IO ports on the roborio.

The second encoder is used to determine the distance that the pivot has moved, similar to other drivetrains. This is mostly useful in autonomous, where the distance the robot travels needs to be exact. These sensors can be plugged into the digital IO ports on the roborio.

Also, may I ask what version of our code you are looking at (as in what year)?

~Laura
Reply With Quote
  #7   Spotlight this post!  
Unread 22-01-2017, 12:57
Aslihanokur Aslihanokur is offline
Registered User
FRC #2905
 
Join Date: Jan 2017
Location: Turkey
Posts: 2
Aslihanokur is an unknown quantity at this point
Re: swerve drive

Quote:
Originally Posted by laura1640 View Post
Hello,

On our swerve modules, we use two different sensors. One is to determine the angle that the wheel is pointed to. Like others have said, this is an absolute analog sensor. This is helpful because regardless of what angle the swerve modules are facing when the robot is powered on, they will still read the correct angle. Each of these sensors gets plugged into one of the 4 analog IO ports on the roborio.

The second encoder is used to determine the distance that the pivot has moved, similar to other drivetrains. This is mostly useful in autonomous, where the distance the robot travels needs to be exact. These sensors can be plugged into the digital IO ports on the roborio.

Also, may I ask what version of our code you are looking at (as in what year)?

~Laura
We used the codes that you wrote at 2012-Rebound Rumble. I wonder if we can set the swerve drive without absolute encoders. We reshaped our codes and made some replacement on our electronics. Actually it worked.However, ıt got the point that start at the begining as zero so that we need to make all 4 wheels at the same position before we send codes the robot. Are there any solution except using an absolute encoder?
Reply With Quote
  #8   Spotlight this post!  
Unread 23-01-2017, 11:10
laura1640 laura1640 is offline
Registered User
FRC #1640
 
Join Date: Dec 2014
Location: Downingtown
Posts: 7
laura1640 is a jewel in the roughlaura1640 is a jewel in the roughlaura1640 is a jewel in the rough
Re: swerve drive

If you wish, you can get some more recent code from https://github.com/frc1640. The past few repositories also have Java code for swerve if you are interested.

Using an absolute encoder will save a lot of trouble. You could try saving the value of the encoders to a file and use the last values to initialize the position the next time you power the robot on. However, if someone moves the pivots while the robot is off, it will cause problems. I would advise looking into adding an absolute encoder to your swerve for convenience.

~Laura
Reply With Quote
  #9   Spotlight this post!  
Unread 23-01-2017, 12:51
asid61's Avatar
asid61 asid61 is offline
Registered User
AKA: Anand Rajamani
FRC #1072 (Harker Robotics)
Team Role: Mentor
 
Join Date: Jan 2014
Rookie Year: 2013
Location: Cupertino, CA
Posts: 2,233
asid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond repute
Re: swerve drive

Quote:
Originally Posted by Aslihanokur View Post
We used the codes that you wrote at 2012-Rebound Rumble. I wonder if we can set the swerve drive without absolute encoders. We reshaped our codes and made some replacement on our electronics. Actually it worked.However, ıt got the point that start at the begining as zero so that we need to make all 4 wheels at the same position before we send codes the robot. Are there any solution except using an absolute encoder?
Some teams use a magnet and a hall effect sensor to set the "zero" position for the module. Or, you could use a jig of some kind to align all the wheels at the start of the match.
__________________
<Now accepting CAD requests and commissions>

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 00:28.

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