After finishing the installation of the ROS packages on the Jetson RACECAR, we need to program the VESC, an electronic speed controller, for use in the Jetson RACECAR. Looky here:
As discussed in Part 3 – ESC Motor Controller, the TRAXXAS steering servo and the drive motor Electronic Speed Controller (ESC) are controlled by PWM signals sent from an on board radio receiver.
For the Jetson RACECAR, we replace the stock TRAXXAS ESC with a Vedder Electronic Speed Controller (VESC). The major reason for the change is to gain full control at low speeds. The stock ESC puts the minimum vehicle speed at around 6 mph. Another reason is that the VESC is open source, which allows the curious to explore the motor controller implementation.
Architecturally, the VESC has a STM32 ARM Cortex processor. The STM32 runs ChibiOS, a real-time operating system. The default firmware flashed on the VESC-X is ‘Servo-in’, which allows a remote controller to set the motor speed. For the Jetson RACECAR application, the VESC servo port needs to be programmed as ‘Servo-out’, which allows commands to be sent to the robot steering servo.
Fortunately there is a compiled binary of the version of the VESC firmware that includes the Servo-out setting. We can flash the STM32 directly from the Jetson using a program called ‘bldc-tool’. BLDC is an acronym for BrushLess DC motor.
Note: There are also compiled versions of the bldc-tool for x86 machines, if you prefer that route.
Once the bldc-tool loads the servo-out firmware on to the VESC, we then load a configuration file which matches the VESC configuration to control a TRAXXAS Velineon 3500 motor.
Note: The actual VESC firmware is available in binary form in the bldc-tool firmwares directory. If you are interested in building the VESC firmware from source, you can compile it from the bldc firmware source tree on Github.
The VESC is wired to the Jetson using a micro USB to USB-A cable. The USB cable normally communicates motor speed and steering angles between the Jetson and the VESC. The TRAXXAS steering servo is wired to the VESC servo header. In this application, a 90 degree, 3 pin female header helps with the wiring.
The JetsonHacks account on Github contains a repository named installBLDC. To build the bldc-tool:
$ git clone https://github.com/jetsonhacks/installBLDC
$ cd installBLDC
This will build the bldc-tool and download the RACECAR motor configuration files. The RACECAR motor configuration files are downloaded from the Github mit-racecar repository, and are stored in ~/hardware/vesc.
Before starting the bldc-tool, connect the VESC to the vehicle battery. Then:
$ cd ~/bldc-tool
This will bring up the GUI to interact with the VESC. Before flashing the firmware, hit the ‘Connect’ button to communicate with the VESC. The VESC should be at ttyACM0 (more formally, /dev/ttyACM0). The current firmware revision will display in the lower right hand corner on connection.
Use the ‘Firmware’ tab to flash the firmware binary, the configuration can be loaded from the ‘Load XML’ button. Important Note: You must select the correct version of firmware to match the VESC that you are using, otherwise damage and other bad things can happen. In the video, we flashed the firmware ‘VESC_servout.bin’ for version 4.12 of the hardware.
The configuration file is located in ~/hardware/vesc. The configuration file shown in the video is ‘6.141_bldc_VESC_X_hw_30k_erpm.xml’ which is for the VESC-X. If you are using a regular VESC, you will probably want to use the configuration file ‘/6.141_bldc_old_hw_30k_erpm.xml’.
Note: You should use the updated bldc configurations, the configurations lower the min and max erpm values to avoid damaging the VESC when connected to the TRAXXAS motor.
Once the firmware and configuration files are in place, the Jetson RACECAR is ready for teleoperation. The game controller used in the video is a Logitech Gamepad F710.
The Logitech F710 connects to the Jetson over a wireless USB dongle. The dongle should be plugged into the USB Hub which is connected to the Jetson. In order to connect to the Jetson, power the F710 on (using the center button labeled ‘Logitech’). You can press the ‘VIBRATION’ button to tell if the F710 is powered on. The ‘VIBRATION’ button should cause the game controller to rumble in your hand.
In order for the Jetson to recognize the F710, the small switch on the back of the game controller must be in the ‘D’ position. If the game controller is in the ‘X’ position, it will not be detected.
Once connected, the game controller should show up as /dev/input/js0
The F710 has two modes, selected by the button labeled ‘MODE’. The correct mode for the Jetson RACECAR is the one which the left joystick controls axis 0 and 1, and the right joystick controls axis 2 and 3. There is an LED next to the MODE button. If the LED is green, then it is in the wrong mode, the light should be off.
You can test a game controller to make sure it is working with the Jetson using the jstest program.
$ sudo jstest /dev/input/js0
Note: jstest is located in the joystick debian package. If it is missing you can install it:
$ sudo apt-get install joystick
Once the game pad works, you can teleoperate the robot. Make sure that the wheels are clear of any obstructions.
$ cd racercar-ws
$ source devel/setup.bash
$ roslaunch racecar teleop.launch
The robot has a deadman switch, the upper button (labeled LB) on the left horn of the game pad. Holding the deadman button, you can control the throttle with the left joystick, and the steering with the right joystick.
At this point, we have a working robot platform. We’ll have a couple of more articles on the Jetson RACECAR. As we go forward, we will build the final prototype hardware platform, which we are calling RACECAR/J.
Great project Jim. Thank you for your efforts on this. When do you expect to issue a BOM?
Currently we’re working with suppliers for the custom parts such as the deck platforms, wiring, and a version of the VESC that has the proper bullet connectors. We’ve been through a couple of revisions, getting closer. The idea is that you’ll be able to buy the custom, long tent pole items as a kit. This should cut down the amount of time needed to wrangle the long lead time items. There also won’t be a need to do soldering. There are options beyond that, such as a kit of everything needed to build the robot and a fully functioning robot. Once the parts have been specified, we’ll be able to create a BOM. Thanks for reading!
Thanks for all the time and effort you’re putting into these. I’m following along with every article and currently working on my own RACECAR build. I’ve found that the VESC-X can take a while to obtain, so i’m thinking of just buying the original VESC and using that (as you did in your earlier prototype). Will i have any trouble following along with this video installing the software and drivers on the older VESC model?
The software is the same, the only difference in the install is that you should select a different VESC configuration file from the MIT RACECAR repository: 6.141_bldc_old_hw_30k_erpm.xml
I hope you can share your build with us! Thanks for reading!
How did you know you were flashing the proper firmware version? I’ve been looking through the BLDC firmware github, but that’s mostly information about compiling my own firmware from source (as you pointed out). I’d just like to know what VESC models match up with which firmwares provided with the BLDC tool install. Are you sure the firmware you used will work on the original VESC model?
Not quite sure what the question is. If you look in the firmware directory of the BLDC tool:
There are versions that match with each version of the VESC hardware. The VESC-X, for example, is hw 4.12, so I looked in the hw_410_411_412 directory. There is a default version, which works with any of the 4.10 to 4.12 models. There is a version for what looks like a resistor substitution. There’s one for the servo-out. The normal setting for the VESC is Servo in, as the long boarders use wifi/bt controllers to control the motor speed. Servo out is for controlling a servo from the VESC. I don’t know what the 2811 version does, but I’m sure it’s in the forums somewhere. So am I sure? Nope. If I was making a moon shot, then I would research more deeply. But an educated guess after reading the VESC forum leads me to believe that works. When I flashed a VESC, it works. Is it absolutely 100% correct. Dunno.
Just my two cent here. I once built my own Ambilight device. I used RGB addressable LED strip, where you have full control for every pixel in that strip. They came with variety of IC chips. One of them is ws2811. Mine was ws2812b.
I think Vedder add those .bin because he can connect the nunchuk and the ws2812 LEDs directly without any external microcontroller and with a minimal amount of external components.
Cool, that’s what the WS2812 is for. Here’s a video:
Headlights, turn signals, tail lights. I wonder if anyone has ever used lights on cars like that before? Thanks for the info!
I’m currently doing the work for a company i’m interning for, i’ll run it by and if it’s okay with them i would love to share! We’re still early in the build now but as we get closer to a working car (provided i get the proper permissions) i’d be happy to share our progress with you What is the best way to get in touch with you? Via youtube/article comments or the “Contact Us” portion of your website?
‘Contact Us’ works
Great project. How are the game pad commands routed from TX1 to VESC? Does the bldc-tool have game pad support, or do you have a custom communication over USB for this?
The Logitech Gamepad F710 has a wireless dongle that plugs into the USB hub. It’s pretty painless. An alternative is to use a Bluetooth controller and pair it to the Bluetooth onboard the Jetson. The Jetson reads the Gamepad controller as input, and the outputs to the VESC over USB throttle and steering commands. Thanks for reading!
Thanks! How is the USB communication done exactly? Using libusb sending the VESC commands directly? Is there a pointer to this part of the code?
You should read through the VESC code at: https://github.com/mit-racecar/vesc
It’s all intertwined with ROS, which isn’t nearly as straightforward as just using a simple library to talk to a hardware device.
Also, is there a pointer to the C source code diff/changes to make VESC firmware servo output instead of input?
Concerning the C code – if to follow the link that it is possible to read comments of the VESC developer about Servo and the required changes ON. in one of messages the compiled file for a zaguzka in VESC is enclosed.
Thanks. In a nutshell, you need to recompile bldc firmware using SERVO_OUT_ENABLE 1 in conf_general.h .
In addition, you need to replace the resistor in R5 to a lower value, say 100 Ohm.
In the cars that I have built, there haven’t been any issues using the servo with the stock resistor value. MIT has not recommended any changes, they’ve built several cars. However, that doesn’t mean changing out the resistor is a bad idea.
I don’t see the ttyACM0 port through BLDC tool for some reason and cannot connect to VESC. It does work on ubuntu 16.04 and Windows on my laptop but not on my TX2 (I work through ssh with X forwarding if that is of any relevance, and I added my user to the dialout group). Maybe you have an idea, or at least could post the output of “lsmod” command run on your TX2 here?
I forgot to add, I see the VESC on TX2 when I run lsusb, that’s confuses me the most.
The stock NVIDIA Jetson TX2 on version L4T 27.1 does not have ACM support enabled by default. You will need to modify the stock kernel to add that module, or build it into the kernel itself. The next version of L4T is scheduled to be released soon, I do not know whether ACM support was added.
As I recall, the configuration is:
USB Modem (CDC ACM) support
Abstract Control Model (CDC ACM)
If it’s any consolation, it took me a while to figure out what the screw was going on. Good luck!
Thanks a lot! That explains. I saw your video on updating the kernel but somehow missed what was the reason for updating it. I’ll try to update the kernel.
The kernel rebuild was just for instructions on how to do rebuild onboard the Jetson TX2. I was using the VESC for the first time on the TX2 last week, and discovered the issue. Simple enough to fix, but a little frustrating that something that standard was missing out of the kernel build.
Thanks for your answer. I have successfully built a new kernel with cdc-acm support enable with the script you provided and was able to connect the VESC. However, I encountered another problem — TX2 does not detect the game pad (the same as in your video). I suspect it’s a driver issue again, maybe you have a solution for this one as well? There is very little information about these things out there, and your website is pretty much the only source. Thanks for running it!
You’re welcome. I’m glad you got the VESC to work!
The Jetson TX2 needs to have the JOYSTICK modules built into the kernel image for the Logitech Gamepad to work.
I think it’s JOYDEV and CONFIG_INPUT_JOYSTICK
Make sure to build them as part of the image, you may encounter issues if they are added as modules. If you’re using make xconfig, you can do a Find on JOYSTICK and both should come up, though they will have a more descriptive name. Next, click on the option. The first option is to build it as a module, the second is to build it into the image. Make sure to save it after editing, build the new kernel, then install it. Good luck!
Any Update on this Case? I have the same issue with my jetson tx2. I am not able to connect with the gamepad Logitech F710 controller. The sudo jstest /dev/input/js0 is not successful although i run sudo apt-get install successfully.
After you plugged in the USB dongle for the Logitech, what is the result of
i detects the logitech F710 gamepad as Device
Ok, got it to work now be updating kernel image. Thank you very much.
Great! I’m glad you got it to work.
I am trying to run a Traxxas Velineon 3500 Motor and VESC-X combo. Could you please confirm that by “updated bldc configurations” you meant the “6.141_bldc_VESC_X_hw_30k_erpm.xml” file? I loaded this config file and the BLDC-Tool failed to detect the motor.
Below is a quote from above.
“You should use the updated bldc configurations, the configurations lower the min and max erpm values to avoid damaging the VESC when connected to the TRAXXAS motor.”
That is the correct file. What version of L4T are you running? If you are running L4T 28.1 (JetPack 3.1), then you need to build the ACM module so that ttyACM is available.
I am running L4T 28.1 ( JetPack 3.1 ). I had to build the ACM module for the VESC and the CP210X module for the RPLIDAR. Thanks so much for your super fast response Jim!
Glad you got it to work. I hope you can share your project with us. Thanks for reading!
Will do. Thanks again Jim!
We successfully installed the TX2 on your video at https://jetsonhacks.com/2017/06/06/scanse-sweep-lidar-software-install/ but after running $ roslaunch racecar teleop.launch: Error connecting to Hokuyo: Could not open network Hokuyo: 192.168.0.10. We tried a lot of ways but it still does not work.
The teleop.launch file is for a Hokuyo UST-10LX (the MIT RACECAR configuration). You will need to modify the launch file for a Sweep ROS package.
The problem has been solved with your help, your video is very useful to us, thank you very much for sharing.
I am glad you got it to work!
Thanks for all your work!
I have set everything up and everything works perfectly except for one thing.
There is no steering control. With jstest I can execute and observe the servo command values from the F170 and when I plug the Servo in the wheels line up straight, but it seems nothing is being communicated from Focbox to the servo itself.
Just to add, the throttle works like a charm.
Is it possible to use a XBox Game controller to replace Logitech Gamepad F710?
My car currently does not have the IMU and LIDAR. Can I run the tele-operation?
When I ran “roslaunch racecar teleop.launch”, it complained could not find IMU and LIDAR. When I tried the gamepad, the car did not give any response.
Does the joystick actually connect to the car? Did you run the joystick test mentioned in the article?
The IMU and LIDAR probably don’t make a difference, though you may have to check the UDEV rules to make sure the VESC is seen.
I went through this before I got my IMU and LIDAR.
You can simply comment out the LIDAR and IMU in the teleop launch file, it should suffice.
Also be sure to echo the /joy topic, just to make sure its communicating.
When I type
rostopic echo /joy
I got the following print-out:
axes: [-0.0, -0.0, -0.0, -0.0, -0.0, -0.0]
buttons: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
When I ran the joystick, I can see “nsecs”, “axes”, and “buttons” changes.
However, the car did not give any response
I tried running teleop without the IMU and Lidar. I commented out the argumennts in the launch file, but now Im getting: ERROR: cannot launch node of type [vesc_ackermann/ackermann_to_vesc_node]: can’t locate node [ackermann_to_vesc_node] in package [vesc_ackermann]
Am I commenting the right things in the right places or is there more that I need to do?
Thanks, how can I “echo the /joy topic”?
whilst everything is (or at least should be running from your perspective), that is once you’ve run teleop.launch, you can open a new terminal and type:
$ rostopic list
This will show a list of active topics. I believe it is the /joy topic (it may be somehting else, it’s been a while and I’m not 100%. You can perform some deductive reasoning to figure out which one.
You then can enter:
$ rostopic echo /joy
or replace joy with whatever topic should be communicating the data from the joypad to the ackermann nodes.
If you see a string of values as you meddle with the joypad, then you know its connected and communicating.
You can do the same thing for nodes:
$ rosnode list
$ rosnode info /X
X being the node you wish to investigate.
I just read your prior comment.
You did it correctly. Now press buttons on the joypad whilst echoing and see if it gives any data variables.
Thanks a lot for your comments.
I think the joystick is communicting with the Jetson TX2 since I could see “nsecs”, “axes”, and “buttons” changes.
However, the car still did not response. Do you know what I should check?
Is there a way we send directly movement signal to VESC? for Example, can we use BLDC tool to force the car to move?
I found actually that I could use Gamepad to control the steering. That means the Gamepad is working fine. But the motor did not have any response. I also measured the output voltage between the three output wires from VESC, the reading is about 3.5v. I am now suspecting that my car’s motor is bad.
The original VESC has three input wires with blue, yellow, and white color. But FOCBOX output wires are all black. Could you please let me know how you connect the 3 wires?
What is the voltage of the battery you are using? It should be at least 8V.
Do the wheels turn when you use the game pad controller?
The wires can be connected from the VESC in any manner. If the motor runs in the opposite direction than desired, switch any two of the wires.
I am using a 8.4v battery.
I noticed that the battery can reach only 7.9v after 12 hours charge with this charger
I also noticed that on Amazon, most of the battery for RC cars is 7.4v. Do we really need 8v for this car?
The VESC is programmed for a 8.0V cutoff. If the battery voltage drops below 8.0V then the VESC will not send current to the motor, and the motor will not run.
A properly charged battery is well over 9V.
I do not know what you mean by “Do we really need 8V for this car?”
Here is the manufacturers recommendations: https://traxxas.com/products/models/electric/6804Rslash4x4platinum
If you want to run outside of those parameters, you will need to modify the vehicle accordingly.
I used another battery which showed about 9v after charge. However, the motor still did not move. I could hear some click sound, but the wheels did not roll. I have put a video on youtube: https://www.youtube.com/watch?v=O0eDD4SOHlM. I could steer the car in the first half of the video. In the second half, I was trying the control the motor.
Did you hold down the safety button on the controller? Are you using the Logitech game controller?
I found the issue. I loaded the wrong config file to VESC. After I loaded the correct one, the car can be controlled by the gamepad.
Thank all of you for your help.
Good to hear you got it to work!
Hi，My vesc has a same question as your vesc.Can u tell me how to deal with this question？What is the correct files ？
Good to know you got it working!
On a side note, does anyone know of any autonomous algorithms I can run on this?
I’ve tried tweaking nav2d, navigation_stack and also, most recently, the Formula1Epoch that is found on the nvidia github.
I’m not having much luck and would really like to see it functioning autonomously.
The Formula1Epoch seems like the most promising, with almost everything in alignment with the JetsonHacks iteration, but algorithmic output just doesn’t seem to be happening.
Any input or guidance would be hugely appreciated!
I am not there yet so I do not know how to answer you questions. However, I have one question which should be easy to answer… (I do not know ROS yet)
I would like to build a ros node that
1. Read some numbers from a file
2. Use the numbers as steering and acceleration, broadcasting them
3. VESC node received these numbers and drive the car
Could you please give me some directions that I can start to learn and work on?
You should start by reading this book: Programming Robots with ROS: A Practical Introduction to the Robot Operating System
It is available on Amazon: https://amzn.to/2HVxuhQ
The hardware of my vesc is 4.12 and the firmware of my vesc is 2.18.Now I follow the tutorial in this article,using “6.141_bldc_VESC_X_hw_30k_erpm.xml” file.But the moto does not run.My car and moto are the same as jetson’s racecar.I don’t know why.Should I detect my moto through bldc_tool in the first?
Thanks very much!
What is the voltage of your car battery?
My voltage of my racecar battery which connect my vesc is 40C 11.1v and 5000mah.And I have another battery which connect nvidia tx2，the voltage of this battery is 12v.
Should I change the parameter in “6.141_bldc_VESC_X_hw_30k_erpm.xml” file？
Thanks for your reply ：）
You need to measure the actual voltage of the battery connected to the VESC. The actual voltage needs to be greater than 8V.
My vesc can control my moto sometimes,but it is not very stable.I can ensure the actual voltage of the battery higher than 8V.I use my joystick to control vesc,sometimes my moto can run for a little time, and sometimes the vesc flash red flights 4 times.So I do not know why :(.
Thanks for your reply!:)
The 4 red lights flashing usually means that the VESC has a hardware error issue. The 4 red lights also flash when the unit first boots up, so it could also be a loose connection. Does the steering work?
Yeah,I can use the vesc to control servo.And I just changed another vesc,it also can not control the moto,but when I use my joystick,the green lights will flash.I think this is a symbol of receiving message,right?
So Should I change the xml files?
Are you holding down the dead man switch on the game controller when you use the throttle?
No,I only switch on the one button to control my moto and another button to control my servo.I use the ligitech joystick to control those things.
The robot has a deadman switch, the upper button (labeled LB) on the left horn of the game pad. Holding the deadman button, you can control the throttle with the left joystick, and the steering with the right joystick.
Also, the game controller must be in the correct mode. Please refer to the article.
I can control my moto,but it sometimes make some errors.I have put a vedio on the youtube: https://youtu.be/6zU_2vkvMF8 .
What is wrong with this vesc or moto?
You are not using a FOCBOX or VESC-X. You are using one of the original specification VESC 4.12. You should use the configuration file:
Thanks for your reply!:)
And I want to know how to distinguish VESC and VESC-X.The hardware of my vesc is 4.12 and the firmware of my vesc is 2.18.
The VESC-X is shown in the picture above. It is square and is in an enclosure. The VESC that you are holding in your hand is a VESC.
I’m building a Racecar and I have to buy a VESC for it. I’m quite confused because there are several manufacturers and different versions of the hardware. Do you have an advice on which VESC to buy, considering that shipping time to Europe is a concern for our project? VESC from Maytech seems widely available, are they appropriate for the racecar? I’ve seen also VESC from Focbox, but with less availability and slightly higher price.
Thanks for your help!
I have the exact same Logitech F710 Gamepad, but I’m getting different results from this video.
The video shows the X-AXIS of the right joystick controlling the Steering, but on my system the Y-AXIS of the right joystick controls the steering. It’s a little hard to steer when the up/down motion controls the steering.
Any thoughts as to where I went wrong?
Here is how I have things setup
Mode is set so the green light is off
The switch on the gamepad is set to D
Here is the results of JSTEST
Axis 0 -> Left Joystick X-AXIS
Axis 1 -> Left Joystick Y-AXIS
Axis 2 -> Right Joystick X-AXIS
Axis 3 -> Right Joystick Y-AXIS
Axis 4 -> GamePad X (binary on/off as expected)
Axis 5 -> GamePad Y (binary on/off as expected)
You have not done anything wrong. I believe that I may have switched the axis values for the demonstration in the .yaml file.
Hi all. I try to make the VESC work with the Velineon 3500 motor of the Traxxas Slash. I can’t get it detected by VESC Tool. It spins three times, and then it says “Detection failed”. I first loaded the configuration file 6.141_bldc_old_hw_30k_erpm.xml, and then launched the motor detection in BLDC mode. Amongst all the attempts, it managed to detect the motor once, but then when I tried to control the motor, it was shaking instead of spinning.
I also tried with bldc_tool instead of the new Vesc Tool. Same result: bad detection.
One more info: my VESC is a 4.12 hardware.
I have not seen the Velineon motor work with the bldc tool. I just use it to flash the firmware and set the configuration. After that, it works fine with the Jetson. Thanks for reading!
The BLDC tool detection works better if the motor is not driving the wheels: you can release one screw and rotate the motor so it runs freely, then do the detection and move the motor back and fix the screw.
Interesting. Come to think of it in the videos that I have seen of the bldc tool in action, the motors are generally not connected to a load. That is, the motors are just free spinning.
I’ve completely unmounted the motor, and tried detection with no load. It still does not work.
That is odd, I could run the detection just fine, both in BLDC and FOC mode, with and without sensors. I added an option for the AS5407 magnetic encoder, with magnet glued onto the axis at the back of the motor for better startup and position control to drive at ultra low speed. See this low-speed video: https://www.youtube.com/watch?v=LiCFY123Jw0
Thanks for your reply. Do you remember which parameters you used for sensorless detection? Maybe I need to change something (intensity, duty cycle, rpm, or other)?
After some more attempts, I’ve managed to get the motor detected by the VESC! I had first to upload the XML configuration from MIT project to the motor, upload this configuration to the VESC and then run detection. It doesn’t work every time, but sometimes it does.
But after that, when I use the arrow keys, the motor shakes instead of spinning. Did I miss something?
I’ve made two videos: first one is successful detection (still shakes at the end, I don’t know if it is the expected behaviour), second one is an attempt to spin the motor with the arrow keys from VESC Tools.
Thanks again for your help.
Just to let you know: I’ve finally managed to get my motor running with the VESC. I had to change the hardware. My first VESC was probably faulty.
The motor runs well in FOC mode. I still have some difficulties making it spin smoothly in BLDC mode.
It is good to hear that you got it to work! Faulty hardware is never fun.
I would like to thank you all. With the help of JetsonHacks community, we have won the Toulouse Robot Race yesterday (no obstacles category), and got a second place in the obstacles category.
Our racecar did not have any lidar or telemeter. It relied only on its camera for detecting the track and obstacles. It also used a gyroscope and tachometer from the VESC.
Here is a short video:
Congratulations! I am glad that you found the articles here useful, and that you found the community helpful in bringing home the gold.
Hi, Many thanks for this tutorial, I have almost got everything setup. Can I use ps3 joystick instead of Logitech Gamepad F71? I am using ps3joy ros node, seems vesc is not doing anything although I get signals of the joystick keys. I was wondering maybe I need to remap keys or maybe it is not possible at all?
You’re welcome. I don’t have any experience with the PS3 joystick. You can check with jstest to see if you are getting input:
$ sudo jstest /dev/input/js0
There is a ‘dead man’ trigger, which you may need to remap on the PS3 to match the F710. On the F710 it is ‘LB’, which I believe maps to button 4 in jstest.
Thanks for your reply after remapping a deadman button I could get some signal on servo, still struggling with the motor running. would you suggest that F710 is much more smooth and out of the box for running the motor? my goal is to drive the car around a test track while collecting steering and speed data
You should check the voltage on your car battery. If you are using the configuration file, the voltage cutoff to the motor is ~ 8V.
I checked the voltage on the car battery it is 7.7V, however, I could not run the motor still. I am not sure whether the problem arises because of joystick or ampere that runs via FOCBOX Vesc. any tips to diagnosis this problem is appreciated!
Did you charge the battery? What is the battery voltage after charging? The battery voltage needs to be over 8V. Anything less than that the VESC will not send any current to the motor.
To charge the bettary you need to push the “blue” button on the charger. After that you should be able to hear some sound. If you don it press the blue button, it will not charge.
I’ve managed to install the car and get it running on the teleop, but after a while it freaks out and shows the following error :
terminate called after throwing an instance of ‘serial::IOException’
what(): IO Exception (5): Input/output error, file /tmp/binarydeb/ros-kinetic-serial-1.2.1/src/impl/unix.cc, line 485.
[vesc/vesc_driver-13] process has died [pid 28388, exit code -6, cmd /home/nvidia/racecar-ws/devel/lib/vesc_driver/vesc_driver_node __name:=vesc_driver __log:=/root/.ros/log/c58cda54-464d-11e9-aec9-00044ba8419b/vesc-vesc_driver-13.log].
I had a look at the log file but all it’s saying is it’s clipping the speed command value:
[ INFO] [1552563547.845644272]: Connected to VESC with firmware version 2.18
[ INFO] [1552563551.622814527]: speed command value (7049.816865) above maximum limit (6000.000000), clipping.
[ INFO] [1552563552.323373624]: speed command value (-4172.123539) below minimum limit (-4000.000000), clipping.
[ INFO] [1552563561.967574130]: servo command value (0.860712) above maximum limit (0.850000), clipping.
[ INFO] [1552563568.029527979]: speed command value (-6348.315284) below minimum limit (-4000.000000), clipping.
Any help would be appreciated.
What type of VESC are you using? I haven’t seen these types of errors.
it’s the 4.12 i believe.
FOCBOX, Maytech what does it look like?
Thankyou for all the videos and tutorials.I have the telops working for most part. The throttle on the joystick works fine. The car doesn’t respond to steering control commands from the joystick. The joytest tool shows for steering control commands.
Any help is appreciated. I believe some one else ran into this issue earlier. I am not sure if they resolved the issue.
Is the firmware for the VESC updated to turn on the steering servo?
My VESC Firmawre Version 3.53, Hardware: 410. and using DC Motor, VESC Tool is recently version, I think.
I download the software from https://github.com/vedderb.
I can change the some option for DC Motor. so, I can control the DC Motor FWD, REV.
but I cannot servo motor(for handle).
so, could you help me how to fix it? I would like to change VESC Firmawre Version 2.18.
please help me.
I do not know how to help you. This article is about 4.12 version hardware, I do not know if Version 2.18 is compatible with 4.10 hardware. You can try flashing the software as described as above to see if it works, but I do not have experience with that.
How did you connect vesc to dc motor (3pin vs 2pin)? And what did you do (in vesc tool) after uploading firmware to get the dc motor running?
when I handle the command by joy.
I got below massage.
[ERROR] [1554817562.339195836]: Unkown payload type.
[ERROR] [1554817562.339296355]: Out-of-sync with VESC, discarding 9 bytes.
[ERROR] [1554817562.359728914]: Invalid end-of-frame character
[ERROR] [1554817562.359829120]: Out-of-sync with VESC, unknown data leading valid frame. Discarding 1 bytes.
Could you help me how to fix it?
I do not know how to fix it.
I meet the same problem with you. Have you solved it?
I’m also facing the same problem. Any tips?
You don’t give any information about what version of VESC software you are using, or which Jetson, L4T and so on.
I have the same problem. I’m using jetson tx2 with jetpack 3.3, and using vesc 6 mkiii. Firmware version of my vesc is 4.1. Can anyone help?
You have to use the VESC Tool for VESC 6 MKIII. It does not work with the BLDC tool in this article.
Thank you for answering. I used vesc tool, and I configured vesc after watching other videos. Do you know the possible cause of this error?
From your comment you appear to be having issues. However, you have not listed what the issues might be, which version of L4T you are using, which Jetson you are using, what vesc software you are running on the Jetson and so on. That makes it difficult to diagnose your error.
I had the same problem. for me it was because of a conflict on VESC and IMU. for some reasons, imu data was on wrong /dev/ttyACM . just find imu is connected to which ttyACM* and then change the yaml file to the correct one.
PLEASE HELP!!! I am having the same issue of out-of-sync error.
I am developing a fleet of F1/10 cars for my project. I developed the first two cars using FOCBox and VESC 6 MKII. They are working completely fine. The third, fourth and fifth car I’m designing use VESC 6+. The last 3 cars have troubled me with the above error. I have tried all possible ways to get rid of the error but none of them seem to work. I have also been troubled because of the different versions of VESC since the company changes the version very fast but I have no option than using VESC 6+.
1. I flashed the Jetson TX2’s with JetPack 3.3
2. I use VESC Tool 2.2 and the firmware version is 4.1
3. I cloned the repositories of the MIT Racecar project.
Most of the steps were carried out taking help from Jim’s videos and tutorials. I would also be happy to discuss on email at sourajit19-at-gmail.
Any help would be appreciated. Thank you.
Hello, can I use Titan 550 (inbuilt Brushed DC motor in Traxxas Ford Fiesta) with Vesc for this project? Will there be a configuration file for the motor?
The VESC is for use with brushless motors. Typically people using brushed motors use the stock ESC with a PWM driver.
Thanks for the reply. My other issue is that VESC package (ROS package in MIT Racecar GitHub page)gives the odometry data. How would I get the odometry if I’m using a dc motor or stock ESC (with PWM driver)?
There are several ways. You can put magnetic encoders on the wheels. I seem to recall that Traxxas makes a “RPM Monitor” which is a hall effects sensor which is in the drivetrain. All in all, it’s a project that you’ll have to explore. Good luck!
thanks that was really helpful!
Can I use some other bldc motor (non Traxxas with same shaft size and similar specs) with traxxas car and VESC for this project?
The VESC is very flexible, you should be able to use whatever BLDC motor you chose. However, the articles here are for a very specific configuration, and you will need to configure the VESC to meet your needs. Good luck on your project!
My VESC has hw-4.12, fw-3.40 and I’m using vesc tool. Is it fine if I upload your motor configurations with firmware 3.40. Will it work fine?
Nope. The configuration is for the version stated in the article.
Is it for specific firmware version (2.18) and will I have to make my own motor configuration file?
Can I upload 2.18 firmware on my VESC, downgrade it (it already has 3.40 installed)?
Hello Jim, I have a problem with ODOM(rostopic) and I think it is related to VESC firmware changes. the values in odom topic is sth like this and pos: X value keeps changing(starts from zero and keeps increasing gradually 0.1/sec) whithout any controller touch and car is on a stand.
covariance: [0.2, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.2, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.4]
covariance: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
my guess is that it is beacuse of some changes in Vesc 6+ firmware(it is version 4.12)
maybe some modification should be done.(sth similar to this PR(https://github.com/mit-racecar/vesc/pull/13) Do u have any guess? I need somekind of perfect Odom! I had the same problem with shipped firmware and the one I flashed through this video) Is it possible to check it through VESC tool?
Please send your questions to RACECAR/J for support if you have purchased a product from them. I do not know how you installed the software for the VESC from this note. You are attaching this question to an earlier version of the VESC installation.