EasyManua.ls Logo

pitsco Tetrix Max - Page 16

pitsco Tetrix Max
22 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Description Function Coding Example (for controller ID = 1)
Read Encoder Degrees
Reads the encoder degree value. The
DC controller uses encoder pulse
data to implement PID control of a
TETRIX DC Motor connected to the
motor ports. The controller counts the
number of pulses produced over a
set time period to accurately control
velocity and position. This function is
similar to the encoder count function,
but instead of returning the raw
encoder count value, it returns the
motor shaft position in degrees. The
total degree count accumulation
can range from -536,870,912 to
536,870,911. A clockwise rotation
adds to the count value, while a
counterclockwise rotation subtracts
from the count value. The encoder
values are set to 0 at power-up and
reset.
readEncoderDegrees(ID#, enc#);
Data Type:
ID# = integer
enc# = integer
Data Range:
enc# = 1 or 2
Data Type Returned:
value = long
readEncoderDegrees(1, 1);
Read the current degree count value of
encoder 1 (ENC1 port).
readEncoderDegrees(1, 2);
Read the current degree count value of
encoder 2 (ENC2 port).
Reset Each Encoder
Resets the encoder count accumulator
to 0.
resetEncoder(ID#, enc#);
Data Type:
ID# = integer
enc# = integer
Data Range:
enc# = 1 or 2
resetEncoder(1, 1);
Reset the encoder 1 count to 0.
resetEncoder(1, 2);
Reset the encoder 2 count to 0.
Reset Both Encoders (1 and 2)
Resets encoder 1 and encoder 2 count
accumulators to 0.
resetEncoders(ID#);
Data Type:
ID# = integer
resetEncoders(1);
Reset the encoder 1 count to 0 and
encoder 2 count to 0.

Related product manuals