collapse

Author Topic: Faceting machine head assembly.  (Read 19834 times)

MakkyBrown

  • Administrator
  • ALF'er VIP
  • *****
  • Posts: 1794
    • Andrew Brown Faceting Designs
Re: Faceting machine head assembly.
« Reply #105 on: June 18, 2024, 04:50:05 PM »
Just looked at the USDigital webpage, Encoders are $78.45 USD + postage. Bit expensive. Might be worth looking at digikey, mouser etc who will do free postage.  But will depend on shaft size if one can be found to suit. Alaskan be careful if you decide to pull yours apart as a spacer tool is need to set the height of the code wheel. You currently have a working machine don't make it nonworking :)
« Last Edit: June 18, 2024, 04:54:30 PM by MakkyBrown »

Alaskan

  • ALF'er Silver Member
  • *
  • Posts: 53
  • Will AI have curiosity and a sense of humor?
Re: Faceting machine head assembly.
« Reply #106 on: June 18, 2024, 10:17:12 PM »
Thanks, MB - this is a learning and kitting stage. I won't be doing anything to this working tool until I feel it's a sure thing. The coding and collection of system integration is way too foggy but that's fun too. Any ideas why my platen-lap only touches nut to edge in a 1/4 (25%) of the lap area? Seems like the swing arm/tower plane is imperfectly aligned - doesn't appear to be affecting facets or lap life - half sweep of the lap and watching the dial dip is my clue. How perfect is tower post to platen plane necessary - the engineer at P8 said if it were perfect the run-out would be 'a block'... unable to move. Hard to argue with that?
« Last Edit: June 18, 2024, 10:19:27 PM by Alaskan »

Alaskan

  • ALF'er Silver Member
  • *
  • Posts: 53
  • Will AI have curiosity and a sense of humor?
Re: Faceting machine head assembly.
« Reply #107 on: June 19, 2024, 06:24:53 AM »
Patriot 8: US Digital E5-900-250-1E-S-D-D-B

M127551 B 5v AI 1/G on the encoder. Sent two images to the gallery but not seeing ithem... tried several x so may delete extras.
The supernova is going to be okay (T close) but C4 is about to touch down with room to spare.

MakkyBrown

  • Administrator
  • ALF'er VIP
  • *****
  • Posts: 1794
    • Andrew Brown Faceting Designs
Re: Faceting machine head assembly.
« Reply #108 on: June 19, 2024, 01:58:41 PM »
Perfect.
US Digital E5-900-250-1E-S-D-D-B
E5 = type
900 = cpr
250 = to suit 1/4inch shaft
IE = has index for calibration
S = Single end low voltage output, what you want to keep it simple.
D = Default case
D = Default cover
B = comes with some tools
You are good to go. Don't have to buy a new encoder yet as you can make a new control box to suit your existing encoder. Once you get that working just change the code slightly when you install the new encoder.

https://www.usdigital.com/media/4g4hyv0p/e5-datasheet.pdf
Maybe what we(between us all) need to do is make up a parts list and code, nothing fancy just displaying the angle and an eprom based calibration function. Maybe a jumper for which side of the machine the encoder is mounted. Then it should be largely fool proof.

Looking forward to seeing a pic of your stone when finished.  :)
« Last Edit: June 19, 2024, 02:01:34 PM by MakkyBrown »

Alaskan

  • ALF'er Silver Member
  • *
  • Posts: 53
  • Will AI have curiosity and a sense of humor?
Re: Faceting machine head assembly.
« Reply #109 on: June 19, 2024, 09:23:16 PM »
Which board do you recommend with Arduino - EBay is piled with choices?

I'm ready to collect the parts and build the box - might as well get it all together - that pale blue lab created Zircon appears to be gone... was hoping to get more - someone beat me to it.

Flying blind here - Been 40 + years since I played with analog/digital components. White cane excited to see this integration.
« Last Edit: June 19, 2024, 09:59:37 PM by Alaskan »

Faceting Frank

  • Global Moderator
  • ALF'er VIP
  • *****
  • Posts: 560
Re: Faceting machine head assembly.
« Reply #110 on: June 20, 2024, 07:16:50 PM »
Did some more research on attachInterrupts, because with Tom’s code it was not reading anything from the encoder. He has attachInterrupts(0,doA,CHANGE); and attachInterrupts(1,doB,CHANGE); for the A and B pins on the encoder, yet he is using pins 2 and 3 on his Arduino board.
Anyway got it working with attachInterrupt(digitalPinToInterrupt(16),doA,CHANGE);
and   attachInterrupt(digitalPinToInterrupt(17),doB,CHANGE); ,pin 16 and 17 being the pins used on my board. Don’t know if that’s the best bit of code, but it works.
Still to fix is the angle going the wrong way from 90deg as I turn the encoder, going higher instead of lower. As well as it still has no memory and will start from the beginning when turned on.
The two pics show the encoder at setting 0 and 5,000, or at least as close as I can get it by hand. That is a 90deg turn, the encoder having 20,000 steps in 360deg.
Ordered a new Arduino esp32s board same as this one for my control box on my machine, want to keep this setup working for my next project. Which is having a fancy screen like RoughCreations.










MakkyBrown

  • Administrator
  • ALF'er VIP
  • *****
  • Posts: 1794
    • Andrew Brown Faceting Designs
Re: Faceting machine head assembly.
« Reply #111 on: June 21, 2024, 12:06:44 AM »
I've been using the NodeMCU ESP32 boards. Frank and RC might be using different one. I might find some time and wire up a new control box, and make a part list.
MB

RoughCreations

  • Administrator
  • ALF'er Platinum
  • *****
  • Posts: 388
    • Rough Creations homepage
Re: Faceting machine head assembly.
« Reply #112 on: June 21, 2024, 11:58:17 AM »
Did some more research on attachInterrupts, because with Tom’s code it was not reading anything from the encoder. He has attachInterrupts(0,doA,CHANGE); and attachInterrupts(1,doB,CHANGE); for the A and B pins on the encoder, yet he is using pins 2 and 3 on his Arduino board.
Anyway got it working with attachInterrupt(digitalPinToInterrupt(16),doA,CHANGE);
and   attachInterrupt(digitalPinToInterrupt(17),doB,CHANGE); ,pin 16 and 17 being the pins used on my board. Don’t know if that’s the best bit of code, but it works.
Still to fix is the angle going the wrong way from 90deg as I turn the encoder, going higher instead of lower. As well as it still has no memory and will start from the beginning when turned on.


Hi Frank, your code for attachInterrupt is the recommended approach. Tom uses a direct interrupt number which works for his board, but not necessarily other boards, and is an earlier way of doing it. Good work!
You will have to save to the EEprom/flash memory to get your state saved between power on/off cycles, or way better: use the preferences library (see my later code) to save as many key-value pairs as you like. The data held in the flash memory persists across resets or power failures.

RC
« Last Edit: June 21, 2024, 11:59:54 AM by RoughCreations »
Rough Creations - Beauty from rough beginnings

Faceting Frank

  • Global Moderator
  • ALF'er VIP
  • *****
  • Posts: 560
Re: Faceting machine head assembly.
« Reply #113 on: June 21, 2024, 01:29:20 PM »
Thanks for the info RC.
That’s the Iveska. FacetronEncoderWithAngleStorageESP_colourTFT_21022024.ino file your talking about? Will have a look through the file later.
Thanks again.

RoughCreations

  • Administrator
  • ALF'er Platinum
  • *****
  • Posts: 388
    • Rough Creations homepage
Re: Faceting machine head assembly.
« Reply #114 on: June 21, 2024, 04:18:19 PM »
Thanks for the info RC.
That’s the Iveska. FacetronEncoderWithAngleStorageESP_colourTFT_21022024.ino file your talking about? Will have a look through the file later.
Thanks again.

That's the one, important lines to setup preferences are:

Code: [Select]
#include <Preferences.h>
.
.
Preferences preferences;
.

Read 3 key-value pairs from preferences:
Code: [Select]
  preferences.begin("encoder", false);
    eenc90 = preferences.getUInt("eenc90", 0);
    eStoredAngle = preferences.getFloat("eStoredAngle", 0.0);
    padTime = preferences.getInt("padTime", 0);
  preferences.end();
Write an unsigned integer key-value pair to preferences:
Code: [Select]
  preferences.begin("encoder", false);
    preferences.putUInt("eenc90", eenc90);
  preferences.end();


RC
Rough Creations - Beauty from rough beginnings

Faceting Frank

  • Global Moderator
  • ALF'er VIP
  • *****
  • Posts: 560
Re: Faceting machine head assembly.
« Reply #115 on: June 22, 2024, 12:35:15 PM »
Thanks for thar RC. Will work out where that best fits in Tom's code.

Alaskan

  • ALF'er Silver Member
  • *
  • Posts: 53
  • Will AI have curiosity and a sense of humor?
Re: Faceting machine head assembly.
« Reply #116 on: June 22, 2024, 10:12:42 PM »
Frank - RC... This ongoing search for a final code sequence looks intimidating - the coding seems hit or miss - MB... how many have working hundredths accuracy in those who are involved - is it the differences in hardware or the coding that are seeming to be having problems? 😳
« Last Edit: June 22, 2024, 10:16:46 PM by Alaskan »

MakkyBrown

  • Administrator
  • ALF'er VIP
  • *****
  • Posts: 1794
    • Andrew Brown Faceting Designs
Re: Faceting machine head assembly.
« Reply #117 on: June 22, 2024, 11:01:02 PM »
It's not too bad Alaskan. I've be using one for years. I want to have a go making a new box with the touch screen. I want to make it fool proof and simple. You can make interface buttons on the touch display. So all that will really be needed is a small 12v powersupply/socket, voltage reg, touch screen, encoder, a few 0.1uf decoupling capacitors, on/off switch, project box, some header pins, and an esp32.Also worth putting a ferrite magnet or two on the lead/cord to the powersupply as faceting machine motors can be noisy.

Faceting Frank

  • Global Moderator
  • ALF'er VIP
  • *****
  • Posts: 560
Re: Faceting machine head assembly.
« Reply #118 on: June 23, 2024, 11:29:22 AM »
Alaskan. It is frustrating at times and I have been working on this off and on for five months with that wired up monster in the pics I’ve posted. To my way of thinking it is much easier to get it working next to my PC and then make a boxed copy with soldered connections to fit on my machine. Apart from the encoder the other parts are dirt cheap. MB and RC have helped me all the way through this and the YouTube tutorials have been invaluable.
My code is copied and pasted into Arduino ide from Tom’s code from his website. The needed changes were for my different encoder and to // out all his depth of cut indicator and buzzer stuff, which I don’t want. // means it will ignore that line of code.
The apparent problems with this code are created by me. The line that Tom has which reads the info from the encoder “attachInterupts(1,doA,CHANGE);”. Was never going to work with my board and pin out, but I didn’t know that and my encoder never moved when turning the dial. So, I searched for a YouTube tutorial on attachInterups and found a 30 minute one that explained all about it. Finally now have it working.
The hardware parts all work ok and the board I’m using is a NodeMCU-32S ESP32s WROOM WiFi+BT 38Pin MCU Development Board for Arduino. That’s their description of it on eBay.

Faceting Frank

  • Global Moderator
  • ALF'er VIP
  • *****
  • Posts: 560
Re: Faceting machine head assembly.
« Reply #119 on: July 06, 2024, 07:13:40 PM »
Progressing a bit more with the encoder setup. Included a bigger screen so I can have more info showing. Reversed the encoder readout in the code so it will show the angle correctly as I move the quill. The encoder readout increases as it is turned clockwise, that is the wrong direction if fitted to the back of the faceting machine.
 Fixed having the angle in the code showing 90deg more than it should be, which is what it does with Toms code, it meant I could not go below 90deg. Now it shows 90deg less than the readout, but that’s ok the number on Toms code line 29 which is used to set the quill at 90deg is 5,000 more. I’m assuming that is what line 29 is for as it works ok for me.
Put a button into the loop to store the target angle. That was simple enough, just copy the current angle and print it on the second row of the screen.
The same person who had the YouTube vid about attachinterupts has one on how to use the millis function. She is really good, takes her time and explains what every line of code does and how to apply it to your project.
 Anyway, I know the numbers on the top line on my screen will be badly affected by any lap flutter. So, I was thinking of using the 20 step encoder I have to create a set of millisecond delays in the millis function. Having the top line print out to suit the dialled in delay the 20 step encoder is set at to suit the lap rotation.
Sounds good, but need to look at more vids on how to make it work.





 

Recent Activities

Good vs Bad cutting by Faceting Frank
[December 01, 2024, 08:47:59 AM]


Tumbling already naturally tumbled rocks/ quartz by Rock gal
[November 26, 2024, 10:36:31 PM]


Pendant findings by Bucket
[November 26, 2024, 02:36:26 PM]


Advice wanted re sanding and polishing a largish piece of petrified wood by hand by Rock gal
[November 21, 2024, 12:09:17 AM]


Black Opal? by Debono
[November 17, 2024, 03:22:50 PM]


Recently cut gems (AB Facet Designs) by swirly
[November 17, 2024, 02:31:38 PM]


Introductions by tinker
[November 14, 2024, 03:46:32 PM]


Vulcan state forest/black springs. First finds by Jimnyjerry
[November 08, 2024, 08:48:48 PM]


(No subject)COLLAPSABLE SIEVE SHAKER by Ranger Itchy
[November 08, 2024, 07:33:07 AM]


Faceting machine head assembly. by Faceting Frank
[November 07, 2024, 02:22:34 PM]


Does anybody know details of pink Dynalap laps by Alaskan
[November 03, 2024, 10:51:16 AM]


Garie Beach by oldbullhubbard
[November 01, 2024, 07:46:22 PM]


CRT Panel Glass by FlashGP
[October 31, 2024, 09:05:31 AM]


Faceting machine encoder by Faceting Frank
[October 30, 2024, 09:53:14 AM]


Andrew Brown's latest design book: Briolettes is out now! by Faceting Frank
[October 30, 2024, 09:48:32 AM]

SimplePortal 2.3.7 © 2008-2024, SimplePortal