MrGreensWorkshop / RasPiPicoSDK_PicoDRO

PicoDRO, DIY digital readout with the Raspberry Pi Pico

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PicoDRO

GitHub issues GitHub forks GitHub stars GitHub license Support me on GitHub Sponsors Support me on Patreon Tip me via Ko-fi


DIY digital readout with Linear scales using Raspberry Pi Pico

Introduction

You can make your own digital readout with Linear scales / encoders using Raspberry Pi Pico. Only linear scales with RS-422 output are currently supported. It is compatible with TouchDRO App V3 via USB.

Thank you for considering supporting my work!

Background

I was looking to add the DRO feature to my small milling machine. I wanted to use junky but good-condition parts to support the SDGs. I found a few linear scales at an online auction and bought them. Then I found the pinouts as I explained in this video.

Features

  • 3 axis support (X,Y,Z)
  • Adjustable read interval
  • Dynamic data refresh rate
  • Adjustable data refresh rate

Compilation

  1. Clone the repo as shown below, or download latest release.

    git clone https://github.com/MrGreensWorkshop/RasPiPicoSDK_PicoDRO.git
  2. Please make sure you are using the Pico SDK v1.5.0 or later, because the implementations described below are necessary.

    • Disabling DTR check for USB CDC, As we are going to use TouchDro App, we need to disable the DTR check for the USB CDC connection.
    • Setting as self-powered USB device, Since the circuit is designed as a self-powered USB device, to tell the USB host that we are not draining power from it, we need to set the attribute called bmAttributes in the USB configuration descriptor.
  3. Open the project in VS Code because it adds SDK to the environment string. (Check the .vscode/settings.json file for details.)

    • Or add PICO_SDK_PATH to your environment string.
  4. Compile using build.sh

    chmod +x build.sh
    ./build.sh
    • Or run
    cmake -B build -S . && make -j4 -C build

Running

  1. Make sure you watch the video at the top of the page.
  2. Build the circuit below.

DIY digital readout with Linear scales using Raspberry Pi Pico

  1. Get the binary

    • You can compile the project and get the binary as explained above.
    • Or you can use precompiled binary files from the latest release, download the "binary.zip" and unzip.
  2. Put the Raspberry Pi Pico into bootloader mode by pushing the bootsel button while plugging it into your computer.

  3. Copy the build/PicoDRO.uf2 file to the Raspberry Pi Pico either by dragging and dropping or using the cp command as shown below.

    Linux macOS
    cp build/PicoDRO.uf2 /media/<user>/RPI-RP2 cp build/PicoDRO.uf2 /Volumes/RPI-RP2
  4. TouchDRO App V3 or higher version is required to use via USB, but it has not been released yet. But you can get the app by entering the Android test program. For details, please check the official TouchDRO website. (Android 5.0 or higher is required.)

  5. Download and Open the App.

  6. To set USB as the default interface, please set Settings > Use USB Connection and set USB Baud Rate to 115200.

  7. To set resolution to 1.00 microns, please open Settings > X Axis Settings > Resolution and enter 25400 to set encoder steps per inch.

Documentation

Check out the video at the top of the page.

Credits

I want to thank all projects that gave me an opportunity to make this project possible. Please consider to support these projects too.

  • QuadratureDecoder This is a library that counts quadrature encoder signal transitions in the background using the RP2040's PIO and DMA hardware.
  • TouchDRO Application is a free Android application that provides all standard DRO features combined with easy to read high-resolution multi-touch display and superior computing power offered by modern phones and tablets. It is also ad-free.

You Can Support My Work

Creating projects like this takes a great amount of time. Much appreciated if you consider supporting me so that I can continue projects like this and creating new contents for everyone.

  • You can support me on GitHub Sponsors (monthly or one time)
  • You can be one of my patrons on Patreon (monthly)
  • You can tip me via Ko-fi (one time)

Contribute

Pull Requests are welcome. Please check the instructions in the Issues and Pull Request templates.

License

As it says in the Apache License 2.0, you can use my code anywhere as long as you include the license file and copyright notice. Also, state if you make any changes.

Copyright (c) 2022 Mr. Green's Workshop https://www.MrGreensWorkshop.com

Other Licenses

This project incorporates libraries written below. Without these libraries, I couldn't make this project possible.

Library file(s)
QuadratureDecoder, Copyright 2021 Adam Green (https://github.com/adamgreen/). QuadratureDecoder is distributed under the terms of the Apache License Version 2.0. Qdec

About

PicoDRO, DIY digital readout with the Raspberry Pi Pico

License:Apache License 2.0


Languages

Language:C++ 81.8%Language:CMake 17.7%Language:Shell 0.6%