Pololu-Romi-32U4-Carte-Moteur-et-encodeur

De MCHobby - Wiki
Sauter à la navigation Sauter à la recherche

Contrôleur moteurs

La carte contrôleur ROMI 32U4 est équipé de deux contrôleur moteur DRV8838 de Texas Instruments qui sont utilisés pour la puissance délivrée aux deux mini moteurs plastique avec boîte de vitesse lien pololu. Quatres broches de l'Arduino sont utilisées pour piloter les contrôleurs:

  • Broche digital 15 (ou PB1) contrôle le sens de rotation du moteur droit (LOW drives the motor forward, HIGH drives it in reverse).
  • Broche digital 16 (ou PB2) contrôle le sens de rotation du moteur gauche.
  • Broche digital 9 (ou PB5) contrôle la vitesse du moteur droit avec du PWM (Pulse Width Modulation, modulation de longueur d'impulsion) généré par le Timer1 de l'ATmega32U4.
  • Broche digital 10 (ou PB6) contrôle la vitesse du moteur gauche avec du PWM.

Pour plus d'information sur les contrôleurs moteurs, voyez la fiche technique du DRV8838 (1 Mio, pdf). Popolu propose également une carte contrôleur moteur dit carrier board lien pololu exploitant la DRV8838.

La bibliothèque Romi32U4 offre des fonctions qui permet de contrôler facilement les moteurs (voir "Programmer avec avr-gcc et AVRDUDE").

Les connexions de la carte contrôleur Romi 32U4 expose des connecteurs prévu pour interfacer une paire d'encodeur rotatif pour Romi lien pololu, connecteurs présent par paire (un rangée vers "l'intérieur" et une rangée vers "l'extérieur"). Une paire de connecteurs femelles bas-profile est inclus avec la carte contrôleur Romi 32U4, connecteurs qui peuvent être soudés sur chaque côté de la carte Romi (soit dans la rangée de connecteur "intérieur", soit sur le connecteur "extérieur"). Note: les connecteurs doivent être soudés dans la position correspondant au connecteur mâle présent sur l'encodeur rotatif).

Encodeurs à quadrature

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-Carte-Moteur-et-encodeur-00.png

The XORed signal and the channel B signal can be used to reconstruct the channel A signal by simply XORing them again: (A XOR B) XOR B = A. For both encoders, channel B leads channel A when the motor is rotating in the forward direction; that is, B rises before A rises and B falls before A falls. (The waveforms in the diagram above would be produced by forward rotation.) Note that this description designates the A and B signals as labeled on the control board itself, which puts A in front on both sides.

The Romi32U4 library provides appropriate interrupt service routines and functions for reading the encoders and keeping track of their counts (voir section "Bibliothèque Arduino Romi 32U4").


Basé sur "Guide utilisateur de la carte de contrôle Romi 32U4" de Pololu (https://www.pololu.com/docs/0J69) - Traduit en Français par shop.mchobby.be CC-BY-SA pour la traduction
Toute copie doit contenir ce crédit, lien vers cette page et la section "crédit de traduction". Traduit avec l'autorisation expresse de Pololu (www.pololu.com)

Based on "Pololu Romi 32U4 Control Board User’s Guide" from Pololu (https://www.pololu.com/docs/0J69) - Translated to French by shop.mchobby.be CC-BY-SA for the translation
Copies must includes this credit, link to this page and the section "crédit de traduction" (translation credit). Translated with the Pololu's authorization (www.pololu.com)