element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
    About the element14 Community
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      •  Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Project Videos
  • Challenges & Projects
  • element14 presents
  • Project Videos
  • More
  • Cancel
Project Videos
Documents DIY Shapeoko CNC Pendant -- Episode 420
  • Documents
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Project Videos to participate - click to join for free!
Related
Recommended
Engagement
  • Author Author: tariq.ahmad
  • Date Created: 11 Nov 2019 10:04 PM Date Created
  • Last Updated Last Updated: 15 Nov 2019 8:24 AM
  • Views 13109 views
  • Likes 10 likes
  • Comments 88 comments

DIY Shapeoko CNC Pendant -- Episode 420

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

One of the great joys of being able to design with electronics is the ability to make your own custom tools. DJ recently picked up a CNC router and in order to make his life a wee bit easier, he’s designed and built a pendant that will allow him to more comfortably, and accurately set up his parts in the machine. Follow along as he tinkers his way to new gadget that, hopefully, will be of use or inspiration for fellow makers and CNC enthusiasts.

Bill of Material:

Product Name Manufacturer Quantity Buy Kit
Panel Mount Push Button Grayhill 7 Buy Now
5mm LED Multicomp 7 Buy Now
680R Resistor Multicomp Pro 7 Buy Now
3D Filament Verbatim 1 Buy Now
Rotary Encoder Bourns 1 Buy Now

 

Additional Parts:

 

Product Name
Teensy LC
Attachments:
Resources_DIY Shapeoko CNC Pendant.zip
image
DIY Shapeoko CNC Pendant

element14 Presents  |  DJ Harrigan's VCP Profile  |  Project Videos

  • shapeoko
  • carbide 3d
  • digital fabrication
  • fusion 360
  • cnc
  • 3D Printing
  • cad
  • usb hid
  • element14 presents
  • xxl
  • rotary encoder
  • microcontroller
  • multicomp
  • dj
  • cam
  • bourn
  • arduino
  • router
  • dj harrington
  • friday_release
  • woodworking
  • e14presents_djharrigan
  • Share
  • History
  • More
  • Cancel
Actions
  • Share
  • More
  • Cancel
  • Sign in to reply

Top Comments

  • rogo
    rogo over 6 years ago +2
    The project is very nice but a cabling scheme would not be refused!
  • thomasvdd
    thomasvdd over 6 years ago +1
    Awesome project! I'm definitely building this, it solves exactly the annoyance I encounter when milling. Could you share the file for the front plate which includes the text?
  • DAB
    DAB over 6 years ago +1
    Nice build. DAB
Parents
  • mayermakes
    mayermakes over 6 years ago

    Possibly they are sending non printable characters, get in the code and change the chars to abcd for example, if you still get nothing the issue is maybe in the wiring. The encoders need a ground referee nce. It has to be the same gnd as the mcu has. Use a multimeter to check if the pis really go low when you turn the encoders

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
Comment
  • mayermakes
    mayermakes over 6 years ago

    Possibly they are sending non printable characters, get in the code and change the chars to abcd for example, if you still get nothing the issue is maybe in the wiring. The encoders need a ground referee nce. It has to be the same gnd as the mcu has. Use a multimeter to check if the pis really go low when you turn the encoders

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
Children
  • wildmack
    wildmack over 6 years ago in reply to mayermakes

    I'm getting output from the 4 speed buttons, but nothing from the X, Y, and Z buttons.  Per the program when the X button is pushed it should execute a KEY_RIGHT.  When the Y button is pushed it should execute a KEY_UP, and when the Z button is pushed it should execute KEY_PAGE_UP.    I'm not getting any output from these, I changed the KEY_RIGHT to KEY_7, the KEY_UP to 8, and the KEY_PAGE_UP to 9.  But, still nothing on the screen.  I checked the encoder, and it is changing from high to low state when it's turned.  I rechecked the pin connections and all check out.  Have you ever ran this program?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • mayermakes
    mayermakes over 6 years ago in reply to wildmack

    as it is not my project I haven run the code, but the principle is the same no matter if you use an arduino or teensy.
    I have no teensy to try it out, but looking at the code if ound that the vars X_AXIS, Y_AXIS,Z_AXIS, might be mistaken for statements that belong to a different library as it is marked blue in my IDE.
    I changed it to a different name X_axisr..and so on.
    the code is here, rest is unchanged from the code provided by DJ.
    try it and let me know.


    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • wildmack
    wildmack over 6 years ago in reply to mayermakes

    The code you sent me runs fine.  The purpose of the other code was for it to pick a key stroke to send to the computer, then when you turn the encoder it would keep sending that keystroke.  I changed your code to try the up, down, right, and left and it ran fine.  There must be something in the other code that is working right, but I don't have enough knowledge to understand what all the code is doing.  I only know what it should do.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • mayermakes
    mayermakes over 6 years ago in reply to wildmack

    Well if the one I sent you runs fine, does this solve your problem?
    or is there still an issue?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • wildmack
    wildmack over 6 years ago in reply to mayermakes

    No, the original file included the encoder which would let me keep sending the keystroke that was selected.  The file you sent only had the keystroke part, it didn't include the encoder.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • mayermakes
    mayermakes over 6 years ago in reply to wildmack

    the encoder is included in my file:

     

    long newScrollPos = encoderScroll.read();

     

      if (abs(newScrollPos - lastScrollPos) >= 4) { // there are roughly four presses detected from each rotation to the next detent

        if (newScrollPos - lastScrollPos > -1){ // positive increase

     

     

    but these values refer to DJs specific encoder, so you might have to change these to fit your particular encoder.

    in theory this should work on any encoder that behaves the same, your encoder might differ, but you have allready checked that iirc.

     

    Also did you try pressing the button and scrolling at the same time?
    the code suggests that you may need to hold the axis button while scrolling to send the spoecific keystroke

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • wildmack
    wildmack over 6 years ago in reply to mayermakes

    Wow, I must have loaded the wrong file yesterday.  It was a keystroke program that ran perfect, but thats all it did.  I opened your file, and I see it does include the encoder.  I just tried to load it, but I get this message

    In file included from C:\Users\Dave\Documents\Arduino\libraries\Teensy_3X_Multipurpose_Board/Teensy_3X_Multipurpose_Board.h:2:0,

     

    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

                     from C:\Users\Dave\Documents\Arduino\DH_CNC_Pendant\DH_CNC_Pendant.ino:1:

    C:\Users\Dave\Documents\Arduino\libraries\Servo\src/Servo.h:77:2: error: #error "This library only supports boards with an AVR, SAM, SAMD, NRF52 or STM32F4 processor."

    #error "This library only supports boards with an AVR, SAM, SAMD, NRF52 or STM32F4 processor."

    Multiple libraries were found for "Servo.h"

    Used: C:\Users\Dave\Documents\Arduino\libraries\Servo

    Not used: C:\Program

    Error compiling for board Teensy 3.2 / 3.1.

    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

     

    I can't figure out why it won't load.  I bought the same encoder that's listed in the project, and I did try holding the buttons down while turning the encoder, but still didn't work.  Do you see why the program won't load for me?   Thanks Dave.....

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • mayermakes
    mayermakes over 6 years ago in reply to wildmack

    the error says that it tries to load the Servo.h library, but my code version does not ask for that library at all.

    it refers to this File,  C:\Users\Dave\Documents\Arduino\DH_CNC_Pendant\DH_CNC_Pendant.ino:1:

    which is NOT what you got from me:

     

     

    the correct file is named:

    DH_CNC_PendantAxisR.ino

    in it Servo.h is not used at all.

    You must have loaded a different sketch.

     

    make sure that the Version downloaded form my github is loaded and try again.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • wildmack
    wildmack over 6 years ago in reply to mayermakes

    I loaded your file and get the same results as the other file.  I loaded everything on a new computer because of all the issues I was having with Arduino, but still have the same issue.   The buttons are still sending 1,2,3 and 4   

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • angryboy
    angryboy over 5 years ago in reply to mayermakes

    Hi, do you have a electronic shematic?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2026 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube