View Single Post
  #4   Spotlight this post!  
Unread 04-03-2014, 12:48
Jefferson Jefferson is offline
Registered User
AKA: Jeff Clements
FRC #0016 (Bomb Squad)
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Mountain Home, AR
Posts: 257
Jefferson has a brilliant futureJefferson has a brilliant futureJefferson has a brilliant futureJefferson has a brilliant futureJefferson has a brilliant futureJefferson has a brilliant futureJefferson has a brilliant futureJefferson has a brilliant futureJefferson has a brilliant futureJefferson has a brilliant futureJefferson has a brilliant future
Re: Get Angle from Servo

Quote:
Originally Posted by DavisC View Post
Sorry for the confusion. My plan was initially to have the claw (powered by 2 window motors) backdrive the servo so I can read the angle.

My calibration was going to be basic, I have a 3:2 gear ratio before the servo so that when the claw spins say 90 degrees, the servo spins 60. Then If I adjust the claw to be horizontal manually (don't want to have to do this for each match which is why I was thinking of a servo), and then read in the angle, I can do some math to find out which angle is vertical and everything else.
This is why I figured encoders wouldn't work because they count rotations instead of angle position.
Like I said in the previous post, you won't be able to read the position back out of the servo. One option is to drive the servo through a series of known positions, eventually hitting a limit switch or photo eye at the position you want to calibrate to. Now you have a known physical location for a given servo position.

Quote:
Originally Posted by DavisC View Post
Yes, I now realize I could do a potentiometer and read in the analog value but I was hoping to take advantage of an already existing system. On this note though, is the analog 5V source on the cRIO module regulated enough to do this accurately?
Absolutely! We use analog encoders and potentiometers regularly to detect angle. The analog module provides 10 bit (1024 count) resolution. We haven't found a job that wasn't sufficient for.

Quote:
Originally Posted by DavisC View Post
My other thought was use the servo.read() function on an Arduino and then send the data over to the cRIO via some kind of communication. (I2C appears to be commonly used but I wonder how Ethernet would work, assuming its an Arduino Ethernet).
I'm not familiar with the Arduino implementation for servos, but you need to be careful here. All motors (including servos) must be controlled by the cRIO. So be careful to stay legal if this is the route you take.
And yes, the Arduino can communicate over I2C with the cRIO. There are threads here discussing that very topic.
Reply With Quote