user2933: I had a Roboteq motor controller, but it wasn't fast enough. I'm hoping Arduino will be faster.
Supposing that the transfer is fast enough for my purposes, how can I read angular velocity, given that I have an encoder? Honestly, I'm not totally sure how to hook it up to an Arduino board.
I can't find a name for my encoder... This is the datasheet though.
Can anyone help me with how to hook it up, and what commands to use in MATLAB?
Thanks.

user2926: Do all the processing on the Arduino, and supply the results to Matlab over serial.
I'm not 100% sure about your particular encoder, but generally encoders talk in "Grey Code".  This is a series of bits which allow you to know the direction the encoder has turned.
There are a number of libraries and tutorials for Arduino dealing with encoders.

http://playground.arduino.cc/Main/RotaryEncoders
http://www.hobbytronics.co.uk/arduino-tutorial6-rotary-encoder

The one I use comes from here:

http://www.pjrc.com/teensy/td_libs_Encoder.html

It would be best to use a library with interrupt routines on pins 2 & 3 (these support external hardware interrupts), so whenever the pin gets a signal from the encoder, the Arduino can act on it immediately.  If you do not use these pins, and have time-consuming processing in the loop(), it's easy to miss 'ticks' from the encoder.
#include <Serial.h>

// Rotary Encoder (Interrupt Driven)
#define ENCODER_PIN_A       2 /* must be pin2 for interrupt */
#define ENCODER_PIN_B       3 /* must be pin3 for interrupt */
#define ENCODER_OPTIMIZE_INTERRUPTS
#include <Encoder.h>
Encoder encoder(ENCODER_PIN_A,ENCODER_PIN_B);

void setup()
{
    Serial.begin(115200);
    // Gentlemen, start your encoders
    pinMode(ENCODER_PIN_A,INPUT_PULLUP);
    pinMode(ENCODER_PIN_B,INPUT_PULLUP);
}

void loop()
{
    unsigned long start_time = millis();
    Serial.println("Dear Matlab...");

    while (1)
    {
        unsigned long now = millis();
        unsigned int encoder_value = encoder.read();

        // Do whatever angular velocity processing is needed here
        unsigned long ticks_per_ms = encoder_value / (now - start_time);

        // Send the result back to Matlab
        Serial.println(ticks_per_ms,DEC);
    }
}

I think for your encoder the "A" and "B" outputs are where the grey code will be coming from.  These would be connected to Arduino pins 2 & 3.
Obviously the code above is not a complete solution, and needs to take care of edge-conditions like overflow of millis() after some time, etc. etc.

2933: <p>I had a Roboteq motor controller, but it wasn't fast enough. I'm hoping Arduino will be faster.</p>

<p>Supposing that the transfer is fast enough for my purposes, how can I read angular velocity, given that I have an encoder? Honestly, I'm not totally sure how to hook it up to an Arduino board.
I can't find a name for my encoder... <a href="http://www.superdroidrobots.com/images/encoder-datasheet.jpg" rel="nofollow">This is the datasheet though</a>.</p>

<p>Can anyone help me with how to hook it up, and what commands to use in MATLAB?</p>

<p>Thanks.</p>
 2926: <p>Do all the processing on the Arduino, and supply the results to Matlab over serial.</p>

<p>I'm not 100% sure about your particular encoder, but generally encoders talk in "Grey Code".  This is a series of bits which allow you to know the direction the encoder has turned.</p>

<p>There are a number of libraries and tutorials for Arduino dealing with encoders.</p>

<ul>
<li><p><a href="http://playground.arduino.cc/Main/RotaryEncoders" rel="nofollow">http://playground.arduino.cc/Main/RotaryEncoders</a></p></li>
<li><p><a href="http://www.hobbytronics.co.uk/arduino-tutorial6-rotary-encoder" rel="nofollow">http://www.hobbytronics.co.uk/arduino-tutorial6-rotary-encoder</a></p></li>
</ul>

<p>The one I use comes from here:</p>

<ul>
<li><a href="http://www.pjrc.com/teensy/td_libs_Encoder.html" rel="nofollow">http://www.pjrc.com/teensy/td_libs_Encoder.html</a></li>
</ul>

<p>It would be best to use a library with interrupt routines on pins 2 &amp; 3 (these support external hardware interrupts), so whenever the pin gets a signal from the encoder, the Arduino can act on it immediately.  If you do not use these pins, and have time-consuming processing in the loop(), it's easy to miss 'ticks' from the encoder.</p>

<pre><code>#include &lt;Serial.h&gt;

// Rotary Encoder (Interrupt Driven)
#define ENCODER_PIN_A       2 /* must be pin2 for interrupt */
#define ENCODER_PIN_B       3 /* must be pin3 for interrupt */
#define ENCODER_OPTIMIZE_INTERRUPTS
#include &lt;Encoder.h&gt;
Encoder encoder(ENCODER_PIN_A,ENCODER_PIN_B);

void setup()
{
    Serial.begin(115200);
    // Gentlemen, start your encoders
    pinMode(ENCODER_PIN_A,INPUT_PULLUP);
    pinMode(ENCODER_PIN_B,INPUT_PULLUP);
}

void loop()
{
    unsigned long start_time = millis();
    Serial.println("Dear Matlab...");

    while (1)
    {
        unsigned long now = millis();
        unsigned int encoder_value = encoder.read();

        // Do whatever angular velocity processing is needed here
        unsigned long ticks_per_ms = encoder_value / (now - start_time);

        // Send the result back to Matlab
        Serial.println(ticks_per_ms,DEC);
    }
}
</code></pre>

<p>I think for your encoder the "A" and "B" outputs are where the grey code will be coming from.  These would be connected to Arduino pins 2 &amp; 3.</p>

<p>Obviously the code above is not a complete solution, and needs to take care of edge-conditions like overflow of millis() after some time, etc. etc.</p>
