Différences entre versions de « Pololu-Romi-32U4-Carte-Moteur-et-encodeur »

De MCHobby - Wiki
Sauter à la navigation Sauter à la recherche
Ligne 4 : Ligne 4 :
  
 
== Contrôleur moteurs ==
 
== Contrôleur moteurs ==
The Romi 32U4 Control Board has two Texas Instruments DRV8838 motor drivers that are used to power the Romi chassis’s two mini plastic gearmotors {{polpl|1520}}. Four Arduino pins are used to control the drivers:
+
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 {{polpl|1520}}. Quatres broches de l'Arduino sont utilisées pour piloter les contrôleurs:
* '''Digital pin 15''', or PB1, controls the '''right motor direction''' (LOW drives the motor forward, HIGH drives it in reverse).
+
* '''Broche digital 15''' (ou PB1) contrôle le '''sens de rotation du moteur droit''' (LOW drives the motor forward, HIGH drives it in reverse).
* '''Digital pin 16''', or PB2, controls the '''left motor direction'''.
+
* '''Broche digital 16''' (ou PB2) contrôle le '''sens de rotation du moteur gauche'''.
* '''Digital pin 9''', or PB5, controls the '''right motor speed''' with PWM (pulse width modulation) generated by the ATmega32U4’s Timer1.
+
* '''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.
* '''Digital pin 10''', or PB6, controls the '''left motor speed''' with PWM.
+
* '''Broche digital 10''' (ou PB6) contrôle la '''vitesse du moteur gauche''' avec du PWM.
  
For more information about the drivers, see the [https://www.pololu.com/file/0J806/drv8838.pdf DRV8838 datasheet] (''1MB pdf''). Popolu propose également une carte contrôleur moteur dit ''carrier board'' {{polpl|2990}} exploitant la DRV8838.
+
Pour plus d'information sur les contrôleurs moteurs, voyez la [https://www.pololu.com/file/0J806/drv8838.pdf fiche technique du DRV8838 ] (''1 Mio, pdf''). Popolu propose également une carte contrôleur moteur dit ''carrier board'' {{polpl|2990}} exploitant la DRV8838.
  
The Romi32U4 library provides functions that allow you to easily control the motors (voir "[[Pololu-Romi-32U4-Programmer-AVRDUDE|Programmer avec avr-gcc et AVRDUDE]]").
+
La bibliothèque Romi32U4 offre des fonctions qui permet de contrôler facilement les moteurs (voir "[[Pololu-Romi-32U4-Programmer-AVRDUDE|Programmer avec avr-gcc et AVRDUDE]]").
  
The motor driver connections are brought out to two pairs of headers that are intended to interface with the {{pl|1452|Paire d'encodeur rotatif pour Romi}} {{polpl|3542}}. A pair of low-profile female headers is included with the Romi 32U4 Control Board and can be soldered into either the outer or inner row of through-holes on each side. (Note that these headers must be soldered into the positions that match the male header installed on the encoder board).
+
Les connexions de la carte contrôleur Romi 32U4 expose des connecteurs prévu pour interfacer une {{pl|1452|paire d'encodeur rotatif pour Romi}} {{polpl|3542}}, 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).
  
{{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=Au fur et à mesure que les piles se déchargent, la tension VSW fournie au contrôleur moteur diminuera, ce qui ralentira le moteur. Il est tout à fait possible de gérer cela dans le code en surveillant la tension des piles (voir [[Pololu-Romi-32U4-Carte-Alimentation|section alimentation]]) '''OU''' en utilisant des encodeurs (ou autre capteurs) capable de surveiller les mouvements du robot.}}
  
 
== Quadrature encoders ==
 
== Quadrature encoders ==

Version du 3 juin 2019 à 22:19

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).

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-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)