› Forums › IoTStack › News (IoTStack) › How to add an encoder to the Donkeycar chassis
Tagged: Drones_H6, energy_O4, Tips_G9, Transport_V9
- This topic is empty.
-
AuthorPosts
-
-
February 25, 2020 at 6:16 pm #40479
#News(IoTStack) [ via IoTGroup ]
Headings…
How to add an encoder to the Donkeycar chassisAuto extracted Text……
One of the most useful sensors to add to an autonomous car (after the camera) is an encoder.
But it’s too hard to retrofit most RC cars to add encoders on each wheel, so this post will show you how to do it the easy way, with a single encoder on the motor.
We’re going to be using “quadrature” encoders, which know the difference between forwards and backwards rotation and are easily read by a simple microcontroller.
I won’t be going into how to use this encoder information in your robocar, since it depends a lot on which software stack you’re using (Donkeycar, Jetracer, etc).
As you can see from the photo above, the standard Donkey chassis (the Exceed Magnet) has space to put the encoder above the motor where there is a large drive gear that is easily accessible.
The cheaper encoder below is bigger (38mm diameter) and weighs a bit more.
You’ll also want a microcontroller to read the encoder data, which is easier to do on something like an Arduino than it is on a Linux computer like a RaspberryPi or Jetson Nano.
Cost Encoder Mount Gear $15.99
Just screw the encoder on the mount, press the gear on to the shaft, and position the encoder as shown above so that the gear seats nicely on the motor gear and turns with it, without slipping.
Once you have the encoder in place, solder pins on the the Teensy board in the pins shown below (USB V+ and Gnd and Pins 2 and 3), cut the encoder wires to the desired length and splice female connector of any sort to them as shown.
On the Teensy (or any Arduino), you can run the standard Arduino encoder library to test the encoders.
From the Arduino Examples menu, select the Encoder/Basic example and edit it to reflect the pins you’re actually using:
Encoder myEnc(2, 3);
You should be able to open the Serial Terminal in the Arduino IDE and see the values streaming as you turn the encoder
Read More..
AutoTextExtraction by Working BoT using SmartNews 1.02976805238 Build 26 Aug 2019
-
-
AuthorPosts
- You must be logged in to reply to this topic.