SolidGeek / VescUart

An Arduino library for interfacing with the VESC over UART
GNU General Public License v3.0
177 stars 92 forks source link

Not working for VESC 4.12 #19

Closed AmanuelEphrem closed 4 years ago

AmanuelEphrem commented 4 years ago

I have connected VESC rx to my arduino's(arduino mini) tx and the VESC tx to my ardiuno's rx. When using this library, I keep on getting "Failed to get data!" in the serial monitor, even though everything is wired correctly ( I am running the getVescValues sketch).

For more info: I have made sure to change the baudrate in the vesc tool and in library code to 115200. I have configured the vesc tool to use both PPM and UART, so I can control the motor via ppm with the remote, but still get info from the vesc via UART.

SolidGeek commented 4 years ago

Have you updated the VESC firmware, and to what version?

AmanuelEphrem commented 4 years ago

Yes, I have the newest firmware. I believe it is 5.0,5.1 Screen Shot 2020-07-23 at 6 27 09 PM

SolidGeek commented 4 years ago

Did you use the development version of this repository?

AmanuelEphrem commented 4 years ago

Thank you very much for your responses! I have been using the master version, but I will now try to use the development version.

AmanuelEphrem commented 4 years ago

I just downloaded the development version, and I am still having my issue. I keep on getting "Failed to get data!" in my serial monitor. I am connecting my arduino micro to power via usb and connecting the rx on my arduino to the tx on my vesc, and the tx on my arduino to the rx on my vesc.

Maybe there is a problem with the way I have programmed my vesc? Has this library been tested with the newest vesc firmware? Thanks in advance!

AmanuelEphrem commented 4 years ago

I am also using hall sensors with my vesc. Could that be a problem?

SolidGeek commented 4 years ago

I have not tested it on the newest version of the VESC firmware, but all firmware newer than FW4.2 should be backwards compatible. Are you sure you connected it correctly? And which Arduino are you using?

AmanuelEphrem commented 4 years ago

I am using the Arduino micro. I am fairly certain that my Arduino is wired correctly because, as mentioned above, I connected the correct Arduino pins to the VESC :) Instead of printing the values, I used my serial monitor as the debug port, and I believe the Arduino is getting the correct values (look at the picture below). Does that mean there is a problem with accessing the values retrieved?

Screen Shot 2020-07-25 at 2 25 55 PM

AmanuelEphrem commented 4 years ago

I have also found that the tx pin of the vesc is sending up to 3 volts. Does that sound normal?

AmanuelEphrem commented 4 years ago

I have solved the problem!!! My issue was that I did not have a common ground between my VESC and Arduino. To solve this problem, I connected the ground pin from my VESC and connected that to the ground pin on my Arduino Micro. Thank you SolidGeek for all your help in troubleshooting and creating a wonderful library!