Modifications

Sauter à la navigation Sauter à la recherche
Ligne 18 : Ligne 18 :  
{{ambox|text=As your batteries run out, the voltage supplied to the motor drivers (VSW) will decrease, which will make the motors slower. It is possible to account for this in your code by monitoring the battery voltage (voir [[Pololu-Romi-32U4-Carte-Alimentation|section alimentation]]) or using the encoders and other sensors to monitor the movement of the robot.}}
 
{{ambox|text=As your batteries run out, the voltage supplied to the motor drivers (VSW) will decrease, which will make the motors slower. It is possible to account for this in your code by monitoring the battery voltage (voir [[Pololu-Romi-32U4-Carte-Alimentation|section alimentation]]) or using the encoders and other sensors to monitor the movement of the robot.}}
    +
== Quadrature encoders ===
 +
 +
The Romi 32U4 Control Board is configured to connect the quadrature encoder outputs from the Romi Encoder Pair Kit to the ATmega32U4 microcontroller. The encoders can be used to track the rotational speed and direction of the robot’s drive wheels. They provide a resolution of 12 counts per revolution of the motor shaft when counting both edges of both channels, which corresponds to approximately 1440 counts per revolution of the Romi’s wheels. For more information about the specifications of the Romi encoders, please see the Romi Encoder Pair Kit product page.
 +
 +
Quadrature encoder transitions are often detected by monitoring both encoder channels directly. However, since transitions on the Romi’s encoders can occur at high frequencies (several thousand per second) when its motors are running, it is necessary to use the AVR’s pin change interrupts or external interrupts to read the encoders. To reduce the required number of interrupt pins, the Romi 32U4 Control Board XORs together both channels of each encoder and connects the resulting signal to an interrupt pin, while channel B of each encoder is connected to a non-interrupt pin:
 +
* '''Digital pin 7''', or PE6, reads the '''right encoder XORed signal''' using external interrupt INT6.
 +
* '''Digital pin 8''', or PB4, reads the '''left encoder XORed signal''' using pin change interrupt PCINT4.
 +
* '''Digital pin 23''' (analog pin 5), or PF0, reads the '''right encoder channel B'''.
 +
* Pin '''PE2''' reads the '''left encoder channel B'''.
       
{{Pololu-Romi-32U4-TRAILER}}
 
{{Pololu-Romi-32U4-TRAILER}}
29 917

modifications

Menu de navigation