You are here

VESC with Raspberry Pi 3

10 posts / 0 new
Last post
Antonio Rodrígu...
Offline
Last seen: 6 years 4 months ago
Joined: 2018-05-24 17:11
Posts: 4
VESC with Raspberry Pi 3

Hi everyone,

I am trying to control two VESC modules with a Raspberry Pi 3, however, I can't seem to connect them. 

I started with just one, and when running the command lsusb (I'm working on Ubuntu Mate 16.04.2) the RPi doesn't seem to find the VESC.

The VESC I am using (a version 6) I already tried on my Windows 10 laptop and there it worked fine. Its firmware is updated (3.38) and I even did the motor setup and was able to control the motor with the arrow keys.

Another strange thing I noticed is that after connecting to the RPi (which didn't find the VESC) my laptop doensn't find the VESC either (it shows a warning saying it doesn't recognize the USB device). It was working 5 minutes earlier, and right after trying on the RPi, my PC just doesn't find it... 

If anyone has any idea what the problem may be or any advice it will be much appreciated! :-)

Regards!

Antonio

iscle
Offline
Last seen: 5 years 5 months ago
Joined: 2018-05-02 17:32
Posts: 18

Hi!

Have you tried: 

- Using another USB cable

- Rebooting the VESC

- Rebooting the computer

- Another computer

 

Most of the times I had that problem happen with other devices was just a faulty usb cable... If it still doesn't work after doing all of above, you could try reflashing the VESC with an STLink v2 programmer.

Antonio Rodrígu...
Offline
Last seen: 6 years 4 months ago
Joined: 2018-05-24 17:11
Posts: 4

Hi and thanks for your response!

The USB cable is the same one I used when doing the initial set-up with VESC tool and it worked fine, so I don't think that would be the problem... Plus it's a good cable (my Oneplus One's data/charging cable)...

I'm quite sure I did reboot the computer, but I'll check again. And if by rebooting the VESC you just mean powering it off and back on, yes I did do that.

If it still doesn't work I may have to try reflashing it, because the Raspberry Pi didn't show any sign of finding it at any point whatsoever...

Regards and thanks again!

 

Antonio

iscle
Offline
Last seen: 5 years 5 months ago
Joined: 2018-05-02 17:32
Posts: 18

How are you powering the VESC? With a battery pack or from a power supply? And at what voltage?

Antonio Rodrígu...
Offline
Last seen: 6 years 4 months ago
Joined: 2018-05-24 17:11
Posts: 4

With a power supply. I've tried both with 10 and 12 V.

Antonio

iscle
Offline
Last seen: 5 years 5 months ago
Joined: 2018-05-02 17:32
Posts: 18

Maybe the power supply has too much ripple and the microcontroller doesn't like it, or there is a ground loop which somehow interferes with the communication. If you are using a laptop, try running it on batteries instead of plugged in to the mains and see if that changes anything... 

If it still doesn't work then I'm out of ideas, maybe someone else can help you, if not then you can try reprogramming it with this tool: 

https://www.ebay.com/itm/ST-Link-V2-Programming-Unit-mini-STM8-STM32-Emu...

Antonio Rodrígu...
Offline
Last seen: 6 years 4 months ago
Joined: 2018-05-24 17:11
Posts: 4

Hi!

I tried reflashing with the STLink Utility and I get the blue and the dim green light, but still, when I connect the VESC I get the same notification in my laptop saying it doesn't recognize the connected USB device. I'm clueless as to what to do, any ideas?

Thanks for your help.

Antonio

iscle
Offline
Last seen: 5 years 5 months ago
Joined: 2018-05-02 17:32
Posts: 18

If you get the LEDs to light, then the VESC is most likely working good. If the VESC is homemade, then it might be due to a bad solderjoint in the USB port resistors. If it's a "professionaly" manufactured VESC, then it could also be a bad solderjoint in the USB resistors or a wrong value resistor. If it's a wrong value resistor, then you might be lucky and it might work on other computers.

 

I don't know if this is possible, but you might be able to program the VESC using an USB to Serial converter and hooking it up to the UART pins in the VESC with 115200 baud rate. If you have an arduino nano or similar, you can use the integrated converter and then in VESC tool you should be able to select the right COM port. However, I've never attempted this.

TechAUmNu
Offline
Last seen: 1 month 2 weeks ago
Joined: 2017-09-22 01:27
Posts: 575

I just had some weird issues with a random usb cable i was using where the vesc was turning on and off constantly, changed cable and it started working correctly. I would try a few different cables, some have resistors in them to tell a usb port they are a specific device and it do weird things.

ShortCircuit
Offline
Last seen: 3 years 3 months ago
VESC Original
Joined: 2017-08-16 12:55
Posts: 15

I just wanted to add I've had issues with usb 3.0 ports and when i switch to usb 2.0 everything works great.