View unanswered posts | View active topics It is currently Sat Oct 25, 2014 12:18 am






Reply to topic  [ 2 posts ] 
Inverse Trig Function Values 
Author Message
Rookie

Joined: Sat Oct 23, 2010 7:55 am
Posts: 3
Post Inverse Trig Function Values
I'm trying to use a leveling pattern for the Round Up competition, as an automatic button function, however have two problems:
1) I am not sure whether acos returns values in rads or degs.

The algorithm for calculation:
int levelTicks = acos((10*sin(bottomPivot)+offGroundHeight-ringHeight)/lengthOfTopArm);

2) We received new shaft encoders yesterday, and don't know how to plug the 2 wires into the microcontroller specifically. The initialized statement we have prepared for one of them is:

#pragma config(Sensor, dgtl1, bottomPivot, sensorQuadEncoder) //we are not sure if this is the correct format

The sensors that I work with also don't specify if it goes in 90 ticks or 360 ticks. They have 2 wires, yet the paper says 90, and when I look at reference PDFs, they always mention 360 ticks.

Can you help me out?


Sat Nov 06, 2010 9:45 am
Profile
Site Admin
Site Admin

Joined: Tue May 15, 2007 9:02 am
Posts: 405
Post Re: Inverse Trig Function Values
On the Cortex, the two Shaft encoder wires must be plugged into adjacent "DIGITAL" ports. When you configure them in the Motors and Sensors Setup, the second port is automatically configured for you if you choose "Quadrature Encoder" as the sensor type.

Note that which wire is in the first port vs. the second port will determine if the encoder counts up or down as the shaft spins.

The newer 2-wire encoders count 360 degrees per revolution. The older 1-wire encoders count 90 degrees per revolution.

_________________
Jesse Flot
CMU Robotics Academy
ROBOTC Support


Tue Nov 09, 2010 1:46 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.