ROBOTC.net forums
http://robotc.net/forums/

Inverse Trig Function Values
http://robotc.net/forums/viewtopic.php?f=11&t=2725
Page 1 of 1

Author:  10Dstyong [ Sat Nov 06, 2010 9:45 am ]
Post subject:  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?

Author:  jbflot [ Tue Nov 09, 2010 1:46 pm ]
Post subject:  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.

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/