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!
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.
- 3 axis support (X,Y,Z)
- Adjustable read interval
- Dynamic data refresh rate
- Adjustable data refresh rate
-
Clone the repo as shown below, or download latest release.
git clone https://github.com/MrGreensWorkshop/RasPiPicoSDK_PicoDRO.git
-
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.
-
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.
-
Compile using build.sh
chmod +x build.sh ./build.sh
- Or run
cmake -B build -S . && make -j4 -C build
- Make sure you watch the video at the top of the page.
- Build the circuit below.
-
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.
-
Put the Raspberry Pi Pico into bootloader mode by pushing the bootsel button while plugging it into your computer.
-
Copy the
build/PicoDRO.uf2
file to the Raspberry Pi Pico either by dragging and dropping or using thecp
command as shown below.Linux macOS cp build/PicoDRO.uf2 /media/<user>/RPI-RP2
cp build/PicoDRO.uf2 /Volumes/RPI-RP2
-
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.)
-
Download and Open the App.
-
To set USB as the default interface, please set
Settings > Use USB Connection
and setUSB Baud Rate
to115200
. -
To set resolution to 1.00 microns, please open
Settings > X Axis Settings > Resolution
and enter25400
to set encoder steps per inch.
Check out the video at the top of the page.
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.
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)
Pull Requests are welcome. Please check the instructions in the Issues and Pull Request templates.
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
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 |