Go to Post A team does not achieve "Powerhouse" status by dominating every once in a while... they achieve that status by consistently dominating every year. - Jon Jack [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
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 03-03-2014, 13:53
DavisC DavisC is offline
Registered User
FRC #0539 (Titans)
Team Role: College Student
 
Join Date: Jul 2011
Rookie Year: 2010
Location: Virginia
Posts: 200
DavisC is just really niceDavisC is just really niceDavisC is just really niceDavisC is just really nice
Get Angle from Servo

Hello,

I am attempting to use a servo mounted on the robot that will spin with the claw so that I can get the correct angle of the claw after calibration.

I understand for writing the Servo angle uses the PWM Outs on the DSC. Is there a PWM channel that can be used to read the value of the servo as well?

Thanks,
Davis C
__________________
FRC Team 539
Student Member: 2010 Breakaway - 2014 Aerial Assist
Mentor: 2015 Recycle Rush - present
Reply With Quote
  #2   Spotlight this post!  
Unread 03-03-2014, 14:04
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: 258
Jefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond repute
Re: Get Angle from Servo

Quote:
Originally Posted by DavisC View Post
Hello,

I am attempting to use a servo mounted on the robot that will spin with the claw so that I can get the correct angle of the claw after calibration.

I understand for writing the Servo angle uses the PWM Outs on the DSC. Is there a PWM channel that can be used to read the value of the servo as well?

Thanks,
Davis C
To be clear, you want to back drive the servo manually to a position to perform a "calibration" of the desired angle?
You can't read the position back through the PWM channel. You'll need to add a sensor here to accomplish this.
Describe your calibration process a little more and maybe we can offer some different options.
Also, you want want to make sure the servo is powerful enough to do the job (rotating a claw?). FIRST doesn't allow very powerful servos as their power supply comes from the DSC.
Reply With Quote
  #3   Spotlight this post!  
Unread 03-03-2014, 19:37
DavisC DavisC is offline
Registered User
FRC #0539 (Titans)
Team Role: College Student
 
Join Date: Jul 2011
Rookie Year: 2010
Location: Virginia
Posts: 200
DavisC is just really niceDavisC is just really niceDavisC is just really niceDavisC is just really nice
Re: Get Angle from Servo

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.

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?

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).

So I guess my question now is, what is the best way to accomplish something like this?
__________________
FRC Team 539
Student Member: 2010 Breakaway - 2014 Aerial Assist
Mentor: 2015 Recycle Rush - present
Reply With Quote
  #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: 258
Jefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond reputeJefferson has a reputation beyond repute
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
  #5   Spotlight this post!  
Unread 04-03-2014, 13:17
DjScribbles DjScribbles is offline
Programming Mentor
AKA: Joe S
FRC #2474 (Team Excel)
Team Role: Mentor
 
Join Date: Oct 2011
Rookie Year: 2012
Location: Niles MI
Posts: 284
DjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to behold
Re: Get Angle from Servo

We use this potentiometer to sense our arm angle.
Reply With Quote
  #6   Spotlight this post!  
Unread 05-03-2014, 09:58
Mike Bortfeldt Mike Bortfeldt is offline
Registered User
FRC #1126 (& 1511)
Team Role: Mentor
 
Join Date: Oct 2004
Rookie Year: 2004
Location: Rochester, NY
Posts: 119
Mike Bortfeldt has much to be proud ofMike Bortfeldt has much to be proud ofMike Bortfeldt has much to be proud ofMike Bortfeldt has much to be proud ofMike Bortfeldt has much to be proud ofMike Bortfeldt has much to be proud ofMike Bortfeldt has much to be proud ofMike Bortfeldt has much to be proud of
Re: Get Angle from Servo

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).
For reference, in the Arduino environment, a servo.read() will not read the current location of the servo. It will only return the last value sent to the servo through a servo.write() command.

http://arduino.cc/en/Reference/ServoRead

Mike
Reply With Quote
  #7   Spotlight this post!  
Unread 05-03-2014, 10:52
Qbot2640's Avatar
Qbot2640 Qbot2640 is offline
Registered User
AKA: Terry McHugh
FRC #2640 (Hotbotz)
Team Role: Mentor
 
Join Date: Sep 2012
Rookie Year: 2012
Location: Reidsville, NC
Posts: 473
Qbot2640 has a reputation beyond reputeQbot2640 has a reputation beyond reputeQbot2640 has a reputation beyond reputeQbot2640 has a reputation beyond reputeQbot2640 has a reputation beyond reputeQbot2640 has a reputation beyond reputeQbot2640 has a reputation beyond reputeQbot2640 has a reputation beyond reputeQbot2640 has a reputation beyond reputeQbot2640 has a reputation beyond reputeQbot2640 has a reputation beyond repute
Re: Get Angle from Servo

Quote:
Originally Posted by DjScribbles View Post
We use this potentiometer to sense our arm angle.
Create a simple adjustable resistive circuit, run the +5 and ground through the entire circuit, and the signal to the center "adjustable" point. Pick up the voltage drop and in your code write the math algorithm that translates it into the number you want to read. Display the number on a customized version of the dashboard.
__________________

2012 Palmetto Regional Winners (Thanks 2059, 2815, and 287).
2012 Newton 14th Seed
2013 Chesapeake Regional Imagery Award Winners
2014 North Carolina Regional Imagery Award Winners
2014 Greater DC Regional Team Spirit Award Winners
2015 North Carolina Regional Finalists (Thanks 3971 and 587)
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 14:10.

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