Introduction

In part one of this two-part series, I discussed my plan and progress on building a new steering system with a linear actuator. In case you are new to my blog, welcome! I am building a self-driving golf cart, please check out the project page here. 👈

In part 2, I will dive into the programming with ROS and Arduino, plus other fine-tuning. Let’s get started!

Terminologies:

  • Linear actuator: an actuator that creates motion in a straight line, in contrast to the circular motion of a conventional electric motor.
  • ROS (robot operating system): a collection of software frameworks for robot software development. It provides services designed for hardware abstraction, low-level device control, implementation of commonly used functionality, message-passing between processes, and package management. 
  • ROS Nodes: a process that performs computations. Nodes are combined together into a graph and communicate with one another using streaming topics, RPC services, and the Parameter Server. 
  • Arduino: Open source microcontrollers for robotics and so much more.
  • Deep Learning: is part of a broader family of machine learning methods. Not task-specific algorithms. Vaguely inspired by information processing and communication patterns in biological nervous systems yet have various differences compared with biological brains.

Connecting a Gamepad to ROS

In part one, I explained that I disassembled the entire steering column on the golf cart. Therefore, there will no longer be a steering wheel. This will pose a major challenge when the driver wants to control the vehicle manually. I decided a use a simple XBox gamepad as the new manual control input for the golf cart.

A Xbox controller

This controller will be connected to ROS (Robot Operating System), and send information to the Arduino, which will execute the manual commands using a 43A super-duty motor controller.

The Gamepad publishes information to the ROS master via USB. Then the master program will publish selective useful data to the Arduino. This information consists of the input of the joystick. At the same time, the ROS master also tells the Arduino whether we want manual control or not. The Arduino reads the position of the linear actuator, and send that information back to the ROS master. All of this happens dozens of times per second.

A flowchart illustrating the software system

Linear Actuator Motor Controller

The Arduino and Motor controller for the linear actuator

The motor controller is connected to an Arduino. The Arduino listens to the inputs published by the joystick, and execute those commands using the motor controller. Furthermore, the linear actuator also has a potentiometer that reads the exact position of the actuator. This potentiometer reading is passed back to ROS.

As always, if you are curious about the actual implementation, please check out the project on Github. All of my code is open source and always up-to-date.

A Demo

A video of me controlling the golf cart steering using a xbox controller

Conclusion

So, that’s it. The steering system is nearly ready to go! Next, I will flip the vehicle back on its wheels, and then run some real-world testing. Please contact me at contact@neilnie.com if you have any questions, comments, or concerns. Also, if you like this post, please give me a thumbs up and follow my blog! I really appreciate your support, it means a lot to me!

Posted by:NeilNie

Student at Columbia University, School of Engineering and Applied Sciences. Prev. software engineer intern at Apple. More than six years of experience developing iOS and macOS applications. Experienced in electrical engineering/microcontrollers. From publishing several apps to presented a TEDx talk in machine learning. Striving to use my knowledge, skills, and passion to positively impact the world.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.