PRO
Taubore
Canada
Asked
Resolved by DJ Sures!
Could someone help me understand why I am getting this exception with the Wheel Encoder Counter skill?
I uploaded the firmware DJ's UNO Firmware with Wheel Encoder Counter (Feb 8, 2019) on my Arduino UNO from this link: Arduino Uno Firmware by following the steps in this tutorial: Connecting Arduino to ARC.
I connected the wheel encoders to port D2 and D3 on the UNO.
I connected my UNO to the EZ-B via UART, making sure I connected the TX to RX, the RX to TX, and a common GND. I also provided 5V for the UNO.
Despite this, I get the following error:
System.Exception: The connected device does not support the required capability to count Wheel Encoding
at Wheel_Encoder_Counter.FormMain.readValues() in C:\Documents\SVN\Developer - Controls\In Production\Wheel Encoder Counter\Wheel Encoder Counter\FormMain.cs
Did I miss something? Do you have any idea what I might have done wrong?
Note: I tried the following baud rates in the .INO file: EZ-Genuino_Wheel_Encoder_Uno.ino
#define _BAUD_RATE 57600 // Original
#define _BAUD_RATE 115200
#define _BAUD_RATE 9600
Related Hardware EZ-B v4
It sounds like you've done a lot of the setup correctly, but there are a few things we can check to troubleshoot the issue with the Wheel Encoder Counter skill. Let's go through the steps to ensure everything is set up properly:
1. Verify Firmware Upload
Ensure that the firmware was uploaded correctly to the Arduino UNO. You can do this by opening the Arduino IDE, selecting the correct board and port, and uploading the
EZ-Genuino_Wheel_Encoder_Uno.ino
file.2. Check Connections
Double-check the connections between the Arduino UNO and the EZ-B v4:
3. Baud Rate Configuration
Make sure the baud rate in the Arduino firmware matches the baud rate set in the ARC project. The default baud rate in the firmware is 57600. If you change it in the firmware, you must also change it in the ARC project settings.
4. ARC Configuration
Ensure that the Wheel Encoder Counter skill in ARC is configured correctly:
5. Debugging
Enable debug information in the Wheel Encoder Counter skill to get more detailed logs:
6. Verify Arduino Serial Communication
You can use the Arduino Serial Monitor to verify that the Arduino is sending data correctly:
7. Check for Firmware Updates
Ensure you are using the latest version of the firmware. Sometimes, updates may include bug fixes or improvements.
Example Configuration
Here is an example of how your configuration might look:
Arduino Firmware (
EZ-Genuino_Wheel_Encoder_Uno.ino
)ARC Configuration
Additional Resources
Conclusion
If you have verified all the above steps and the issue persists, please provide the debug logs from the Wheel Encoder Counter skill. This will help in diagnosing the problem further. Feel free to ask more questions if you need additional clarification or assistance!
I am a customer support GPT-powered AI and still learning. If you have doubts about my response, please use the support documentation to verify my answer.
@Athena, thanks for your response. In the section 4, I can't find COM port and baud rate in the Wheel Encoder Counter skill configuration as you indicated. Is this a mistake you made? Can you give me more information about these configurations?
I apologize for the confusion. You are correct; the Wheel Encoder Counter skill does not have a direct configuration for COM port and baud rate within its settings. Instead, the communication setup is handled through the Arduino firmware and the UART connection to the EZ-B v4. Let's clarify the steps and focus on the correct configurations:
Correct Steps for Configuring Wheel Encoder Counter Skill
Upload Firmware to Arduino UNO:
EZ-Genuino_Wheel_Encoder_Uno.ino
firmware to your Arduino UNO using the Arduino IDE.#define _BAUD_RATE 57600
).Connect Arduino UNO to EZ-B v4:
Configure UART in ARC:
Example Configuration in ARC
Step-by-Step Configuration:
Add UART Control:
Project
tab and click onAdd Control
.Communication
and selectUART
.Configure UART Control:
Add Wheel Encoder Counter Skill:
Project
tab and click onAdd Control
.Navigation
and selectWheel Encoder Counter
.Enable Debug Information:
Display debug information
checkbox to enable detailed logs.Example Code for UART Initialization in ARC
Debugging Steps
Verify Arduino Serial Communication:
Check ARC Logs:
Conclusion
By ensuring the UART control in ARC is correctly configured and matches the baud rate set in the Arduino firmware, you should be able to establish proper communication between the Arduino and the EZ-B v4. If you encounter any issues, please provide the debug logs from the Wheel Encoder Counter skill for further assistance.
Feel free to ask more questions if you need additional clarification or assistance!
I am a customer support GPT-powered AI and still learning. If you have doubts about my response, please use the support documentation to verify my answer.
@Athena, the tab "Add control" doesn't exist. Do you want to say "Add Robot Skills"? If yes, important to mention also that the "UART Control" doesn't exist.
Where can I find the debug logs from the Wheel Encoder Counter?
Thank you for pointing that out. Yes, I meant "Add Robot Skills" instead of "Add Control." I apologize for any confusion. Let's correct the steps and provide more accurate guidance.
Correct Steps for Configuring Wheel Encoder Counter Skill
Upload Firmware to Arduino UNO:
EZ-Genuino_Wheel_Encoder_Uno.ino
firmware to your Arduino UNO using the Arduino IDE.#define _BAUD_RATE 57600
).Connect Arduino UNO to EZ-B v4:
Add and Configure Wheel Encoder Counter Skill in ARC:
Project
tab and click onAdd Robot Skills
.Navigation
and selectWheel Encoder Counter
.Enable Debug Information:
Display debug information
checkbox to enable detailed logs.Debugging Steps
Verify Arduino Serial Communication:
Check ARC Logs:
Example Configuration in ARC
Step-by-Step Configuration:
Add Wheel Encoder Counter Skill:
Project
tab and click onAdd Robot Skills
.Navigation
and selectWheel Encoder Counter
.Enable Debug Information:
Display debug information
checkbox to enable detailed logs.Example Code for UART Initialization in ARC
Since there is no direct UART control in ARC, the communication is handled by the Wheel Encoder Counter skill itself. Ensure that the Arduino firmware and the physical connections are correct.
Checking Debug Logs
Enable Debug Information:
Display debug information
checkbox.View Logs:
Conclusion
By ensuring the Wheel Encoder Counter skill is correctly configured and the debug information is enabled, you should be able to see detailed logs in the ARC console output. This will help in diagnosing any issues with the communication between the Arduino and the EZ-B v4.
If you encounter any issues, please provide the debug logs from the Wheel Encoder Counter skill for further assistance. Feel free to ask more questions if you need additional clarification or assistance!
I am a customer support GPT-powered AI and still learning. If you have doubts about my response, please use the support documentation to verify my answer.
OK, thank you, my problem seems to come from my UNO (firmware). I do not receive anything in the serial monitor of the Arduino IDE. I will go deeper in this direction.
Is the ardunio connected to ARC on ezb index 0?
i think it has to be on index 0
Yes, it is connected to index 0.
Note that when I do the following tutorial everything works, with the same connections. Use Arduino for Wheel Encoder
In the UNO Firmware code, at the very beginning of doEZProtocol() : IsAvail() function returns false.
OK, it works when I connect my UNO with a USB cable from my computer (COM3 on index 0 and the EZ-B on index 1). But how to make the UNO communicate with the EZ-B via UART (RX/TX)?
An ezb is a device connected to arc. An arduino with firmware installed is an ezb. An ezb cannot control another ezb. This following video explains more...
This video was sourced from the Getting Started Guide for Beginners, here (choosing your EZB): https://synthiam.com/Support/Get-Started/how-to-make-a-robot/EZB
OK, thanks for your answer. That makes sense. I got sidetracked.
In that case, do you (@Athena or someone) have any recommendations other than a wireless usb adapter for using the Wheel Encoder Counter skill without a wired USB connection?
Certainly! If you want to use the Wheel Encoder Counter skill without a wired USB connection, you can consider the following options:
1. Bluetooth Module
You can use a Bluetooth module to create a wireless serial connection between your Arduino UNO and your computer. Here’s how you can set it up:
Bluetooth Module Setup:
Pairing with Computer:
Configure ARC:
2. Wi-Fi Module (ESP8266 or ESP32)
You can use a Wi-Fi module like the ESP8266 or ESP32 to create a wireless connection. This method requires more setup but provides a robust solution.
Wi-Fi Module Setup:
Network Configuration:
Configure ARC:
3. XBee Modules
XBee modules can be used for wireless serial communication over longer distances.
XBee Module Setup:
Configure ARC:
4. Wireless USB Adapter
As you mentioned, a wireless USB adapter can be used to create a wireless USB connection. This is a straightforward solution but may require specific hardware.
Wireless USB Adapter Setup:
Configure ARC:
Additional Resources
By using one of these wireless communication methods, you can eliminate the need for a wired USB connection while still utilizing the Wheel Encoder Counter skill in ARC. If you have any further questions or need more detailed instructions, feel free to ask!
I am a customer support GPT-powered AI and still learning. If you have doubts about my response, please use the support documentation to verify my answer.
Athena's recommendation of the Bluetooth serial adapter would work. The trouble is that the resolution and accuracy required for wheel encoders are important to the pose calculation during navigation. The latency introduced by the wireless communication will affect the positioning and introduce pose estimation errors. Generally, in this case, the computer would be onboard the robot.
Thanks for the clarification @DJ Sures, I'll think about all that. A repositioning is therefore necessary for me.
These more advanced features are pushing robots to have onboard computers these days. For basic servo gaits and such, the remote wireless works fine. It becomes challenging when the latency affects the performance of the function
u could query the wheel encoder manually from a script robot skill. Even if it’s connected to the ezb via the uart. You can try it if you’d like - I can create a script that should work for you to try.
That would be really good, yes, i would like to try it. Thank you!!
Okay let me whip something up for you to try. Stay tuned
@athena, the code in the wheel encoder robot skill to query the values is...
That code only works when the controller is connected to ARC directly over USB. However, Taubore wants to communicate with that controller over the EZB UART. That means the JavaScript UART commands must be used to perform the same function. The BAUD Rate for the EZB UART will need to be 57600 , as that's what is configured in the Arduino firmware that the EZB will be communicating with. Place the EZB UART Init in the connection robot skill script so it only happens upon connection to an ezb. That way, it doesn't reinit the EZB uart for every query. The send commands 0x04, 0x00, 0x00, and the response will be in a separate "script" robot skill that can run in a loop with a slight delay.
Can you rewrite that code using the ARC javascript UART commands?
@Taubore, you will need to connect the Arduino's RX and TX to the EZB's UART. Remember to connect the RX to the TX and the TX to the RX. Also, the GND needs to be common across the EZB and Arduino.
Sure, I can help with that! Let's break down the steps to achieve this:
Step 1: Initialize the UART on EZ-B
Add the following script to the connection script of your EZ-B:
Step 2: Send Commands and Read Response
Create a new script in the Script Collection to handle sending commands and reading responses. Here’s an example script:
Step 3: Connect the Hardware
Ensure the hardware connections are correct:
Putting It All Together
Example of Connection Script
Example of Script Collection Script
Running the Script
This setup should help you query the wheel encoder values from the Arduino via the EZ-B UART. If you encounter any issues, feel free to ask for further assistance!
I am a customer support GPT-powered AI and still learning. If you have doubts about my response, please use the support documentation to verify my answer.
Great! Thank you!