Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Technical Discussion (http://www.chiefdelphi.com/forums/forumdisplay.php?f=22)
-   -   Best Sensor for Unlimited Rotation Swerve (http://www.chiefdelphi.com/forums/showthread.php?t=137230)

Joe Johnson 13-05-2015 14:34

Best Sensor for Unlimited Rotation Swerve
 
Sidebar:
Quote:

Before I get started, I initially titled this post "Best Sensor for Unicorn Swerve" because I THOUGHT that the term "Unicorn Swerve" was a reference to what I thought of as the "unicorn horn" i.e. shaft that drives the wheels (via a bevel gear), that is typically used on Unlimited Rotation Swerve Modules. But a little googling made me think that folks are using "unicorn swerve" to refer to 4 wheel swerve with 4 wheel independent steering (perhaps a reference to the rarity of such a beast when the term was coined?).

I like my interpretation better but since the purpose of language is communication, I suppose I had better defer to the views of others on this subject.
Preamble:
Quote:

I know it will come as a shock to folks but I have fallen in love with Swerve all over again. I first used Swerve in 1998 (Ladder Logic) and I loved it then but after a number of years using it, I came to the conclusion that it was SUCH A RESOURCE HOG (no matter how you measured it: space, current, motors, weight, engineering effort, programming effort, karma,...), that I couldn't justify it any more. BUT... ...last year's experience using Wild Swerves from Team221.com together with the navX from Kauai Labs has me rethinking this. Our Coding Team really outdid themselves; Scorpion was one of the best behaved and easiest to drive robots I've been associated with. I am not sure I'm ever going back to non-swerve drives.

BUT... ...of course there are improvements. We want it to take up less space, weigh less, be more robust, use less power, easier to maintain, shoot freakin' lasers out its axles, ;-)

We've decided to look into using a swerve with a bevel gear drive system so that we can remote the drive motors (and perhaps add a shifter or multiple motors per wheel if the spirit moves us) and also because we think that in a game with Defense (a.k.a. the 2016 FRC game -- bet on it) we will certainly want to allow the steering axis to have unlimited rotation angle.

Which finally lets me get to my actual message.

In an unlimited rotation angle world, the natural thing to do is to put a quadrature encoder (like a US Robotics or a Grayhill or some such) in the swerve drive system somewhere and pretty much call it good.

But... ...I hate that idea. The main reason is that then you have to zero the count when the robot wakes up (or goes brain dead*). Yes, you can get around this with training and check lists and such but it is a long season, this decision is going to bite you in the tukhus before its over.

Here is what I would like.
  • Something that can deal with unlimited rotation (obviously)
  • Something that is 1:1 with the actual steering angle and does not require the controller to be zeroed (other than a constant programmed into the robot once and only changed if there is work on the robot -- if ever).
  • Something that has a resolution of under 1 degree -- preferably 1/10th a degree or better.
  • Something with as little noise as possible (To get reasonable responses, we use a lot of D Gain in our PID Loop. Noise is really tough for Deriviative Feedback loops to deal with.)
  • Something with at Digital Output if possible -- for two reasons. First, we had a heck of a time with noise on the 5V supply and on the GND from the RoboRIO, so it was hard to get a noise free signal out of a lot of our sensors (like pots for example). Second we ran out of analog inputs on the RoboRIO and had to add a coprocessor just to manage the extra analog signals. Not ideal. If we can put the steering position I2C or SPI, that may make our lives better -- though perhaps not because we are thinking of using the Talon SRX to do our PID loop, I don't think the Talon SRX likes getting its sensor input via anything other than Quadrature or Analog. So, I don't really know what I want in this department.

Anyway, I would like learn from folk with unlimited rotation swerve experience. What sensor scheme did you use and what are the pros (and cons) of those choices?

Do tell.

Dr. Joe J.


*don't get me started about FIRST's decision to allow the NI folks to allow the RoboRIO loose its mind at just under 7V -- this is something close to criminal. Really... this was a really dumb design direction given the customer base and the intended use of the RoboRIO.

jman4747 13-05-2015 14:49

Re: Best Sensor for Unlimited Rotation Swerve
 
I haven't built a swerve but your requirements for the sensor scream absolute rotary encoder to me. So for instance: <http://www.cui.com/catalog/components/encoders/absolute>

Buy at Digikey for $48.65 each
http://www.digikey.com/product-detai...050-ND/2278846

Edit: Also if the encoder is 1:1 with respect to rotation you could attach a standard rotary encoder and use the index to give you a home position. Turn each wheel left until you see the index then figure out that angle relative to forward for each wheel and reset the current angel of the wheel to that known value.

cjl2625 13-05-2015 14:51

Re: Best Sensor for Unlimited Rotation Swerve
 
On our swerve, we use absolute encoders. They use analog instead of digital output, though.
We've used them on our swerve for the past two years, and have been very reliable. They only require one offset constant, and then don't need to be calibrated again. Rotates infinitely and wraps around from 360-0.

I don't know what the model of the encoder is specifically, but maybe I can find that out.

ratdude747 13-05-2015 14:56

Re: Best Sensor for Unlimited Rotation Swerve
 
US Digital makes some analog absolute magnetic encoders that work great for unicorn drive (2783 used them for their implementation). Forgot the model though.

R.C. 13-05-2015 14:57

Re: Best Sensor for Unlimited Rotation Swerve
 
Quote:

Originally Posted by ratdude747 (Post 1481903)
US Digital makes some analog absolute magnetic encoders that work great for unicorn drive (2783 used them for their implementation). Forgot the model though.

I'm assuming this is the ma3?

wt200999 13-05-2015 14:59

Re: Best Sensor for Unlimited Rotation Swerve
 
We've had good and bad experience with the AS5145B contact-less magnetic sensor (also available here) used as absolute encoders. They work well if you can guarantee the distance from the sensor to the shaft does not change, and you can embed the magnet to the end of the shaft.

GeeTwo 13-05-2015 15:03

Re: Best Sensor for Unlimited Rotation Swerve
 
You should certainly include Hall-effect rotary sensors in your investigation. They offer continuous rotation and do not drift, except at the mechanical end.

Bryce2471 13-05-2015 15:10

Re: Best Sensor for Unlimited Rotation Swerve
 
Here is a link to the sensor that we have been using on our swerves. It meets all of you requests (and probably some you haven't encountered yet) except that it has an analog output, and you can get it for ~$10 if you shop around a little.

marshall 13-05-2015 15:14

Re: Best Sensor for Unlimited Rotation Swerve
 
Quote:

Originally Posted by Bryce2471 (Post 1481908)
Here is a link to the sensor that we have been using on our swerves. It meets all of you requests (and probably some you haven't encountered yet) except that it has an analog output, and you can get it for ~$10 if you shop around a little.

Have you interfaced these to the Talon SRX controllers at all?

Andrew Schreiber 13-05-2015 15:18

Re: Best Sensor for Unlimited Rotation Swerve
 
Quote:

Originally Posted by Joe Johnson (Post 1481899)
Sidebar:


Preamble:



In an unlimited rotation angle world, the natural thing to do is to put a quadrature encoder (like a US Robotics or a Grayhill or some such) in the swerve drive system somewhere and pretty much call it good.

But... ...I hate that idea. The main reason is that then you have to zero the count when the robot wakes up (or goes brain dead*). Yes, you can get around this with training and check lists and such but it is a long season, this decision is going to bite you in the tukhus before its over.

Here is what I would like.
  • Something that can deal with unlimited rotation (obviously)
  • Something that is 1:1 with the actual steering angle and does not require the controller to be zeroed (other than a constant programmed into the robot once and only changed if there is work on the robot -- if ever).
  • Something that has a resolution of under 1 degree -- preferably 1/10th a degree or better.
  • Something with as little noise as possible (To get reasonable responses, we use a lot of D Gain in our PID Loop. Noise is really tough for Deriviative Feedback loops to deal with.)
  • Something with at Digital Output if possible -- for two reasons. First, we had a heck of a time with noise on the 5V supply and on the GND from the RoboRIO, so it was hard to get a noise free signal out of a lot of our sensors (like pots for example). Second we ran out of analog inputs on the RoboRIO and had to add a coprocessor just to manage the extra analog signals. Not ideal. If we can put the steering position I2C or SPI, that may make our lives better -- though perhaps not because we are thinking of using the Talon SRX to do our PID loop, I don't think the Talon SRX likes getting its sensor input via anything other than Quadrature or Analog. So, I don't really know what I want in this department.

Anyway, I would like learn from folk with unlimited rotation swerve experience. What sensor scheme did you use and what are the pros (and cons) of those choices?

Do tell.

Dr. Joe J.


*don't get me started about FIRST's decision to allow the NI folks to allow the RoboRIO loose its mind at just under 7V -- this is something close to criminal. Really... this was a really dumb design direction given the customer base and the intended use of the RoboRIO.

You could also use an indexing sensor such as a hall effect. The Encoder in WPILib supports indexing out of the box as does the Talon via CAN-Position Control.

My money is on the sensor Bryce listed because I'm cheap. And also lazy and don't like wiring extra sensors.

Paul Boehringer 13-05-2015 15:19

Re: Best Sensor for Unlimited Rotation Swerve
 
We used indexed encoders this year. In my opinion an encoder such as the AM103 (made by cui) where the shaft goes through the encoder are much easier to deal with because you can mount them right to the gearbox plate. However each team has their own machining advantages and disadvantages.

Overall I would say its an extremely high priority to either use indexed encoders or continuous potentiometers on a swerve steering system. Though there are totally ways around it, I feel like doing it this way makes it much easier.

MaGiC_PiKaChU 13-05-2015 15:20

Re: Best Sensor for Unlimited Rotation Swerve
 
Quote:

Originally Posted by marshall (Post 1481911)
Have you interfaced these to the Talon SRX controllers at all?

my team interfaced our swerve with the SRX, using these absolute encoders... http://www.andymark.com/product-p/am-2899.htm

works like a charm

zsnow 13-05-2015 15:24

Re: Best Sensor for Unlimited Rotation Swerve
 
+1 On the magnetic absolute analog encoders from US Digital. We calibrate them and store an offset to zero, keeping it stateless.

Ether 13-05-2015 15:54

Re: Best Sensor for Unlimited Rotation Swerve
 
Quote:

Originally Posted by Joe Johnson (Post 1481899)
folks are using "unicorn swerve" to refer to 4 wheel swerve with 4 wheel independent steering (perhaps a reference to the rarity of such a beast when the term was coined?).

4-wheel independent-steering and independent-driven drivetrain, with unlimited steering rotation of the wheels and sensors, and no gaps in the sensor feedback

http://www.chiefdelphi.com/forums/sh...07&postcount=9

http://www.chiefdelphi.com/forums/sh...4&postcount=13



Knufire 13-05-2015 16:19

Re: Best Sensor for Unlimited Rotation Swerve
 
I have not used the US Digital MA3 in a swerve module, but I have used it in numerous other applications and it has always worked flawlessly.

ratdude747 13-05-2015 18:02

Re: Best Sensor for Unlimited Rotation Swerve
 
Quote:

Originally Posted by R.C. (Post 1481904)
I'm assuming this is the ma3?

Yup. I thought that was the model but it's been nearly five years since I worked with them and I didn't want to provide false information.

---

One issue that was encountered was sensor alignment... it should be a no-brainer but one ought to make sure all the sensors are aligned the same (same 0/360 position)... on can calibrate in code and account for the 0/360 transition, sure, but it is a pain and can slow the processing down if not written well.

What makes this issue common is that the input shafts of the encoders, back then at least, had no reference mark and being continuous, there is no stop to reference to. In retrospect, the fix for this is to use a DMM to find the 0/360 point, and make a mark with a scribe on the end of the shaft and on the encoder body (or reference the first mark to a known spot on the body).

RyanShoff 13-05-2015 18:15

Re: Best Sensor for Unlimited Rotation Swerve
 
Quote:

Originally Posted by Bryce2471 (Post 1481908)
Here is a link to the sensor that we have been using on our swerves. It meets all of you requests (and probably some you haven't encountered yet) except that it has an analog output, and you can get it for ~$10 if you shop around a little.

We use these too. I haven't seen anything close to the price.

We tend to get a twitch, when trying to hold a wheel at a position that crosses from 5v - 0v. It probably could be calibrated out. We just don't set any wheels in either drive or strafe position to this position.

I would not recommend trying anything other than absolute feedback geared one to one with the wheel.

Bryce2471 13-05-2015 19:25

Re: Best Sensor for Unlimited Rotation Swerve
 
Quote:

Originally Posted by RyanShoff (Post 1481946)
We use these too. I haven't seen anything close to the price.

We tend to get a twitch, when trying to hold a wheel at a position that crosses from 5v - 0v. It probably could be calibrated out. We just don't set any wheels in either drive or strafe position to this position.

I would not recommend trying anything other than absolute feedback geared one to one with the wheel.

If you read the technical documents, you will find that the voltage output is not 0v to 5v. Depending on the model, I think it's roughly 0.1v to 4.9v. It's very simple to fix.

AdamHeard 13-05-2015 19:30

Re: Best Sensor for Unlimited Rotation Swerve
 
Quote:

Originally Posted by RyanShoff (Post 1481946)
We use these too. I haven't seen anything close to the price.

We tend to get a twitch, when trying to hold a wheel at a position that crosses from 5v - 0v. It probably could be calibrated out. We just don't set any wheels in either drive or strafe position to this position.

I would not recommend trying anything other than absolute feedback geared one to one with the wheel.

Why?

Joe Johnson 13-05-2015 20:22

Re: Best Sensor for Unlimited Rotation Swerve
 
Quote:

Originally Posted by Ether (Post 1481922)
4-wheel independent-steering and independent-driven drivetrain, with unlimited steering rotation of the wheels and sensors, and no gaps in the sensor feedback

http://www.chiefdelphi.com/forums/sh...07&postcount=9

http://www.chiefdelphi.com/forums/sh...4&postcount=13



I second your thought expressed in the second link above:
So says JVN. So say we all.
Now a question for you Ether, two actually.

1) "No gaps in feedback sensor feedback" Strange wording. First of all, it is inconceivable to have swerve without feedback loops controlling the steering angle. Open Loop steering control is just not Swerve in my view. So... if I have infinite steering angles, then (for me at least) that implies sensors sufficient to provide the control loops information it needs to do its job.

Are there people in the world who would design a sensor system that would have gaps? You don't say anything about wheels that have continuous outer surfaces -- why the special attention to sensor gaps?

2) Can I get you to agree to a new definition that replaces 4 with N (N=number of drive wheels on the robot and must be >2)? If a team has 6 drive wheels then all of them have to have independent steering and infinitely turnable. Same with 3, 5, or 57.

I am torn about 2. If they had caster or omniwheels that were not powered but the 2 that were powered were independently steered and so on... Is that "Unicorn Swerve"? I say nay. "Unipony Swerve" is the best I am going to give them.

Ether, what say you?

Dr. Joe J.

Mike Bortfeldt 13-05-2015 20:43

Re: Best Sensor for Unlimited Rotation Swerve
 
Joe,

I think the "No gaps in sensor feedback" relates to the use of some potentiometers (and other sensors) like this one. While they are continuous rotation, electrically they have a gap in the signal for about 20 degrees of rotation.

Mike

Joe Johnson 13-05-2015 21:19

Re: Best Sensor for Unlimited Rotation Swerve
 
Quote:

Originally Posted by Mike Bortfeldt (Post 1481967)
Joe,

I think the "No gaps in sensor feedback" relates to the use of some potentiometers (and other sensors) like this one. While they are continuous rotation, electrically they have a gap in the signal for about 20 degrees of rotation.

Mike

Bleck! I threw a a little as I thought of someone going to all the trouble of making a swerve with infinite rotation and then using a sensor with a 20 degree no signal zone.

How's that going to end well?

Dr. Joe J.

Ether 13-05-2015 21:39

Re: Best Sensor for Unlimited Rotation Swerve
 
Quote:

Originally Posted by Joe Johnson (Post 1481964)
Now a question for you Ether, two actually

1) What Mike said. I vaugely remember that there was some discussion back then about swerve designs with continuous-rotation pots with gaps. I wanted to explicitly rule that out.

2) Sure. That seems reasonable.



PAR_WIG1350 14-05-2015 00:48

Re: Best Sensor for Unlimited Rotation Swerve
 
Quote:

Originally Posted by Joe Johnson (Post 1481972)
Bleck! I threw a a little as I thought of someone going to all the trouble of making a swerve with infinite rotation and then using a sensor with a 20 degree no signal zone.

How's that going to end well?

Dr. Joe J.

I have been working on a background project with a sensor that gives a ~7 degree gap, which I considered to be quite bad. 20 degrees is just pure evil!

teku14 15-05-2015 07:59

Re: Best Sensor for Unlimited Rotation Swerve
 
https://pixhawk.org/modules/px4flow

We're experimenting with this in the off-season... please critique on this idea

Andrew Schreiber 15-05-2015 08:34

Re: Best Sensor for Unlimited Rotation Swerve
 
Quote:

Originally Posted by teku14 (Post 1482216)
https://pixhawk.org/modules/px4flow

We're experimenting with this in the off-season... please critique on this idea

I like the idea, I'd be curious how you get around the issues with it's max velocity. It's designed for aerial vehicles so the camera expects to have a long distance to the ground. To get data for 14 fps you'd need to mount it 18 inches from the ground.

4/(1/400)*18*.0254/(.004/.000024)*3.28 = 14.4

RyanShoff 15-05-2015 14:35

Re: Best Sensor for Unlimited Rotation Swerve
 
Quote:

Originally Posted by AdamHeard (Post 1481957)
I would not recommend trying anything other than absolute feedback geared one to one with the wheel.

Why?

Because we've tested robots that violated that, and they caused lots of trouble.

Early in our swerve testing, we didn't store the offset from a known direction. So our absolute feedback was really incremental. Every time you changed batteries, rebooted, pushed code, or suffered a brown out, you had to make sure the wheels where pointed in a specific direction. That gets old really quick. Also different people would set the wheels slightly differently, or worse incorrectly.

We had another test chassis with the feedback geared 2:1 to the direction. On this one, you still had to start the robot with the wheels pointed close to straight. The robot always knew the axis of the wheel, but not which direction it would go. It was a real joy, because we tried to count the 2.5v crossings of an analog 0-5v signal. Sometimes it would miss count and the wheel would start dragging.

I cringed when I saw Andymark release their swerve modules this year with non1:1 gearing on the feedback.

So I always recommend to teams thinking about a swerve drive: Use absolute feedback and gear it 1:1 to steering rotation.

Analog or digital signaling shouldn't really matter much. But the analog sensors quoted above are the cheapest I've seen.

To Bryce2471:
We do scale the analog voltage from the datasheet to 0-5v. It still twitches, but I haven't really tried to fix it. I agree it should be an easy fix, unless maybe the sensor has trouble pulling the signal quick enough.

AdamHeard 15-05-2015 15:10

Re: Best Sensor for Unlimited Rotation Swerve
 
Quote:

Originally Posted by RyanShoff (Post 1482364)
Because we've tested robots that violated that, and they caused lots of trouble.

Early in our swerve testing, we didn't store the offset from a known direction. So our absolute feedback was really incremental. Every time you changed batteries, rebooted, pushed code, or suffered a brown out, you had to make sure the wheels where pointed in a specific direction. That gets old really quick. Also different people would set the wheels slightly differently, or worse incorrectly.

We had another test chassis with the feedback geared 2:1 to the direction. On this one, you still had to start the robot with the wheels pointed close to straight. The robot always knew the axis of the wheel, but not which direction it would go. It was a real joy, because we tried to count the 2.5v crossings of an analog 0-5v signal. Sometimes it would miss count and the wheel would start dragging.

I cringed when I saw Andymark release their swerve modules this year with non1:1 gearing on the feedback.

So I always recommend to teams thinking about a swerve drive: Use absolute feedback and gear it 1:1 to steering rotation.

Analog or digital signaling shouldn't really matter much. But the analog sensors quoted above are the cheapest I've seen.

To Bryce2471:
We do scale the analog voltage from the datasheet to 0-5v. It still twitches, but I haven't really tried to fix it. I agree it should be an easy fix, unless maybe the sensor has trouble pulling the signal quick enough.

We ran an entire season (and seperately an offseason) with swerves that had incremental steering encoders.

We loved it. Not having any hardcoded positions was great. Could replace a module or sensor and not have to touch code.

We zero'd by hand straight and/or used a seperate zeroing sensor when we felt like it.

In the future we'd do it again but use a mechanical hardstop (deployable pin or something) to zero with a hall effect as a backup.

Not having any magic numbers in code is magical.

RyanShoff 15-05-2015 16:10

Re: Best Sensor for Unlimited Rotation Swerve
 
Quote:

Originally Posted by AdamHeard (Post 1482375)
Not having any magic numbers in code is magical.

I agree hard coding calibration values is bad.

We put a button on the smart dashboard called 'zero encoders'. Pushing it stores the steering encoder positions to the roborio using Preferences. That way there is nothing hardcoded, and the same code will work on two different robots. If something mechanically changes on the bot, just set the wheels to straight, press the button, and the new offsets are stored.

AdamHeard 15-05-2015 16:14

Re: Best Sensor for Unlimited Rotation Swerve
 
Quote:

Originally Posted by RyanShoff (Post 1482385)
I agree hard coding calibration values is bad.

We put a button on the smart dashboard called 'zero encoders'. Pushing it stores the steering encoder positions to the roborio using Preferences. That way there is nothing hardcoded, and the same code will work on two different robots. If something mechanically changes on the bot, just set the wheels to straight, press the button, and the new offsets are stored.

That is essentially the same though. It requires the robot to be on and get comm for the sensor position to be saved.

Might not be enough time to do that in elims.

Bryce2471 15-05-2015 17:45

Re: Best Sensor for Unlimited Rotation Swerve
 
Quote:

Originally Posted by RyanShoff (Post 1481946)
I would not recommend trying anything other than absolute feedback geared one to one with the wheel.

This.
Accept that I would also only recommend mechanically zeroing the encoder.

It's not that other methods don't work. It's that I have found this to be effective, cheap, easy, relible, and no maintainance.
I just think it's the best solution, all around.

I love healthy debate though, so it would be great to hear someone's argument for why another solution is better in some way.

RyanShoff 15-05-2015 18:12

Re: Best Sensor for Unlimited Rotation Swerve
 
Quote:

Originally Posted by AdamHeard (Post 1482389)
That is essentially the same though. It requires the robot to be on and get comm for the sensor position to be saved.

Might not be enough time to do that in elims.

It was extremely rare this year for us to need to change the offset.

You can to do it before a match starts as soon as the robot connects to the field. (Now I thinking what happens to a smartdashboard button when pressed before the robot connects? Does the command queue? I don't know.)

teku14 16-05-2015 07:56

Re: Best Sensor for Unlimited Rotation Swerve
 
Quote:

Originally Posted by Andrew Schreiber (Post 1482224)
I like the idea, I'd be curious how you get around the issues with it's max velocity. It's designed for aerial vehicles so the camera expects to have a long distance to the ground. To get data for 14 fps you'd need to mount it 18 inches from the ground.

4/(1/400)*18*.0254/(.004/.000024)*3.28 = 14.4

Correct me if I'm wrong however we expected to mount this approximately 5.5 inches or 0.139 meters above the ground since that is the clearance of the our swerve modules.

- Also we have purchased an additional M12 lens to swap out which is adjustable in focal length from 2.8 to 16 mm

Assuming the minimum of 2.8mm I was thinking that

4/(1/400)*0.139/(0.0028/0.000024) = 1.9 m/s or 6.2 ft/s

Now that may not be the max speed the robot is capable of but we feel that it is an acceptable speed for accurate autonomous navigation which is what we are trying first. So it really doesn't fit into the whole theme of being an all purpose swerve sensor, but the technology used is very intriguing and our key problem with swerve is more of navigating in autonomous.

PS. Hopper Buddies for life :)

Andrew Schreiber 16-05-2015 11:12

Re: Best Sensor for Unlimited Rotation Swerve
 
Quote:

Originally Posted by teku14 (Post 1482490)
Correct me if I'm wrong however we expected to mount this approximately 5.5 inches or 0.139 meters above the ground since that is the clearance of the our swerve modules.

- Also we have purchased an additional M12 lens to swap out which is adjustable in focal length from 2.8 to 16 mm

Assuming the minimum of 2.8mm I was thinking that

4/(1/400)*0.139/(0.0028/0.000024) = 1.9 m/s or 6.2 ft/s

Now that may not be the max speed the robot is capable of but we feel that it is an acceptable speed for accurate autonomous navigation which is what we are trying first. So it really doesn't fit into the whole theme of being an all purpose swerve sensor, but the technology used is very intriguing and our key problem with swerve is more of navigating in autonomous.

PS. Hopper Buddies for life :)

Math checks out, let me know how it works.

Joe Johnson 16-05-2015 15:27

Re: Best Sensor for Unlimited Rotation Swerve
 
Quote:

Originally Posted by RyanShoff (Post 1482385)
I agree hard coding calibration values is bad.

We put a button on the smart dashboard called 'zero encoders'. Pushing it stores the steering encoder positions to the roborio using Preferences. That way there is nothing hardcoded, and the same code will work on two different robots. If something mechanically changes on the bot, just set the wheels to straight, press the button, and the new offsets are stored.

I like this approach. If you have to zero something, having the ability to set the values in code without having to redownload code is always nice.

Even so, it isn't that bad to have magic numbers in the code if you code in such a way that the magic numbers are easily modified.

One approach is possible with the current FIRST control system is to keep these magic values in a text file on the PC, the have bit of code on the PC that communicates to the code running on the robot that sends the magic values to the robot upon request (RoboRIO sends a UDP message "please send me MagicNoXXX" Code on PC opens text file, finds MagicNoXXX, replies with UDP message "MagicNoXXX=1234"). It even works in combination with the button idea as well. Humans put robot into known location, hits RememberTheseMagicNumbers Button on the robot, RoboRIO sends UDP message "MagicNo001=1000, MagicNo002=2000, ...", Code on PC then openes text file and updates or adds the values to the list and replies to RobioRIO via UDP "as you wish")

Seems like a system that could work. (note to PaulT what do you think, should we do this? Seems like our "play sound X code" could do this as a side business without breaking sweat)

Dr. Joe J.

Pault 16-05-2015 16:48

Re: Best Sensor for Unlimited Rotation Swerve
 
Quote:

Originally Posted by Joe Johnson (Post 1482531)
I like this approach. If you have to zero something, having the ability to set the values in code without having to redownload code is always nice.

Even so, it isn't that bad to have magic numbers in the code if you code in such a way that the magic numbers are easily modified.

One approach is possible with the current FIRST control system is to keep these magic values in a text file on the PC, the have bit of code on the PC that communicates to the code running on the robot that sends the magic values to the robot upon request (RoboRIO sends a UDP message "please send me MagicNoXXX" Code on PC opens text file, finds MagicNoXXX, replies with UDP message "MagicNoXXX=1234"). It even works in combination with the button idea as well. Humans put robot into known location, hits RememberTheseMagicNumbers Button on the robot, RoboRIO sends UDP message "MagicNo001=1000, MagicNo002=2000, ...", Code on PC then openes text file and updates or adds the values to the list and replies to RobioRIO via UDP "as you wish")

Seems like a system that could work. (note to PaulT what do you think, should we do this? Seems like our "play sound X code" could do this as a side business without breaking sweat)

Dr. Joe J.

Definitely seems like something that we should do. I have actually been thinking about doing a similar system for a while, but I never though of using it to zero potentiometers. This could have saved us a lot of time.

Only thing is that we should keep the text file in the roboRIO's file system, not on the laptop. Seems like that will cut out a lot of complexity in the system, prevent any problems switching between laptops, and allow us to use different constants for a practice robot/chassis.

Joe Johnson 16-05-2015 16:58

Re: Best Sensor for Unlimited Rotation Swerve
 
Quote:

Originally Posted by Pault (Post 1482538)
Definitely seems like something that we should do. I have actually been thinking about doing a similar system for a while, but I never though of using it to zero potentiometers. This could have saved us a lot of time.

Only thing is that we should keep the text file in the roboRIO's file system, not on the laptop. Seems like that will cut out a lot of complexity in the system, prevent any problems switching between laptops, and allow us to use different constants for a practice robot/chassis.

So there you go, CD community. If Paul goes along with something I propose you can be pretty sure it's not the worst idea I've ever had ;-) Seriously though. Paul was the core of Overclocked's coding team this year. He's top shelf. His opinion carries a lot of weight with me.

Even so, YMMV.

Dr. Joe J.

Clem1640 16-05-2015 18:22

Re: Best Sensor for Unlimited Rotation Swerve
 
We (FRC1640) use BI Technologies Magnepot Hall Effect Potentiometer Part # 6127V1A360L.5FS. Cost is reasonable ($12.32 each). These sensors have performed well for us since we adopted them in 2012. They are analog devices. We calibrate them mechanically and identically on all of our swerve modules.

see: http://www.bitechnologies.com/pdfs/6120.pdf

AlexanderTheOK 17-05-2015 01:11

Re: Best Sensor for Unlimited Rotation Swerve
 
Just mentioning this on the debate of incremental vs absolute because it hasn't been, and was what pushed 696 to use the ma3 instead of a quad encoder.

1 quad encoder takes 2 ports.

you will need 8. (one for steering and one for drive odometry right?)

Thats 16 digital ports. You don't have that to spare, especially if you want oooh i dont know, limit switches and a quadrature encoder on your elevator, or any other basic digital sensors.

You COULD run the sensors into an offboard processor, which would then stream the data over via UDP.

Or you could gear an MA3 1 to 1, save yourself 8 digital ports, save time during development by only needing 4 magic numbers in your robot code, save time during competition by not having to realign everything perfectly before each match, and save time during the build season by not having to code an offboard processor and the netcode necessary.

I know it's a compromise, but I feel like the positives far outweigh the negatives.

(Note: We at 696 DID NOT gear the MA3 1 to 1. It was a pain in the butt. We ended up essentially having quadrature encoders that go into an analog port. Not a mistake I would ever make again. It worked fantabulously during competition but something may have snapped in me halfway through debugging.)

Gdeaver 17-05-2015 14:43

Re: Best Sensor for Unlimited Rotation Swerve
 
For those who see this as an application where a quadrature encoder is best, then that is your choice, your robot, your problem.

1640 has always used an analog absolute rotary position sensor of the Hal effect principle. For the past 3 years we have used the BI 6127V1A360L.5FS. Available from Mouser and Digikey. They are up to 12.32$ for 5. Were 10.20$ the first year we used them. They just work and I like the price. I am not cheap, I'm frugal. Soldering the wires on to the posts is a good job for students that have never soldered before. They are not 0 to 5 volt like the MA3's and some other sensors. They are .25 volts to 4.75 volts. Your code has to deal with this. They are 10 bit resolution. The c-rio and the analog break out were not a ratiometric system and we did compensate for it in code. I would have to ask the programmers how stable the roborio 5 volt supply is compared to the old control system. I know the code is still in there for this. By using .25 volts for the low end most noise is avoided. Also, It is not possible to drive all the way to the 5 volt rail. This reduced range gives a crisp 0 - 360 transition under all but the worst cases With the cost of reduced resolution. The BI sensors use a bronze bushing and care must be used in attaching to the steering output shaft. Any miss alignment will cut reliability. We use the beam couplers from First choice. Our swerve modules are designed to be easy to replace. We do not fix modules on the robot. They are pulled and replaced if a problem is suspected. Remove 4 bolts and unplug 2 connectors and it's out. Put the new module in with 4 bolts and plug in 2 connectors. No programming changes or calibration. To accomplish this we mechanically calibrate the module. We do this by adjusting the beam coupler position to the banes bot steering gear box. Wheel forward, chain left, set at 2.5 volts. We made a break out for the steering sensor that allows us to plug in a good DVM and power the sensor. It is a little tedious to get them exactly at 2.5 but, with practice it gets easier.

We do not close the loop on wheel velocity. The velocity output from Ether's equations are output to the talons (PWM). We do have tachometers on each module. We use them for distance in autonomous. In the past we put 6 magnets underneath the large timing belt pulley on the first reduction. We used a Melexis US2881LUA-AAA-000-BU bipolar latch Hal effect switch. It worked but, this year we did something else. From the kit of parts we used the 3M retroflective tape and cut out pie slices and stuck them on the underneath rim of the timing pulley. 24 total. Used a spot of super glue thin to help the adhesive. Pololu QTR-1A reflectance sensors were mounted underneath the pulley to sense the tape. Mounts were printed. 2 boards for 4.25$. A frugal buy. Even though the QTR-1A is a analog output, the Roborio digital IO chops them just fine. We use a counter set for rising and falling edges for 48 counts per revolution of the first reduction. So we only use 4 digital IO's. It works.

I have thought about spi output absolute and quadrature sensors for awhile. Eating up 4 analogs can cause problems for other subsystems on the robot. So the one solution is the AMS AS5048A . It outputs 14 bit resolution and can be daisy chained to the Roborio SPI port. Pull the chip select low and read in 8 bytes. Set chip select high. Or use a chip select for each sensor.
There is also the AS5047D which outputs quadrature ABI and the resolution is programmable. You can also read absolute position from a register.
The other chip of interest is the AS5600. It can be a 5 volt or 3.3 volt absolute analog sensor 0 to 3.3 or 0 to 5 volt. The 3.3 0 to 3.3 would allow it to be wired directly to a talon srx for can control. All 3 chips are available on carrier boards with a magnet. The mounting foot print is the same for all 3 boards. A team could 3 d print a mount and play with all 3. At 15.00$ a board they are a frugal buy. I will probably buy a board and push the programming team to try controlling the swerve with can talons this summer.

marshall 18-05-2015 08:39

Re: Best Sensor for Unlimited Rotation Swerve
 
Quote:

Originally Posted by AlexanderTheOK (Post 1482610)
Just mentioning this on the debate of incremental vs absolute because it hasn't been, and was what pushed 696 to use the ma3 instead of a quad encoder.

1 quad encoder takes 2 ports.

you will need 8. (one for steering and one for drive odometry right?)

Thats 16 digital ports. You don't have that to spare, especially if you want oooh i dont know, limit switches and a quadrature encoder on your elevator, or any other basic digital sensors.

You COULD run the sensors into an offboard processor, which would then stream the data over via UDP.

Or you could gear an MA3 1 to 1, save yourself 8 digital ports, save time during development by only needing 4 magic numbers in your robot code, save time during competition by not having to realign everything perfectly before each match, and save time during the build season by not having to code an offboard processor and the netcode necessary.

I know it's a compromise, but I feel like the positives far outweigh the negatives.

(Note: We at 696 DID NOT gear the MA3 1 to 1. It was a pain in the butt. We ended up essentially having quadrature encoders that go into an analog port. Not a mistake I would ever make again. It worked fantabulously during competition but something may have snapped in me halfway through debugging.)

The Talon SRX controllers can take quadrature input and then you don't have to waste any of the DIO ports for them. You don't have to do anything on them like PID control to get feedback from them about the encoders. Granted, the SRX controllers have their own issues with that silly ribbon cable...

We stored our offset values on a text file on a USB drive that was plugged into the RoboRIO. We could update them easily enough by just changing the alignment and then hitting a button on the dashboard.


All times are GMT -5. The time now is 09:27.

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