I need to control the rotational position of a small gearhead motor. The motor has a quadrature encoder which supplies about 1024 pulses per revolution. The motor shaft needs to be positioned over a range of about 15 turns or 15000 encoder counts. The motor is connected to a MD23 board and I'm able to control the motor and read its position over the i2c connection.
I'm planning to use the PID_Beta6 library. Should I set the SETPOINT to the desired encoder count and supply the actual encoder value as INPUT or make the SETPOINT zero and supply the difference between current and desired encoder values as INPUT? Does it matter?
I am using a Duemilanove (AT328). Any idea of the time required to process a PID update? What would be a reasonable value for SetSampleTime?