IGVC - Encoders

IGVC, or the Intelligent Ground Vehicle Competition is a yearly competition in which autonomous vehicles developed at various universities drive about a course to prove their self-driving capabilities. This competition is the origin of the autonomous golf cart project at Cal Poly. The project has gone through many revisions, but never actually competed in the competition. In fact, the golf cart no longer meets the size constraints specified for the competition. While the aims of the project have diverged from competition to focus on small self-driving tasks around campus, the name stuck, and the project is still called IGVC.

Six-magnet disk

The encoder from one of our other “Dr. Robots”

            Recently, the team focused on making a major sensor upgrade to the golf cart, new encoders. To understand the significance of this upgrade, it must be understood how poor the previous encoders were. Initially we used two hall-effect sensors with six-magnet discs attached to the front wheels of the golf cart. The encoders were handmade and thus, were not perfectly aligned on the discs. This issue required a continual average of the speed to remove the error from the calculated speed. Additionally, due to the small number of magnets per revolution, the minimum speed we could measure was approximately .125 m/s. This meant that the golf cart wouldn’t know the difference between 0.124 m/s and stopped, allowing significant room for error when approximating distance from velocity. Another issue was the inability to determine negative velocity. With the hall-effect sensors, there was no effective way of calculating if the golf cart was moving in reverse, or it was moving forward. Again, this created additional error in the calculations, especially when a slight negative velocity is caused from stopping.

Encoder Disk #1: Acrylic painted white and laser etched

Thus, we set out to engineer a solution that would increase our minimum speed measurement, improve the alignment of ticks received by the sensor, and add the ability to measure negative velocity. After searching the robotics room to find a potential part that could help us solve these issues, we ran across a US Digital encoder on a couple of old robots. After taking the encoder apart, we discovered it was an optical encoder that could measure up to 300 ticks per revolution. The next step was to find a way to integrate the encoder with the golf cart.

Encoder Disk #2: DVD laser etched

Our initial attempt to integrate the optical encoder with the golf cart was to make disks with small slits that would allow for light to reflect back on certain areas of the disc better than others. These disks would then be mounted directly to the interior of the front wheels. We went through many iterations of this idea, each one better than the other, but we never were able to get the same consistency as the 300 tick disk included in the encoder. After running many tests, it seemed that the optical sensor worked best on reflective material and was made to trigger specifically off of aluminum and a black strip. We attempted to mimic this with our third attempt by using aluminum tape and vinyl covering which was eventually etched by a laser cutter.

Encoder Disk #3: Acrylic wrapped in aluminum tape and vinyl laser etched

When actually testing our third disk, we noticed that there were many missed ticks even with precise placement of the optical sensor. This led us to decide that the handmade encoder disk was not going to work, and we needed to find another way to integrate the encoder into our golf cart.

            Our next attempt at integrating the optical sensor with the golf cart was to couple the entire US Digital encoder directly to one of the shafts of the drive motor. After looking closely on our motor, we found a small shaft that was driven by one of the gears inside of the motor, but accessible from the exterior. In order to couple to this shaft, we took the entire motor apart and removed the shaft. We then milled a hole inside the shaft to which we press fit and additional shaft onto that would allow us to directly connect our encoder to the shaft. After reassembling the motor, we attached our encoder to the new shaft, and updated the software to match the new encoder output. Due to the gear ratio of the motor and the 300 tick disk in the encoder, our system receives approximately 1500 tick per revolution of our back tires. This corresponds to a minimum measurement speed of 0.001 m/s, which is a significant improvement from the previous encoder.

Encoder coupled directly to our motor

Close up of final encoder attachment

            Overall, our goal of improving our speed measurement was extremely successful. One of the largest lessons learned from this task was to try to incorporate premade products into our solution before attempting to manufacture home solutions on our own. Doing so for this project would have saved us the many hours we spent manufacturing encoder disks only to find out that they did not work effectively. Nonetheless, this task was a lot of fun to work on and a great learning experience.