|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
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 |
|
#2
|
|||
|
|||
|
Re: Get Angle from Servo
Quote:
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. |
|
#3
|
|||
|
|||
|
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? |
|
#4
|
|||
|
|||
|
Re: Get Angle from Servo
Quote:
Quote:
Quote:
And yes, the Arduino can communicate over I2C with the cRIO. There are threads here discussing that very topic. |
|
#5
|
|||
|
|||
|
Re: Get Angle from Servo
We use this potentiometer to sense our arm angle.
|
|
#6
|
||||
|
||||
|
Re: Get Angle from Servo
Quote:
|
|
#7
|
|||
|
|||
|
Re: Get Angle from Servo
Quote:
http://arduino.cc/en/Reference/ServoRead Mike |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|