JetsonHacks

Developing on NVIDIA® Jetson™ for AI on the Edge

RACECAR/J – Programming the Electronic Speed Controller – VESC 4.X

Before we can run RACECAR/J, we need to program the electronic speed controller, called a VESC, for the motor and steering. Looky here:

Background

Note: Newer versions of RACECAR J use a VESC 6. Please see the article RACECAR/J – Programming the Electronic Speed Controller.

For RACECAR/J, we replace the stock TRAXXAS ESC with Vedder Electronic Speed Controller (VESC) version 4.12 compatible hardware. The major reason for the change is to gain full control of the robot 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.

Note: VESC is now a registered trademark. There are several manufacturers who build VESC compatible hardware, but expect different names since the registration. There is a new version of VESC hardware (6.4), but for the purposes of the this article, we will use the term VESC to indicate version 4.12 compatible hardware.

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 RACECAR/J 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 using a program called ‘bldc-tool’. BLDC is an acronym for BrushLess DC motor.

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.

Notes

Installation Preparation

Some Notes

  • The full RACECAR/J Kit contains an Enertion Boards FOCBOX, VESC 4.12 compatible hardware. The FOCBOX is programmed before shipping from RACECAR/J. This article is useful if at some point you need to reprogram the FOCBOX.
  • L4T 28.1 does not have a driver for ACM USB devices, such as the VESC. This article covers how to install a cdc-acm module for the Jetson if you have not already installed one.
  • This article covers installing and running the BLDC Tool on a Jetson TX Dev Kit running L4T 28.1. To build on a Linux x86 machine (like the one used to flash the Jetson), use the installBLDCToolHost.sh script

Installation

The RACECAR/J account on Github contains a repository named installBLDCTool. To build the BLDC Tool:

$ git clone https://github.com/racecarj/installBLDCTool
$ cd installBLDCTool
$ ./installBLDCToolJetson.sh

This will install prerequisites for the building, build the bldc-tool from source code, and download the VESC firmware and RACECAR/J motor configuration files. The VESC firmware and RACECAR motor configuration files are downloaded from the Github RACECAR/J vesc-firmware repository.

The BLDC Tool application is in the ~/bldc-tool directory.

A USB cable communicates motor speed and steering angle information between the Jetson and the VESC. The TRAXXAS steering servo is wired to the VESC servo cable. The USB cable is also used to flash the firmware on the VESC.

The FOCBOX connects via USB 2.0 to the Jetson. The connector on the FOCBOX is micro-USB. The programming USB cable supplied with the Jetson may be used:

Other VESC 4.12 hardware connect via USB 2.0 using a mini-USB connector. For example:

Before starting the bldc-tool, connect the VESC to the vehicle battery:

Programming the VESC

$ cd ~/bldc-tool
$ ./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 current firmware revision will display in the lower right hand corner upon connection.

Use the ‘Firmware’ tab to go to the flash the firmware binary area. Select the firmware file, and upload to the VESC. After the firmware is finished uploading the VESC will disconnect and reboot. 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 firmware for hardware version 4.12 in the file located in ~/vesc-firmware/firmware/VESC_servout.bin

After the firmware is done uploading, go to the ‘Motor Controller’ tab. ‘Connect’ to the VESC. The configuration is loaded from the ‘Load XML’ button. Once the configuration is loaded, write the configuration to the VESC.

The configuration file is located in ~/vesc-firmware/VESC-Configuration. The configuration file shown in the video is ‘FOCBOX_hw_30k_erpm.xml’ which is for the FOCBOX. If you are using a regular VESC, you will probably want to use the configuration file ‘VESC_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 VESC has been flashed and configured, you are ready to tele-operate the robot: RACECAR/J – ROS Teleoperation

Notes

In the video, a Jetson TX2 running L4T 28.1 is shown.

The next generation VESC website VESC Project supports both older hardware and the new 6.4 version of the VESC.

VESC is a registered trademark of Benjamin Vedder.

Conclusion

At this point, we have a working robot platform. In the next few articles we will be covering attaching the Jetson to a battery, and adding different sensors. Stay tuned!

Facebook
Twitter
LinkedIn
Reddit
Email
Print

76 Responses

  1. Hi. Great video. Thank you. Do you have experience with the VESC 6? What is your opinion on Focbox in terms of heat behavior and durability?

    Thank you very much.

    1. Hi Michael,
      I have not used the VESC 6. We have not encountered any issues with the FOCBOX, though we’ve only been using them about a year. It is nice having an enclosure around the VESC internals, we had been experiencing failures around the older heat shrink wrapped versions. The FOCBOX/VESC 6 are designed for much higher currents than what the RACECARs use, many electric skateboards use 12S batteries. The RACECAR is 2-3S. Thanks for reading!

  2. I currently do not have the sparkfun IMU installed so the VESC is at ttyACM0. Is that OK?

    When I ran ros “roslaunch racecar teleop.launch”, I got error like

    ERROR: cannot launch node of type [vesc_ackermann/ackermann_to_vesc_node]: can’t locate node [ackermann_to_vesc_node] in package [vesc_ackermann]
    ERROR: cannot launch node of type [vesc_driver/vesc_driver_node]: can’t locate node [vesc_driver_node] in package [vesc_driver]
    ERROR: cannot launch node of type [vesc_ackermann/vesc_to_odom_node]: can’t locate node [vesc_to_odom_node] in package [vesc_ackermann]

    [ERROR] [1525240125.111281912]: Couldn’t open joystick /dev/input/js0. Will retry every second.
    [ERROR] [1525240125.325785995]: Failed to load nodelet [/ackermann_cmd_mux] of type [ackermann_cmd_mux/AckermannCmdMuxNodelet] even after refreshing the cache: Could not find library corresponding to plugin ackermann_cmd_mux/AckermannCmdMuxNodelet. Make sure the plugin description XML file has the correct name of the library and that the library actually exists.
    [ERROR] [1525240125.328168671]: The error before refreshing the cache was: Could not find library corresponding to plugin ackermann_cmd_mux/AckermannCmdMuxNodelet. Make sure the plugin description XML file has the correct name of the library and that the library actually exists.
    [FATAL] [1525240125.339548251]: Failed to load nodelet ‘/ackermann_cmd_mux` of type `ackermann_cmd_mux/AckermannCmdMuxNodelet` to manager `ackermann_cmd_mux_nodelet_manager’

    Could you tell me how to fix it?

    Thanks,
    George

          1. Hi kangalow,

            I’d like to report a similar issue where my VESC appears to have power (blue and green light are on) and will receive inputs from BLDC_Tool (Brighter green light, but doesn’t make the car move). However, when running roslaunch racecar teleop.launch I receive three errors:

            ERROR: cannot launch node of type [vesc_ackermann/ackermann_to_vesc_node]: can’t locate node [ackermann_to_vesc_node] in package [vesc_ackermann]
            ERROR: cannot launch node of type [vesc_driver/vesc_driver_node]: can’t locate node [vesc_driver_node] in package [vesc_driver]
            ERROR: cannot launch node of type [vesc_ackermann/vesc_to_odom_node]: can’t locate node [vesc_to_odom_node] in package [vesc_ackermann]

            I’ve worked on this for a few days now and haven’t discovered any solutions. Addressing the questions you asked George Cong, yes I am in my racecar-ws directory and have properly sourced the devel/setup.bash. In addition, all of the files (ackermann_to_vesc_node, vesc_driver_node, and vesc_to_odom_node) have permissions to be executed as a program using the chmod command in the terminal. In addition, the vesc has been set up with serveout.bin file that was used to set the configuration in the BLDC_Tool.

            I have one more idea to solve the problem that I will keep you updated on, but chances are my idea won’t work.
            I hope to hear from you soon!

            J. Johnson

              1. If you are referring to the packages vesc_ackermann and vesc_driver (likely vesc & vesc_msgs as well), they are all within the src directory in the correct location that was specified by launch files connected to master_control.py:
                /home/racecar/racecar-ws/src/vesc/[insert 4 package names here]

                The packages appeared in a new directory “racecar-ws” along with everything else after the ./installMITRACECAR.sh file from the “software install” page was run into the terminal.

                And as expected, my idea from earlier was a bust. However, I have a new idea. My new idea will be to remove the vesc folder (Likely moving it somewhere else temporarily) and rerun the ./install command so the racecar-ws can rebuild the vesc folder. Perhaps it was corrupted somehow, but I couldn’t imagine why.

                Thank you for your time,
                J. Johnson

                1. I am suspecting one possibility is this (Please note I have cuda9.0 on my TX2 since I flashed jetpack 3.2)

                  when I installed the racecarj package

                  installMITRACECARJ.sh

                  I noticed the following error:

                  Call Stack (most recent call first):
                  racecar-controllers/racecar_potential_field_controller/CMakeLists.txt:15 (find_package)

                  — Found Eigen: /usr/include/eigen3
                  — Eigen found (include: /usr/include/eigen3)
                  — +++ processing catkin package: ‘vesc_ackermann’
                  — ==> add_subdirectory(vesc/vesc_ackermann)
                  — Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
                  — +++ processing catkin package: ‘vesc_driver’
                  — ==> add_subdirectory(vesc/vesc_driver)
                  — +++ processing catkin package: ‘zed_wrapper’
                  — ==> add_subdirectory(zed-ros-wrapper)
                  CMake Error at /usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:148 (message):
                  Could NOT find CUDA: Found unsuitable version “9.0”, but required is exact
                  version “8” (found /usr/local/cuda-9.0)
                  Call Stack (most recent call first):
                  /usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:386 (_FPHSA_FAILURE_MESSAGE)
                  /usr/share/cmake-3.5/Modules/FindCUDA.cmake:949 (find_package_handle_standard_args)
                  /usr/local/zed_previous/zed-config.cmake:44 (find_package)
                  zed-ros-wrapper/CMakeLists.txt:22 (find_package)

                  — Configuring incomplete, errors occurred!
                  See also “/home/nvidia/racecar-ws/build/CMakeFiles/CMakeOutput.log”.
                  See also “/home/nvidia/racecar-ws/build/CMakeFiles/CMakeError.log”.
                  Invoking “cmake” failed
                  Base path: /home/nvidia/racecar-ws

                  1. The error message says that nothing is going to be compiled because the ZED wrapper didn’t match up with the CUDA version. You can check the logs.

                2. What version of L4T are you running? This has only been tested agains L4T 28.1, the ZED wrapper referenced has a requirement of matching the CUDA version (8.0).

                  1. My L4T was 28.1.

                    I also forgot to mention this, but the teleop.launch had successfully run earlier in April, but that is no longer the case after continuing onto the future steps.

  3. I don’t have my machine on me, pardon. If I recall, catkin fails to call “jmake -s 4” (or something like that) when analyzing the messages for ar_track_alvar. I’ll verify on Monday.

    1. I have successfully gotten the racecar to teleop properly. My issue was that I had run both RacecarJ’s ./installRACECARJ.sh and jetsonhacks ./installMITRACECAR.sh onto my TX1 (L4T 28.1). When the racecar-ws workspace was built, certain dependencies with the VESC no longer functioned properly. This was solved by deleting the racecar-ws and running the proper install script. Thank you, Kangalow, for your assistance!

  4. I noticed after installing the firmware, when I connected to the VESC, it still said firmware 2.18. Is this correct?

  5. Are there any resources available for how to set up the wireless controller that comes with the Racecar/J build kit with the VESC through bldc-tool? I’m not sure what kind of app I should be using (PPM, Nunchuk, etc.) or how to begin mapping the buttons for this controller.

    1. I’m not quite sure what you are asking. Typically for the RACECAR/J project, the BLDC tool is only used to flash firmware on the VESC. If the RACECAR/J build kit was purchased, the correct firmware should already be flashed on the device.

      The game controller attaches wirelessly to the Jetson. The Jetson interprets the joystick commands through ROS teleoperation and sends the control signals to the VESC. See: https://jetsonhacks.com/2017/06/01/get-your-motor-running-vesc-jetson-racecar-build/ under the “Tele-operation” section.

      Reading through the article on this page, I’ll add the teleoperation notes here also.

      1. Thank you for your reply. When trying to run the teleoperation with the car, I unfortunately get the same error messages as George Cong and Jeffrey Johnson above, where the ackermann nodelet fails to load. Running catkin_make in the racecar-ws directory gives no errors related to the packages causing problems during teleoperation (it does give an error with regard to the ZED packages, but I did not install those as I do not have a ZED camera). Is there any fix I can try for this?

        1. Which version of L4T are you running? Could you list exactly which errors you are encountering, the previous issues people have mentioned seem to be related to versioning.

          1. I’m running L4T 28.2, the latest version. I will try flashing the Jetson with L4T 28.1 instead and see if that fixes the issue.

            1. Unfortunately, re-flashing the Jetson TX2 with Jetpack 3.1 did not solve my problem… here is the exact error message I’m 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]
              ERROR: cannot launch node of type [vesc_driver/vesc_driver_node]: can’t locate node [vesc_driver_node] in package [vesc_driver]
              ERROR: cannot launch node of type [vesc_ackermann/vesc_to_odom_node]: can’t locate node [vesc_to_odom_node] in package [vesc_ackermann]
              process[laser_node-15]: started with pid [3466]
              ERROR: cannot launch node of type [sparkfun_9dof_razor_imu_m0/driver_node]: can’t locate node [driver_node] in package [sparkfun_9dof_razor_imu_m0]
              [ERROR] [1526428320.105801963]: Failed to load nodelet [/ackermann_cmd_mux] of type [ackermann_cmd_mux/AckermannCmdMuxNodelet] even after refreshing the cache: Could not find library corresponding to plugin ackermann_cmd_mux/AckermannCmdMuxNodelet. Make sure the plugin description XML file has the correct name of the library and that the library actually exists.
              [ERROR] [1526428320.105983945]: The error before refreshing the cache was: Could not find library corresponding to plugin ackermann_cmd_mux/AckermannCmdMuxNodelet. Make sure the plugin description XML file has the correct name of the library and that the library actually exists.
              [FATAL] [1526428320.115713008]: Failed to load nodelet ‘/ackermann_cmd_mux` of type `ackermann_cmd_mux/AckermannCmdMuxNodelet` to manager `ackermann_cmd_mux_nodelet_manager’
              [ackermann_cmd_mux-10] process has died [pid 3448, exit code 255, cmd /opt/ros/kinetic/lib/nodelet/nodelet load ackermann_cmd_mux/AckermannCmdMuxNodelet ackermann_cmd_mux_nodelet_manager __name:=ackermann_cmd_mux __log:=/home/nvidia/.ros/log/f48e728c-589a-11e8-b775-00044ba81532/ackermann_cmd_mux-10.log].
              log file: /home/nvidia/.ros/log/f48e728c-589a-11e8-b775-00044ba81532/ackermann_cmd_mux-10*.log

              1. What steps did you take to install the RACECAR/J software initially? What directory are you in when you run the command? Did you
                $ source devel/setup.bash
                What are the contents of your catkin workspace source directory? Did you encounter errors when you ran catkin_make?

                1. 1. To install the software initially, I followed the instructions on the tutorial (installing from github repository using installMITRacecar.sh). I then set the variable ROS_HOSTNAME to localhost and ensured that ROS_IP was set to the TX2’s IP address.
                  2. When I run the command, I am in racecar-ws. I always source devel/setup.bash
                  3. The workspace source directory has the folders racecar, racecar-controllers, vesc, zed-ros-wrapper, and CMakeLists.txt.
                  4. I do encounter an error when running catkin_make:
                  — Configuring incomplete, errors occurred!
                  See also “/home/nvidia/racecar-ws/build/CMakeFiles/CMakeOutput.log”.
                  See also “/home/nvidia/racecar-ws/build/CMakeFiles/CMakeError.log”.
                  Makefile:318: recipe for target ‘cmake_check_build_system’ failed
                  make: *** [cmake_check_build_system] Error 1
                  Invoking “make cmake_check_build_system” failed

                  The error log contains the following:
                  Determining if the pthread_create exist failed with the following output:
                  Change Dir: /home/nvidia/racecar-ws/build/CMakeFiles/CMakeTmp

                  Run Build Command:”/usr/bin/make” “cmTC_ff19b/fast”
                  /usr/bin/make -f CMakeFiles/cmTC_ff19b.dir/build.make CMakeFiles/cmTC_ff19b.dir/build
                  make[1]: Entering directory ‘/home/nvidia/racecar-ws/build/CMakeFiles/CMakeTmp’
                  Building C object CMakeFiles/cmTC_ff19b.dir/CheckSymbolExists.c.o
                  /usr/bin/cc -o CMakeFiles/cmTC_ff19b.dir/CheckSymbolExists.c.o -c /home/nvidia/racecar-ws/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c
                  Linking C executable cmTC_ff19b
                  /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_ff19b.dir/link.txt –verbose=1
                  /usr/bin/cc CMakeFiles/cmTC_ff19b.dir/CheckSymbolExists.c.o -o cmTC_ff19b -rdynamic
                  CMakeFiles/cmTC_ff19b.dir/CheckSymbolExists.c.o: In function `main’:
                  CheckSymbolExists.c:(.text+0x14): undefined reference to `pthread_create’
                  CheckSymbolExists.c:(.text+0x18): undefined reference to `pthread_create’
                  collect2: error: ld returned 1 exit status
                  CMakeFiles/cmTC_ff19b.dir/build.make:97: recipe for target ‘cmTC_ff19b’ failed
                  make[1]: *** [cmTC_ff19b] Error 1
                  make[1]: Leaving directory ‘/home/nvidia/racecar-ws/build/CMakeFiles/CMakeTmp’
                  Makefile:126: recipe for target ‘cmTC_ff19b/fast’ failed
                  make: *** [cmTC_ff19b/fast] Error 2

                  File /home/nvidia/racecar-ws/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
                  /* */
                  #include

                  int main(int argc, char** argv)
                  {
                  (void)argv;
                  #ifndef pthread_create
                  return ((int*)(&pthread_create))[argc];
                  #else
                  (void)argc;
                  return 0;
                  #endif
                  }

                  Determining if the function pthread_create exists in the pthreads failed with the following output:
                  Change Dir: /home/nvidia/racecar-ws/build/CMakeFiles/CMakeTmp

                  Run Build Command:”/usr/bin/make” “cmTC_6dd2f/fast”
                  /usr/bin/make -f CMakeFiles/cmTC_6dd2f.dir/build.make CMakeFiles/cmTC_6dd2f.dir/build
                  make[1]: Entering directory ‘/home/nvidia/racecar-ws/build/CMakeFiles/CMakeTmp’
                  Building C object CMakeFiles/cmTC_6dd2f.dir/CheckFunctionExists.c.o
                  /usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create -o CMakeFiles/cmTC_6dd2f.dir/CheckFunctionExists.c.o -c /usr/share/cmake-3.5/Modules/CheckFunctionExists.c
                  Linking C executable cmTC_6dd2f
                  /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_6dd2f.dir/link.txt –verbose=1
                  /usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create CMakeFiles/cmTC_6dd2f.dir/CheckFunctionExists.c.o -o cmTC_6dd2f -rdynamic -lpthreads
                  /usr/bin/ld: cannot find -lpthreads
                  collect2: error: ld returned 1 exit status
                  CMakeFiles/cmTC_6dd2f.dir/build.make:97: recipe for target ‘cmTC_6dd2f’ failed
                  make[1]: *** [cmTC_6dd2f] Error 1
                  make[1]: Leaving directory ‘/home/nvidia/racecar-ws/build/CMakeFiles/CMakeTmp’
                  Makefile:126: recipe for target ‘cmTC_6dd2f/fast’ failed
                  make: *** [cmTC_6dd2f/fast] Error 2

                    1. Wow, good news indeed. Going through the message above, it appears as if libpthread is missing. This is usually installed in libc, so maybe there is a missing package which did not load using the script automation. Hopefully I can figure out the sequence that is causing the issue. Glad to hear the car is working!

                    2. Hi Mel,

                      I successfully built my car. But when I ran it with teleop, the car runs very slow around 2-4 miles/h. I can not go any faster no matter how I use the joystick. Do you have the same issue?

                      Thank you very much.

  6. Is it possible to remove joystick deadman switch? Holding that switch while driving the car is kind of difficult for collecting training samples. Also for steering, pushing the button forward drives the car to the left, backward to the right. This is also hard. Can we change that to pushing button left drives the car left, pushing right drives the car right?

  7. I drove the car with teleop gamepad outside my house but found it ran very slow. I pushed the button on gamepad all the way forward, at start the car try to accelerate and I can hear sounds. However, it seemed that something cut off the acceleration and speed never went up more than 3 mph. Do you know why?

    1. Yes. There is a speed limiter in the ROS software stack so that new students do not exceed a safe speed when first programming the robot. Most of the industrious students disable this, of course. This is also one of the ways that the students become familiar with the software stack, when they start looking for the cause of lack of speed.

        1. ok, in catkin_ws/src/racecar/config/racecar-v2/vesc.yaml increase
          speed_to_erpm_gain and speed_min/speed_max.

  8. I tried running the motor detection in the BLDC-tool (on the “Motor Configuration > BLDC” tab), and it keeps coming back with “Bad detection result received”. What am I doing wrong? Is this normal?

    Second question: You mentioned that this firmware is only compatible with “version 4.12 compatible hardware”. How can I tell if my VESC hardware is compatible or not? (I have a FOCBOX ordered from enertion boards directly). Thanks!

  9. The latest VESC firmware for VESC 4.12 hardware is 3.38 and doesn’t work with BLDC_Tool anymore, it requires vesc_tool. Did anyone try the latest VESC firmware? Did any protocol change?

    1. I believe that the order of the sensor values changed in the new datatypes.h
      This means that you would have to map the VESC packets differently in vesc_packet.cpp

  10. I built a Racecar J and could use teleop to drive it. I found, however, my car always turn right a little bit, even when I drive it straight. I think the steering is not centered. Is there anything I can tune with the BLDC tool? Or I have the tune the car mechanical parts?

    1. The BLDC tool is not used in the RACECAR ROS stack. You can set a steering offset in the launch file for the VESC, if that’s what you mean.
      More than likely, you should adjust the car steering so that it tracks straight.

  11. Hey there!

    I’ve got my RACECAR build up and running with the stock batteries that come with the kit, however when I switched to a 2S 7400mAh Li-po battery I can no longer teleoperate. I’ve tried to set my upper and lower cuttoff voltages to 7.7V and 7.5V respectively so as not to deplete the battery too far, but still nothing. I can also get the motor to spin the wheels in the BLDC tool using the arrow keys, but as soon as I move over to the teleop ROS exe I can’t get power to the wheels. Note that I still have steering.
    Anyone have any experience with upgrading the battery with Focboc and racecar stack?

      1. Yeah! Fully charged battery. Actually all I had to do was post on the internet in order to have a eureka moment. I upped the minimum and maximum speeds to -20000 and 20000 in the vesc.yaml file within the ROS stack and BINGO! It works.

        1. Ah yes, the post the question moment. I don’t know why that seems to work in a lot of cases, but they should add the technique to programming textbooks. I’m glad you got it to work!

  12. One thing I am curious about is how the motor parameters were found? It seems when I try to identify the parameters in the BLDC tool it spins up the motor for a while then goes to a stall condition and eventually reports a fault saying that the parameters couldn’t be read. This happens with both the stock and upgraded battery and with zero load on the motor. Not sure if anyone else is experiencing that with the velenium motors? It would be nice to have a guide on actually configuring the parameters of the motor. Looking at the velenium data sheet it says it can do 200A continuous with peak at 320A. With the lipo I know I can push the car a lot harder.

  13. I am wondering if the Enertion Boards FOCBOX, VESC 4.12 has its own software package I can use. For example, do they have “Pure Pursuit” or “PID” API for path following?

    1. The FOCBOX is strictly hardware, there is no higher level software from Enertion. Their support is for the BLDC tool, which allows you to program the low level motor controller firmware for the micro controller on the FOCBOX.

  14. Hello.
    I am trying to do ROS Teleoperation with F710 for the first time. Steering servo cotrol is Okay, but not working for motor control. I bought new FOCBOX VESC directly from enertion, so I installed CDCASM, BLCD_Tool and RACECARJ. FOCBOX’s FAULT signal has been always flashing in red. Could anyone advice me and suggest measures for this trouble? Thank you for your kindly help.

    1. The red light could mean a couple of things. The most likely is that the battery is not charged enough to drive the motor. The configuration file sets the battery cutoff level. You should be able to use the BLDC tool to view the cutoff level. Check your battery to make sure that the voltage is above the threshold.
      The second red light meaning is that there is an internal error with the hardware. More than likely, the device needs to be replaced. Hope this helps, and thanks for reading!

  15. Thank you for your nice advise! I checked the battery. I used 7.2V Ni-MH battery. I mistook. FOCBOX needs 8V+. So I bought and changed 8.4V battery for the FOCBOX, it worked. But, I have other trouble. It works with LAN cable to my network router, but off the LAN cable, it doesn’t work by ROS teleoperation.
    Could you please advise for me? Sorry, I’m a biginer for ROS.

    1. I’m glad you got it to work. Networking is difficult to debug. You should check that the IP address of ROS_MASTER_URI and other ROS network environment variables point to the machine rather than a network address assigned by the network router when connected via Ethernet.

  16. I flashed my focbox with 2.18 version firmware. Now the Focbox doesn’t boot. Red light is not flashing 3 times as it is supposed to. The blue light is on. Is there a way to recover from this?

  17. Thank you for your reply. Networking is hard to build. After that, I try to conenct wifi to internet duirng ROS ethernet(IP:192.168.15.0 same in Teleoperation video). When I select ROS ethernet, TX2’s wifi cannot connect my ruter(internet). When off ROS ethernet, TX2’s wifi can connect to internet but roslaunch racecar teleop.launch cannot working. I set ROS_MASTER_URI:192.168.0.15:11311, and ROS_IP:192.168.0.15. Could you please advice me about this trouble? I would like to do tele-monitoring at host computor while tele-operating.

    1. It is difficult to determine network configurations like this. Typically the TX2 is set up as a wireless access point running the ROS master, and then other computers connect to it. I do not know what you mean by “ROS ethernet”, nor do I know how you are running the roslaunch command if you are not SSH into the TX2.

  18. Hi,
    I am wondering to know that how can Focbox can use PID to control the speed of the car. In brushless motor, we dont have any encoder to feed back the speed of the wheels. Thus, how can Focbox can control the speed by closed loop?
    Thank you for you help1

  19. Thanks for your advice. My wish is that “running visualizations from base station connected to the robot over WiFi” written in the article of “RACECAR/J-Hokuyo UST-10LX Configuration”. But I cannot connect Lidar sensor(IP:192.168.0.10) and WiFi internet at the same time.

    1. The Ethernet port is connected to the Lidar. In the MIT RACECAR setup / RACECAR/J the TX2 acts as a Wireless Access Point, as is not connected to the Internet.

        1. I do not have any experience with this. I do not believe there are any changes required. However, you should seriously consider raising the minimum voltage so that the ESC does not drain the LiPo. I would probably set it around 12.5 volts, though you may be able to get away with a little less. If you’re driving the rest of the electronics with the one battery, you will definitely need to be over 12V.

          1. currently the BLDC tool setup is as follow:

            Minimum input voltage: 8.00 v
            Maximum input voltage: 57.00 v
            Battery cutoff start : 10.00v
            Battery cutoff end : 8.00v

            should I change them to
            Minimum input voltage: 12.50 v
            Maximum input voltage: 57.00 v
            Battery cutoff start : 18.00v
            Battery cutoff end : 12.50v

            To be honest, I do not know what Battery cutoff start/end is.

            1. The Battery Cutoff tells the VESC two things.
              The Cutoff End is when to shut down (don’t over discharge the battery)
              The Cutoff Start is when to start curbing the amount of current being drawn to help manage the battery drain.
              Typically you would use 3.4V per cell for the Cutoff Start (On a 4S battery this would be 13.6V)
              For a Cutoff End you would use 3.2V per cell (On a 4S battery this would be 12.8V).
              Once you start getting below the 3.2V, there’s extra stress placed on the battery.

  20. Hi everyone, I have successfully build my car. However, I could not find the FocBox VESC anymore. The manufacture no longer makes them. So if you have a spare or want to sell your used, please let me know…

  21. Hello, someone have an idea why when u run teleop, left & right are OK on the racecar but up and down are KO (the racecarj doesn t move) and produce a sound on my Focbox (my battery is full)?

    1. Not sure what you are describing. Is the red light on the FOCBOX on? Are you holding down the dead man switch when you are trying to control the throttle. Which joystick are you using to move the throttle?

    2. Hi! First of all, thanks for sharing.

      I’ve seen some set ups include a custom capacitor board. Do you require it here?

      Thanks

  22. Sorry Jim, not sure how to delete the previous posts. Please be free to edit my previous posts.
    Gettin tired ..

    cd installBLDCTool

  23. Hi, First of all many thanks for the video. How can we understand the vesc hardware is broken or not? Does it send a message showing that its broken or does it have an open connection on it ? or anything else on the hardware such as an indicator led?

    1. You are welcome. When you apply power to the VESC, there is a LED indicator which indicates its status. This depends on which version of the VESC you are using, but for the one shown in the video and most modern versions it is located adjacent to the USB plug. Make sure that the battery is charged! Hope this helps, and good luck on your project!

Leave a Reply

Your email address will not be published. Required fields are marked *

Disclaimer

Some links here are affiliate links. If you purchase through these links I will receive a small commission at no additional cost to you. As an Amazon Associate, I earn from qualifying purchases.

Books, Ideas & Other Curiosities