collapse

Author Topic: Faceting machine encoder  (Read 3239 times)

Faceting Frank

  • Global Moderator
  • ALF'er VIP
  • *****
  • Posts: 604
Faceting machine encoder
« on: October 28, 2024, 01:57:29 PM »









Have had my encoder setup working for a couple of weeks now and very happy with it. Can set the target angle by pressing a button and have a light on it that comes on as soon as the target angle is passed.
 Many thanks to MackkyBrown and RoughCreations for helping me putting this together. Their ongoing advice through what turned out to be a marathon thread “Faceting machine head assembly” was invaluable. It took me seven months in total from start to finish, working on it an average of about 15-20 hours per week, nearly all of it looking at YouTube vids on programming and wiring up the components. The basic code for this already exists, written by Tom Herbst which can be downloaded from his website www.facetingbook.com. In his book Amateur Gemstone Faceting volume two, he dedicated 24 pages to fitting an encoder to a faceting machine.  This is the code I used, but its way out of date and trying to modify it to suit the newer electronics without understanding the basics of programming can’t be done. Also, he has a lot of code in there for his depth of cut indicator and buzzer, which I want to change to a simple light indicator.
I thought I could help those who wanted to have a go at fitting one, by pointing out which are the best YouTube vids for beginners and what I found to be the most suitable components.
Good YouTube vids.
Paul McWhorter has 36 vids on Arduino programming for beginners. My best choice to get started, though a bit of unnecessary banter in them.
Arduino Tutorial for Beginners. A series of vids on the subject.
Rachel De Barros has a couple of good vids, a bit more advanced and more banter.
There are heaps more to look at.

Apart from the encoder, the other main components I used are being used by the people in the vids. That’s a simple LED screen and a 32 pin DUINO  board with an ESP32 processor on it, that board is near identical to the ones used by people in the vids. This makes following their wiring instructions a piece of cake. Excluding the encoder the above components, plus the required lights, buttons, wiring etc. would come to about $100
Don’t start off with a TFT touch screen, wait till you know what you’re doing with this stuff first.

 My encoder is an Avago Technologies AEDM-5810-Z12 5000cpr encoder with a 6mm hollow shaft. That gives 20,000 positions through 360deg, which means it has an accuracy of 0.018deg per step.

Another bit of useful info is a PDF file called Arduino programming notebook by Brian W Evans. It describes what all the different commands mean and how they are used.

I joined Facebook forums and Arduino programming forums with mixed results. I would suggest you get past the total beginner stage before using them. Otherwise, you won’t have a clue what they’re on about.


« Last Edit: October 30, 2024, 01:42:34 PM by Faceting Frank »

Pro-oz

  • ALF'er Silver Member
  • *
  • Posts: 90
Re: Faceting machine encoder
« Reply #1 on: October 28, 2024, 03:47:54 PM »
Good write up and info. Maybe I'll have a go one day but way over my head, I think. Thanks for sharing.

MakkyBrown

  • Administrator
  • ALF'er VIP
  • *****
  • Posts: 1823
    • Andrew Brown Faceting Designs
Re: Faceting machine encoder
« Reply #2 on: October 29, 2024, 10:02:18 PM »
Well done Frank, impressive how to stuck at it and didn't give up. I think a simple buzzer when the target angle is first hit could be good, wake me up when day dreaming.  And I really want to try the 10,000cpr encoder I have.

Cheers
MB

Faceting Frank

  • Global Moderator
  • ALF'er VIP
  • *****
  • Posts: 604
Re: Faceting machine encoder
« Reply #3 on: October 30, 2024, 09:53:14 AM »
Where the box is located I see the light even when not looking at it.

Faceting Frank

  • Global Moderator
  • ALF'er VIP
  • *****
  • Posts: 604
Re: Faceting machine encoder
« Reply #4 on: December 17, 2024, 01:58:11 PM »
As you will already know MB 10,000cpr would give you a 0.01 increment display. Where as the 5000cpr is mostly 0.02 increments because the 0.018 angle accuracy has the third decimal place rounded up or down.
This is my new encoder box, same programming code and components bar the lights. But all the components are fitted to the enclosure lid, this makes it much easier to fix or replace anything.
Have the lights working as a stop, the green light will come on just prior to reaching the target angle, reaching the target angle will turn the red light on. Target angle in this case being 40 deg.








Target angle 40deg.




Pre target angle reached.




Target angle reached.

RoughCreations

  • Administrator
  • ALF'er Platinum
  • *****
  • Posts: 427
    • Rough Creations homepage
Re: Faceting machine encoder
« Reply #5 on: December 17, 2024, 07:20:58 PM »
I have got the same plastic box for my new housing, I have created a cut-out for the screen but will mount the goodies on the other side of the box to you. A buzzer does work well, but you need the ability to turn it off, or turn the volume down.
Now that you have finished, you can start on the housing for your colour TFT screen, lol.

RC
Rough Creations - Beauty from rough beginnings

Faceting Frank

  • Global Moderator
  • ALF'er VIP
  • *****
  • Posts: 604
Re: Faceting machine encoder
« Reply #6 on: December 22, 2024, 09:52:55 PM »
Not going to bother with a TFT screen or a buzzer RC. Have moved the box so it's on the far side of the lap in my direct line of site, means I don't have to directly look at it while cutting to see the lights. Recommend fitting a pre-target angle light, there is no pause in the loop for it, so it will start to flicker and then go solid. Good for when you're adjusting the mast height as you cut the facet.

RoughCreations

  • Administrator
  • ALF'er Platinum
  • *****
  • Posts: 427
    • Rough Creations homepage
Re: Faceting machine encoder
« Reply #7 on: December 23, 2024, 09:19:13 AM »
Sounds useful. I have been getting regular queries via email and social media regarding fitting an encoder to a Facetron etc. Hopefully it will translate into some more Forum content/activity next year as I usually begin by saying there are some great threads here, like yours, so Register and start asking questions!

RC
Rough Creations - Beauty from rough beginnings

Faceting Frank

  • Global Moderator
  • ALF'er VIP
  • *****
  • Posts: 604
Re: Faceting machine encoder
« Reply #8 on: January 19, 2025, 10:14:49 AM »
Have made a Facet Talk topic up about how and where I got all the info needed to be able to fit my encoder. This forum is at the top of the list (no names mentioned) and the best YouTube vids for beginners like me. About Tom Herbst book and his code, best components to use etc.
It’s 5 pages long plus 9 pics.

RoughCreations

  • Administrator
  • ALF'er Platinum
  • *****
  • Posts: 427
    • Rough Creations homepage
Re: Faceting machine encoder
« Reply #9 on: January 23, 2025, 10:42:16 AM »
Have made a Facet Talk topic up about how and where I got all the info needed to be able to fit my encoder. This forum is at the top of the list (no names mentioned) and the best YouTube vids for beginners like me. About Tom Herbst book and his code, best components to use etc.
It’s 5 pages long plus 9 pics.
If it's appropriate, send a copy at some stage (after publication) and I will put it up as a download on the Forum?
RC
Rough Creations - Beauty from rough beginnings

Faceting Frank

  • Global Moderator
  • ALF'er VIP
  • *****
  • Posts: 604
Re: Faceting machine encoder
« Reply #10 on: January 23, 2025, 10:56:18 AM »
Will do that, Sarah has already sent me a copy of the proof. She has put it all together really well. A couple of mods to do with the text.

Faceting Frank

  • Global Moderator
  • ALF'er VIP
  • *****
  • Posts: 604
Re: Faceting machine encoder
« Reply #11 on: January 23, 2025, 09:15:27 PM »
Thought a bit more about this and I think it would be wrong of me to do that. The final publication created by Sarah really belongs to the Australian Facetors Guild and available to all their members.

RoughCreations

  • Administrator
  • ALF'er Platinum
  • *****
  • Posts: 427
    • Rough Creations homepage
Re: Faceting machine encoder
« Reply #12 on: January 24, 2025, 10:57:36 AM »
Yeah, that's true.
Rough Creations - Beauty from rough beginnings

Faceting Frank

  • Global Moderator
  • ALF'er VIP
  • *****
  • Posts: 604
Re: Faceting machine encoder
« Reply #13 on: February 23, 2025, 10:14:58 AM »
Put a post on this thread a couple of days ago about being able to have the loop run without any delay and the screen refresh at 100ms delay. Tom Herbst had the entire loop running at 100ms delay, which meant the encoder was running at 100ms delay. The LED screen needs some delay in it’s refresh rate to be readable. I deleted the post because the encoder started to play up with this code, it was becoming erratic and not displaying the exact angle.
Not a mechanical problem because I started using the dial gauge to keep track of each facet position. I didn’t change anything in Tom’s code apart from the millis() info. Back to using my old code.

RoughCreations

  • Administrator
  • ALF'er Platinum
  • *****
  • Posts: 427
    • Rough Creations homepage
Re: Faceting machine encoder
« Reply #14 on: February 24, 2025, 09:35:00 AM »
Put a post on this thread a couple of days ago about being able to have the loop run without any delay and the screen refresh at 100ms delay. Tom Herbst had the entire loop running at 100ms delay, which meant the encoder was running at 100ms delay. The LED screen needs some delay in it’s refresh rate to be readable. I deleted the post because the encoder started to play up with this code, it was becoming erratic and not displaying the exact angle.
Not a mechanical problem because I started using the dial gauge to keep track of each facet position. I didn’t change anything in Tom’s code apart from the millis() info. Back to using my old code.
It's been a while since I looked at code for my LCD screen, I am very rusty - mostly been coding for the new TFT.
However:
I had a look at my current LCD code. I have a vague re-collection the "Setup the screen" bit was important:
(make sure you scroll to the bottom of the code window)
Code: [Select]
.
.
.
U8G2_ST7920_128X64_F_SW_SPI u8g2(U8G2_R0, 18, 23, 5, reset_scn); //U8G2_ST7920_128X64_F_SW_SPI(rotation, clock, data, cs [, reset]) [full framebuffer, size = 1024 bytes]
.
.
.
void setup()
{
  //======Setup the screen==============
  pinMode(reset_scn, OUTPUT);
  u8g2.setBusClock(5000000);
  u8g2.begin();
  reset_screen();
  //================================
.
.
.
}

void loop()
{
.
.
}
.
.
void reset_screen()
{
  digitalWrite(reset_scn, LOW);
  delay(100);
  digitalWrite(reset_scn, HIGH);
}

You may have to experiment with the Bus clock speed number, 5000000 in my case
https://github.com/olikraus/u8g2/wiki/u8g2reference#setbusclock

RC
« Last Edit: February 24, 2025, 09:36:32 AM by RoughCreations »
Rough Creations - Beauty from rough beginnings

 

Recent Activities

Butterfly cut by Faceting Frank
[March 19, 2025, 04:51:14 PM]


Pendant findings by Faceting Frank
[March 18, 2025, 12:38:24 PM]


Topaz scratches (aka should've known better) by RoughCreations
[March 15, 2025, 07:00:56 AM]


Resin-bonded 60K diamond lap by RoughCreations
[March 13, 2025, 08:22:58 AM]


Has anyone modified a gemmasta to take a dial gauge on the hard stop? by Rusted
[March 05, 2025, 11:01:12 AM]


Faceting machine encoder by Faceting Frank
[February 24, 2025, 05:16:07 PM]


The Art of Moissanite Cutting: Transforming Rough Stones into Brilliance by MakkyBrown
[February 24, 2025, 02:59:58 PM]


AgateMaster Faceting Machine Bearing Replacement by Bucket
[February 16, 2025, 09:11:49 AM]


Magnetic Encoders by Faceting Frank
[February 14, 2025, 12:36:10 PM]


Anyone Faceted Synthetic Rutile Gem rough? Any Advice. by RoughCreations
[February 14, 2025, 10:46:42 AM]


Recently cut gems (AB Facet Designs) by mehoose
[February 11, 2025, 03:40:59 PM]


rock or stone by Jimnyjerry
[February 08, 2025, 02:07:53 PM]


Hi Back again by Butts
[February 03, 2025, 02:51:19 PM]


Castlemaine Victoria by Rusted
[January 29, 2025, 09:43:25 AM]


Good vs Bad cutting by RoughCreations
[January 21, 2025, 09:52:33 PM]

SimplePortal 2.3.7 © 2008-2025, SimplePortal