How to add an encoder to the Donkeycar chassis

Forums IoTStack News (IoTStack) How to add an encoder to the Donkeycar chassis

  • This topic is empty.
Viewing 0 reply threads
  • Author
    Posts
    • #40834
      Telegram SmartBoT
      Moderator
      • Topic 5959
      • Replies 0
      • posts 5959
        @tgsmartbot

        #News(IoTStack) [ via IoTGroup ]


        Headings…
        How to add an encoder to the Donkeycar chassis

        Auto 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 (9600 baud) 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

    Viewing 0 reply threads
    • You must be logged in to reply to this topic.