HerkuleXLib: Comment débugger ? / Howto debug?

1. Pour les francophones

Je reçois de temps à autres des demandes d’aide pour utiliser la librairie. Je suis content qu’elle vous serve ! En général vous me contactez quand vous rencontrez des problèmes… et c’est normal.

J’écris cet article pour essayer de vous aider à identifier pourquoi ça ne fonctionne pas. Et la classe qui va vous aider dans cette démarche est HkxPrint. La documentation de HkxPrint nous explique que :

This class manages the print of the messages (error, warning and info) for a serial monitor.

C’est à dire en bon français :

Cette classe gère l’envoie de messages (erreur, alertes et informations) au moniteur série.

Le moniteur série (encadré en rouge ci-dessous) s’ouvre dans le logiciel Arduino avec le bouton entouré en rouge.

1.1. Afficher tous les messages

Remarquez que dans l’exemple de la documentation, le premier objet créé (printout) instancie cette classe. Quatre constructeurs permettent d’instancier des objets HkxPrint. Celui de l’exemple ne renseigne que le port série utilisé et la vitesse de transfert. Avec ce constructeur seuls les messages d’erreur sont envoyés au moniteur série.

HkxPrint printout = HkxPrint(Serial, 9600); // Printout errors on the serial monitor

Pour débugger notre code, il nous faut tous les messages (erreur, alertes et informations). Pour cela nous utilisons un autre constructeur qui permet de spécifier les types de messages que nous souhaitons afficher.

HkxPrint printoutLib = HkxPrint(Serial, 9600, true, true, true); // Printout all messages on the serial monitor

1.2. Exemple d’application

Pour la suite de cet article, je m’appuies sur des échanges que j’ai eu avec une personne qui m’a sollicité. Pour identifier le problème nous sommes partis du programme suivant :

#include <HkxPosControl.h>

void setup() {
  // INPUT 
  int ID = 0;   
  // servo to drive 
  HkxPrint printoutLib = HkxPrint(Serial, 9600); 
  // Printout errors on the serial monitor 
  HkxPrint printoutCode = HkxPrint(printoutLib, true, true, true); 
  // Printout errors on the serial monitor 
  HkxCommunication communication = HkxCommunication(HKX_666666, Serial1, printoutLib); 
  // Communication with the servo on Serial1 
  HkxPosControl servo(ID, communication, printoutLib); 
  // control position for the servo ID 
  // Set the LED and torque off 
  servo.setTorqueLEDControl(HKX_TORQUE_FREE, HKX_LED_OFF); 
  printoutCode.infoPrint("LED is off, torque is free"); 
  delay(2000); 
  // wait 2 seconds 
  // Set the LED to red 
  servo.setTorqueLEDControl(HKX_NO_VALUE, HKX_LED_RED); 
  printoutCode.infoPrint("LED is now red"); 
  delay(2000); 
  // wait 2 seconds 
  // Set the servo to position 45° in 2 seconds, led turns to blue during the move, 
  // wait for the end of the move 
  printoutCode.infoPrint("Start moving to 45 degrees in 2 seconds, blue LED"); 
  servo.movePosition(450, 2000, HKX_LED_BLUE, true); 
  printoutCode.infoPrint("The move is finished, torque is free and LED back to red"); 
}

void loop() {}

1.3. Quand ça fonctionne

Ligne 7, l’objet printoutLib ne renvoie dans ce cas que les erreurs. Quand ça fonctionne, nous obtenons sur le moniteur série :

Info: LED is off, torque is free
Info: LED is now red
Info: Start moving to 45 degrees in 2 seconds, blue LED
Info: The move is finished, torque is free and LED back to red

1.4. Rentrons dans les détails

Maintenant modifions la ligne 7 du programme pour que l’objet printoutLib renvoie tous les messages :

HkxPrint printoutLib = HkxPrint(Serial, 9600, true, true, true); // Printout all messages on the serial monitor

Toujours lorsque le programme se déroule correctement, nous obtenons sur le moniteur série :

Info: start > Start the communication for printing
Info: HkxCommunication::start > Start the communication for the servos
Info: sendPacket > Packet sent: ff ff 7 0 7 0 fe
Info: receivePacket > Packet (ff ff 7 0 7 0 fe ) return to sender, I try again
Info: receivePacket > Packet received: ff ff 9 0 47 4e b0 0 0
Info: sendPacket > Packet sent: ff ff 9 0 4 14 ea 0 18
Info: receivePacket > Packet received: ff ff 23 0 44 c0 3e 0 18 0 1 7f 35 0 de 5b 89 32 2e 0 0 0 0 0 0 ff 3 fe 3 cd 0 2a 3 0 0
Info: sendPacket > Packet sent: ff ff b 0 3 3e c0 34 2 0 0
Info: LED is off, torque is free
Info: sendPacket > Packet sent: ff ff a 0 3 38 c6 35 1 4
Info: LED is now red
Info: Start moving to 45 degrees in 2 seconds, blue LED
Info: sendPacket > Packet sent: ff ff a 0 3 5c a2 34 1 60
Info: sendPacket > Packet sent: ff ff c 0 6 38 c6 b3 8b 2 8 0
Info: sendPacket > Packet sent: ff ff 7 0 7 0 fe
Info: receivePacket > Packet received: ff ff 9 0 47 e f0 0 40
Info: sendPacket > Packet sent: ff ff 7 0 7 0 fe
Info: receivePacket > Packet received: ff ff 9 0 47 e f0 0 40
Info: sendPacket > Packet sent: ff ff 7 0 7 0 fe
Info: receivePacket > Packet received: ff ff 9 0 47 e f0 0 40
Info: sendPacket > Packet sent: ff ff 7 0 7 0 fe
Info: receivePacket > Packet received: ff ff 9 0 47 e f0 0 40
Info: sendPacket > Packet sent: ff ff 7 0 7 0 fe
Info: receivePacket > Packet received: ff ff 9 0 47 e f0 0 40
Info: sendPacket > Packet sent: ff ff 7 0 7 0 fe
Info: receivePacket > Packet received: ff ff 9 0 47 e f0 0 40
Info: sendPacket > Packet sent: ff ff 7 0 7 0 fe
Info: receivePacket > Packet received: ff ff 9 0 47 e f0 0 41
Info: sendPacket > Packet sent: ff ff 7 0 7 0 fe
Info: receivePacket > Packet received: ff ff 9 0 47 e f0 0 41
Info: sendPacket > Packet sent: ff ff 7 0 7 0 fe
Info: receivePacket > Packet received: ff ff 9 0 47 e f0 0 41
Info: sendPacket > Packet sent: ff ff 7 0 7 0 fe
Info: receivePacket > Packet received: ff ff 9 0 47 e f0 0 41
Info: sendPacket > Packet sent: ff ff 7 0 7 0 fe
Info: receivePacket > Packet received: ff ff 9 0 47 e f0 0 41
Info: sendPacket > Packet sent: ff ff 7 0 7 0 fe
Info: receivePacket > Packet received: ff ff 9 0 47 e f0 0 41
Info: sendPacket > Packet sent: ff ff 7 0 7 0 fe
Info: receivePacket > Packet received: ff ff 9 0 47 e f0 0 40
Info: sendPacket > Packet sent: ff ff 7 0 7 0 fe
Info: receivePacket > Packet received: ff ff 9 0 47 e f0 0 40
Info: sendPacket > Packet sent: ff ff 7 0 7 0 fe
Info: receivePacket > Packet received: ff ff 9 0 47 e f0 0 40
Info: sendPacket > Packet sent: ff ff 7 0 7 0 fe
Info: receivePacket > Packet received: ff ff 9 0 47 c f2 0 42
Info: sendPacket > Packet sent: ff ff b 0 3 3a c4 34 2 0 4
Info: The move is finished, torque is free and LED back to red

Les lignes 1 à 7 sont liées à l’initialisation de la communication avec le servomoteur (ligne 10 du programme). La librairie contrôle qu’elle communique correctement avec le servomoteurs, et que son statut permet de continuer les opérations correctement.

La ligne 8 envoie la commande au servomoteur de la ligne 13 du programme. La ligne 9 est directement définie par la ligne 14 du programme. De même, les lignes 10 et 11 du moniteur série sont liées respectivement aux lignes 18 et 19 du programme.

La ligne 12 (ligne 24 du programme) annonce le départ du mouvement du servomoteur. Les lignes 13 à 47 sont une succession d’échanges avec le servomoteur pour contrôler son état pendant toute la durée du mouvement défini ligne 25 du programme. Enfin le message ligne 48 est défini à la ligne 26 du programme.

1.5. C’est quoi ces paquets ?

Vous avez remarqués qu’une majorité de lignes décrivent des paquets envoyés et des paquets reçus. Ces lignes affichent une succession de chiffres hexadécimaux. La mauvaise nouvelle c’est que pour comprendre la signification de ces paquets il faut lire attentivement la documentation des servomoteurs. Vous pouvez démarrer la lecture au paragraphe 4-1. Communications Protocol, page 18.

1.6. Quand ça ne fonctionne pas

Lorsque la personne que j’aidais a exécuté le même programme sur son installation, elle a obtenu ceci sur son moniteur série :

Info: start > Start the communication for printing
Info: HkxCommunication::start > Start the communication for the servos
Info: sendPacket > Packet sent: ff ff 7 fd 7 fc 2 => Envoie une demande de statut au servo
Warning: HkxCommunication::receivePacket > Checksums do not match => Le paquet reçu a une erreur de checksum
Info: sendPacket > Packet sent: ff ff 7 fd 7 fc 2 => Renvoie une demande de statut
Info: receivePacket > Packet received: ff ff 9 fd 47 b2 4c 0 0 => Le servo répond que tout va bien
Info: sendPacket > Packet sent: ff ff 9 fd 4 e8 16 0 18 => Envoie une demande de lecture de la mémoire RAM (pour récupérer un certain nombre de paramètres du servo)
Warning: HkxCommunication::receivePacket > Header not found => Réception d'informations sans header (le header c'est ff ff au début des requêtes)
Warning: HkxCommunication::receivePacket > Header not found
Warning: HkxCommunication::receivePacket > Header not found
Warning: HkxCommunication::receivePacket > Header not found
Warning: HkxCommunication::receivePacket > Header not found => Je pense qu'il y en a plusieurs parce que la réponse du servomoteur est longue
Info: sendPacket > Packet sent: ff ff a fd 1 f0 e 7 1 1 => Vu que la réponse n'a pas été reçu => demande de modification du ACK Policy en ROM pour être sûre d'avoir des réponses aux requêtes
Info: sendPacket > Packet sent: ff ff a fd 3 f4 a 1 1 1 => Pareil en RAM
Info: sendPacket > Packet sent: ff ff b fd 3 c2 3c 34 2 0 0 => Envoie une demande pour mettre le 'torque' à 'free' et éteindre la LED
Info: LED is off, torque is free
Info: sendPacket > Packet sent: ff ff a fd 3 c4 3a 35 1 4 => Envoie une demande pour mettre la LED en rouge
Info: LED is now red
Info: Start moving to 45 degrees in 2 seconds, blue LED
Info: sendPacket > Packet sent: ff ff a fd 3 a0 5e 34 1 60 => Envoie une demande pour mettre le 'torque' à 'on' et mettre la LED en vert
Info: sendPacket > Packet sent: ff ff c fd 6 38 c6 b3 8b 2 8 fd => Envoie une demande de déplacement
Info: sendPacket > Packet sent: ff ff 7 fd 7 fc 2 => Demande de statut
Info: receivePacket > Packet received: ff ff 9 fd 47 be 40 8 4 => Le servo répond qu'il a eu une erreur 'Invalid packet' avec une 'checksum error' (ainsi de suite jusqu'à la fin)
Info: sendPacket > Packet sent: ff ff 7 fd 7 fc 2
Info: receivePacket > Packet received: ff ff 9 fd 47 be 40 8 4
Info: sendPacket > Packet sent: ff ff 7 fd 7 fc 2
Info: receivePacket > Packet received: ff ff 9 fd 47 be 40 8 4
Info: sendPacket > Packet sent: ff ff 7 fd 7 fc 2
Info: receivePacket > Packet received: ff ff 9 fd 47 be 40 8 4
Info: sendPacket > Packet sent: ff ff 7 fd 7 fc 2
Info: receivePacket > Packet received: ff ff 9 fd 47 be 40 8 4
Info: sendPacket > Packet sent: ff ff 7 fd 7 fc 2
Info: receivePacket > Packet received: ff ff 9 fd 47 be 40 8 4
Info: sendPacket > Packet sent: ff ff 7 fd 7 fc 2
Info: receivePacket > Packet received: ff ff 9 fd 47 be 40 8 4
Info: sendPacket > Packet sent: ff ff 7 fd 7 fc 2
Info: receivePacket > Packet received: ff ff 9 fd 47 be 40 8 4
Info: sendPacket > Packet sent: ff ff 7 fd 7 fc 2
Info: receivePacket > Packet received: ff ff 9 fd 47 be 40 8 4

Les plus attentifs d’entre – ceux qui ont lu la documentation du servomoteur – vous aurez remarqué que l’ID du servomoteur n’est pas le même celui défini dans le programme. C’est que la personne avait configuré le servomoteur avec un autre ID.

J’ai commenté les lignes importantes pour expliquer les paquets. Scrollez sur le droite pour les voir.

1.7. C’est grave docteur ?

Mon diagnostique dans ce cas est que le liaison série entre la carte Arduino et le servomoteur est perturbée, et que de fait la communication ne peut s’établir correctement. A distance c’est compliqué d’en dire beaucoup plus…

1.8. Merci pour vos remerciements

L’exemple que je vous présente ici est lié à des discussions que j’ai eu avec des étudiants en école d’ingénieur. Ceux-ci ont eu la délicatesse de m’envoyer leur rapport de projet dans lequel ils m’ont sité et remercié. Je ne peux que les en remercier à mon tour.

2. For English speakers

I sometimes receive requests for help to use the library. I’m glad you’re using it! You often contact me when you meet problems… which makes sense.

I wrote this article to try to help you identify why it doesn’t work. And the class that will help you with this is HkxPrint. HkxPrint documentation says that:

This class manages the print of the messages (error, warning and info) for a serial monitor.

The serial monitor (boxed in red bellow) opens from the Arduino sofware with the highlighted button.

1.1. Printing all the messages

Note that in the documentation example, the first object created (printout) instantiates this class. Four constructors allow you to instantiate HkxPrint objects. In the example, it specifies only the serial port and the baudrate. With this constructor only error messages are sent to the serial monitor.

HkxPrint printout = HkxPrint(Serial, 9600); // Printout errors on the serial monitor

To debug, we will need all types of messages (error, warning and information). To do this, we will use another constructor that allows you to specify type of messages to display.

HkxPrint printoutLib = HkxPrint(Serial, 9600, true, true, true); // Printout all messages on the serial monitor

1.2. Example

The example illustrated until the end of the article comes from discussions that I had with someone I helped. To identify the problem, we started with the following program:

#include <HkxPosControl.h>

void setup() {
  // INPUT 
  int ID = 0;   
  // servo to drive 
  HkxPrint printoutLib = HkxPrint(Serial, 9600); 
  // Printout errors on the serial monitor 
  HkxPrint printoutCode = HkxPrint(printoutLib, true, true, true); 
  // Printout errors on the serial monitor 
  HkxCommunication communication = HkxCommunication(HKX_666666, Serial1, printoutLib); 
  // Communication with the servo on Serial1 
  HkxPosControl servo(ID, communication, printoutLib); 
  // control position for the servo ID 
  // Set the LED and torque off 
  servo.setTorqueLEDControl(HKX_TORQUE_FREE, HKX_LED_OFF); 
  printoutCode.infoPrint("LED is off, torque is free"); 
  delay(2000); 
  // wait 2 seconds 
  // Set the LED to red 
  servo.setTorqueLEDControl(HKX_NO_VALUE, HKX_LED_RED); 
  printoutCode.infoPrint("LED is now red"); 
  delay(2000); 
  // wait 2 seconds 
  // Set the servo to position 45° in 2 seconds, led turns to blue during the move, 
  // wait for the end of the move 
  printoutCode.infoPrint("Start moving to 45 degrees in 2 seconds, blue LED"); 
  servo.movePosition(450, 2000, HKX_LED_BLUE, true); 
  printoutCode.infoPrint("The move is finished, torque is free and LED back to red"); 
}

void loop() {}

1.3. When it works

Line 7, the objet printoutLib only displays errors in this case. When it works, we then get on the serial monitor:

Info: LED is off, torque is free
Info: LED is now red
Info: Start moving to 45 degrees in 2 seconds, blue LED
Info: The move is finished, torque is free and LED back to red

1.4. Let’s go into details

We now modify the program line 7 so the printoutLib object displays all messages:

HkxPrint printoutLib = HkxPrint(Serial, 9600, true, true, true); // Printout all messages on the serial monitor

Let’s keep considering the case of correct processing, then we get on the serial monitor:

Info: start > Start the communication for printing
Info: HkxCommunication::start > Start the communication for the servos
Info: sendPacket > Packet sent: ff ff 7 0 7 0 fe
Info: receivePacket > Packet (ff ff 7 0 7 0 fe ) return to sender, I try again
Info: receivePacket > Packet received: ff ff 9 0 47 4e b0 0 0
Info: sendPacket > Packet sent: ff ff 9 0 4 14 ea 0 18
Info: receivePacket > Packet received: ff ff 23 0 44 c0 3e 0 18 0 1 7f 35 0 de 5b 89 32 2e 0 0 0 0 0 0 ff 3 fe 3 cd 0 2a 3 0 0
Info: sendPacket > Packet sent: ff ff b 0 3 3e c0 34 2 0 0
Info: LED is off, torque is free
Info: sendPacket > Packet sent: ff ff a 0 3 38 c6 35 1 4
Info: LED is now red
Info: Start moving to 45 degrees in 2 seconds, blue LED
Info: sendPacket > Packet sent: ff ff a 0 3 5c a2 34 1 60
Info: sendPacket > Packet sent: ff ff c 0 6 38 c6 b3 8b 2 8 0
Info: sendPacket > Packet sent: ff ff 7 0 7 0 fe
Info: receivePacket > Packet received: ff ff 9 0 47 e f0 0 40
Info: sendPacket > Packet sent: ff ff 7 0 7 0 fe
Info: receivePacket > Packet received: ff ff 9 0 47 e f0 0 40
Info: sendPacket > Packet sent: ff ff 7 0 7 0 fe
Info: receivePacket > Packet received: ff ff 9 0 47 e f0 0 40
Info: sendPacket > Packet sent: ff ff 7 0 7 0 fe
Info: receivePacket > Packet received: ff ff 9 0 47 e f0 0 40
Info: sendPacket > Packet sent: ff ff 7 0 7 0 fe
Info: receivePacket > Packet received: ff ff 9 0 47 e f0 0 40
Info: sendPacket > Packet sent: ff ff 7 0 7 0 fe
Info: receivePacket > Packet received: ff ff 9 0 47 e f0 0 40
Info: sendPacket > Packet sent: ff ff 7 0 7 0 fe
Info: receivePacket > Packet received: ff ff 9 0 47 e f0 0 41
Info: sendPacket > Packet sent: ff ff 7 0 7 0 fe
Info: receivePacket > Packet received: ff ff 9 0 47 e f0 0 41
Info: sendPacket > Packet sent: ff ff 7 0 7 0 fe
Info: receivePacket > Packet received: ff ff 9 0 47 e f0 0 41
Info: sendPacket > Packet sent: ff ff 7 0 7 0 fe
Info: receivePacket > Packet received: ff ff 9 0 47 e f0 0 41
Info: sendPacket > Packet sent: ff ff 7 0 7 0 fe
Info: receivePacket > Packet received: ff ff 9 0 47 e f0 0 41
Info: sendPacket > Packet sent: ff ff 7 0 7 0 fe
Info: receivePacket > Packet received: ff ff 9 0 47 e f0 0 41
Info: sendPacket > Packet sent: ff ff 7 0 7 0 fe
Info: receivePacket > Packet received: ff ff 9 0 47 e f0 0 40
Info: sendPacket > Packet sent: ff ff 7 0 7 0 fe
Info: receivePacket > Packet received: ff ff 9 0 47 e f0 0 40
Info: sendPacket > Packet sent: ff ff 7 0 7 0 fe
Info: receivePacket > Packet received: ff ff 9 0 47 e f0 0 40
Info: sendPacket > Packet sent: ff ff 7 0 7 0 fe
Info: receivePacket > Packet received: ff ff 9 0 47 c f2 0 42
Info: sendPacket > Packet sent: ff ff b 0 3 3a c4 34 2 0 4
Info: The move is finished, torque is free and LED back to red

Lines 1 to 7 are related to the communication initialisation with the servomotor (program line 10). The library checks that communication with the servomotor is correct, and that its status enables correct operations.

Line 8 sends the command to the servomotor from program line 13. Line 9 is defined by program line 14. Similarly, lines 10 and 11 of the serial monitor are related to program lines 18 and 19.

Line 12 (program line 24) announces the start of the servomotor motion. Lines 13 to 47 are successive communication sequences with the servomotor to check its status during the entire motion defined at program line 25. Finally, the message at line 48 is defined at the program line 26.

1.5. What are those packets ?

You have observed that most of the lines in the serial monitor show send and received packets. Each of these lines shows hexadecimal numbers. The bad news is that in order to understand the meaning of these packets, you must carefully study the servomotors documentation. You can start reading from the section 4-1. Communications Protocol, page 18.

1.6. When it does not work

When the person – that I helped – executed the same program on his setup, he obtained on his serial monitor :

Info: start > Start the communication for printing
Info: HkxCommunication::start > Start the communication for the servos
Info: sendPacket > Packet sent: ff ff 7 fd 7 fc 2 => Send a status request to the servo
Warning: HkxCommunication::receivePacket > Checksums do not match => Received packet has a checksum error
Info: sendPacket > Packet sent: ff ff 7 fd 7 fc 2 => Send again the status request
Info: receivePacket > Packet received: ff ff 9 fd 47 b2 4c 0 0 => Servo says he is fine
Info: sendPacket > Packet sent: ff ff 9 fd 4 e8 16 0 18 => Send a request to read the RAM (to check some of the servo settings)
Warning: HkxCommunication::receivePacket > Header not found => Receive a packet without header (header are ff ff at the beginning of packets)
Warning: HkxCommunication::receivePacket > Header not found
Warning: HkxCommunication::receivePacket > Header not found
Warning: HkxCommunication::receivePacket > Header not found
Warning: HkxCommunication::receivePacket > Header not found => I think there are several beaucause the request responce from the RAM is long
Info: sendPacket > Packet sent: ff ff a fd 1 f0 e 7 1 1 => Because of no correct answer from the servo => request to change ACK Policy in servo ROM to ensure getting responce
Info: sendPacket > Packet sent: ff ff a fd 3 f4 a 1 1 1 => Same with RAM
Info: sendPacket > Packet sent: ff ff b fd 3 c2 3c 34 2 0 0 => Send request to set 'torque' to 'free' et switch off the LED
Info: LED is off, torque is free
Info: sendPacket > Packet sent: ff ff a fd 3 c4 3a 35 1 4 => Send request to swith LED to red
Info: LED is now red
Info: Start moving to 45 degrees in 2 seconds, blue LED
Info: sendPacket > Packet sent: ff ff a fd 3 a0 5e 34 1 60 => Send request to switch 'torque' to 'on' et LED to green
Info: sendPacket > Packet sent: ff ff c fd 6 38 c6 b3 8b 2 8 fd => Send motion request
Info: sendPacket > Packet sent: ff ff 7 fd 7 fc 2 => Request the status
Info: receivePacket > Packet received: ff ff 9 fd 47 be 40 8 4 => Servo reply it has errors 'Invalid packet' with 'checksum error' (and so on until the end)
Info: sendPacket > Packet sent: ff ff 7 fd 7 fc 2
Info: receivePacket > Packet received: ff ff 9 fd 47 be 40 8 4
Info: sendPacket > Packet sent: ff ff 7 fd 7 fc 2
Info: receivePacket > Packet received: ff ff 9 fd 47 be 40 8 4
Info: sendPacket > Packet sent: ff ff 7 fd 7 fc 2
Info: receivePacket > Packet received: ff ff 9 fd 47 be 40 8 4
Info: sendPacket > Packet sent: ff ff 7 fd 7 fc 2
Info: receivePacket > Packet received: ff ff 9 fd 47 be 40 8 4
Info: sendPacket > Packet sent: ff ff 7 fd 7 fc 2
Info: receivePacket > Packet received: ff ff 9 fd 47 be 40 8 4
Info: sendPacket > Packet sent: ff ff 7 fd 7 fc 2
Info: receivePacket > Packet received: ff ff 9 fd 47 be 40 8 4
Info: sendPacket > Packet sent: ff ff 7 fd 7 fc 2
Info: receivePacket > Packet received: ff ff 9 fd 47 be 40 8 4
Info: sendPacket > Packet sent: ff ff 7 fd 7 fc 2
Info: receivePacket > Packet received: ff ff 9 fd 47 be 40 8 4

The most cautious of you – ones who read the servomotor documentation – would have noticed that the servomotor ID is not the same as in the program. This is simply because the servomotor has been configured differently.

I explained the most important packets as comments. Scroll to the right to see them.

1.7. Is it serius, doctor ?

My diagnosis in this case is that the serial link between Arduino card and servomotor is disturbed, and therefore the communication cannot be processed correctly. Remotly, it is difficult to say more…

1.8. Thank you for the thanks

The example presented is related to a discussion I had with students from an engineering school. They kindly sent me their project report in which they cited and thanked me. I can only thank them in return.

Laisser un commentaire

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *