Arm+Control

Arm Control Information

Video about E4P encoder: http://www.youtube.com/watch?v=4hJfzhxZwKw

Connectivity: Each encoder uses 2 x GPIO ports on a sidecar. See "2010 Platform spec.xls" file as an example.

Wiring (for each encoder): See "usdfirst_flyer.pdf" and "Digital_Sidecar.pdf" __Connector 1:__ contact 1 - "A" contact 2 - +5V contact 3 - ground

__Connector 2:__ contact 1 - "B" contact 2 - contact 3 -

We will need also two relays configured in bi-directional way to drive motors.

Programming: (did not find much information, only a couple of references, one is on the page 28 of "WPI Robotic Library Users Guide doc1196.pdf" )

Java code craeating an encoder on ports 1 and 2 with reverse sensing and 4X encoding: Encoder encoder; encoder = new Encoder(1, 2, true, EncodingType.k4X);

C++ :

Encoder *myEncoder;

and initialize the object and set it up...

myEncoder = new Encoder(1,2,true,CounterBase::k4X);

also to use the encoder...

if(myEncoder->GetRaw) or if(myEncoder->Get)

There is also an alternative method of controlling the arm without encoders which is based on the three end-switches. Top switch (switch A) get activated when **top** link reaches it's **highest** point. Bottom switch (switch B ) get activated when **bottom** link reaches it's **lowest** point. Middle switch (switch M) get activated when links get close together.

Input: Control button A (cA): -1 - down; 0 - stop; +1 - up - controls top link Control button B (cB): -1 - down; 0 - stop; +1 - up - controls bottom link

End switch A (sA): 0 - open; 1 closed End switch B (sB): 0 - open; 1 closed End switch M (sM): 0 - open; 1 closed

Output: Motor A (mA): -1 - down; 0 - stop; +1 - up - moves top link Motor B (mB): -1 - down; 0 - stop; +1 - up - moves bottom link

Control algorithm can be presented in a form of table (only a fragment shown): and so on....
 * cA || cB || sA || sB || sM || mA || mB ||
 * 0 || 0 || x || x || x || 0 || 0 ||
 * 0 || 1 || 0 || 0 || 0 || 0 || 1 ||
 * 0 || 1 || 0 || 0 || 1 || 0 || 0 ||
 * 0 || 1 || 0 || 1 || 0 || 0 || 1 ||
 * 0 || 1 || 0 || 1 || 1 || 0 || 0 ||
 * 0 || 1 || 1 || 0 || 0 || 0 || 1 ||
 * 0 || 1 || 1 || 0 || 1 || 0 || 0 ||
 * 0 || 1 || 1 || 1 || 0 || 0 || 1 ||
 * 0 || 1 || 1 || 1 || 1 || 0 || 0 ||
 * 0 || -1 || 0 || 0 || 0 || 0 || -1 ||
 * 0 || -1 || 0 || 0 || 1 || 0 || -1 ||
 * 0 || -1 || 0 || 1 || 0 || 0 || 0 ||
 * 0 || -1 || 0 || 1 || 1 || 0 || 0 ||
 * 0 || -1 || 1 || 0 || 0 || 0 || -1 ||
 * 0 || -1 || 1 || 0 || 1 || 0 || -1 ||
 * 0 || -1 || 1 || 1 || 0 || 0 || 0 ||
 * 0 || -1 || 1 || 1 || 1 || 0 || 0 ||
 * 0 || -1 || 1 || 1 || 1 || 0 || 0 ||