Aussie Lapidary Forum

LAPIDARY => Gemstone Faceting => Topic started by: Faceting Frank on January 16, 2024, 02:01:08 PM

Title: Faceting machine head assembly.
Post by: Faceting Frank on January 16, 2024, 02:01:08 PM
Thinking of making a new faceting head for my machine.
Based on a round mast with a round linier bearing for the head assembly to swing on. Linier rail for the base to move back and forth on. Both will help to keep an accurate alignment with the lap regardless of the quill angle.
 Still using the digital gauge, I have to keep accurate recordings of the head assembly position on the mast for each row of facets. Not sure about fitting a digital protractor though. I have a copy of Amateur Gemstone Faceting vol 2 by Tom Herbst, it has 23 pages dedicated to fitting one. OK for getting the initial angle, but not sure about using it as a stop, might just stick with the dial gauge for that. Anyway, will start a thread on it when I start making it.
Title: Re: Faceting machine head assembly.
Post by: JBK on January 16, 2024, 03:19:02 PM
Will be following, 😊👍
Title: Re: Faceting machine head assembly.
Post by: MakkyBrown on January 16, 2024, 04:47:44 PM
I use mine as a stop. The new machine I am building I should get back to. I'd not worry about Tom's book to much, the encoder he is using is a bit on the low resolution side. Grab some code of RC or me. Maybe use one of these nice cheap touch screens available now.
Given how you are comp cutting I'd be temped to go with a 10000cpc 40000ppr encoder from USDigital. This is what I have for the new build. They will give 0.009 degree steps. Is it too accurate time will tell :)

MB
Title: Re: Faceting machine head assembly.
Post by: Faceting Frank on January 16, 2024, 08:38:35 PM
Thanks for the info on encoders MB. I was concerned about using a digital display as a stop because of the flutter when the lap was rotating. A dial gauge does have some flutter in it, but slowing the speed down means you can look at the top of the needle stroke, where as a digital display is a mess of numbers. Or so I think at this stage, but never used one so could be totally wrong about that.
Title: Re: Faceting machine head assembly.
Post by: RoughCreations on January 18, 2024, 04:42:12 PM
This is where I usually chime-in regarding encoders and their digital output. :) Any flutter can be filtered out or smoothed with a simple algorithm in the code, a knob can be added to the display box to change the degree of smoothing on the fly. For this reason and others, an encoder is way more powerful and versatile than an analog dial gauge.
Also refer to: https://aussielapidaryforum.com/forum/index.php?topic=7019.msg61562#msg61562
RC
Title: Re: Faceting machine head assembly.
Post by: Faceting Frank on January 18, 2024, 05:57:36 PM
The encoder looks very impressive, will look into it in more detail when I start to design the quill assembly and quill support. Have already ordered a lot of parts for the mast assembly, including a 20mm linier bearing in an ally housing, 20mm chromed hardened mast. Thrust bearing for that assembly to pivot on. Still going to fit a digital height gauge to record the linier bearing position for each row of facets though. It works really well and I can go back to any facet and be spot on.
Title: Re: Faceting machine head assembly.
Post by: Faceting Frank on February 02, 2024, 07:37:51 PM
Finished most of the CAD drawings for the components, but still waiting for some of the parts. Need them before starting to confirm the stated dimensions are correct. Looked at the US digital website, very informative and looking at the prices won't be going for a 40,000 ppr encoder. As I understand it an encoder of 14400 would give an accuracy of 0.025 deg. Would that be right?
Title: Re: Faceting machine head assembly.
Post by: MakkyBrown on February 02, 2024, 08:31:45 PM
A 10000cpr(40000ppr) encoder would give increments of 0.009 degrees. 90/10000. This is not accuracy, it is more like 10,000 0.009 degree stops(fixed marks on the code wheel). Make sure to get a 3 channel encoder so you can use the index for calibration. Up to you if you get an encoder with a line driver, or without.

MB
Title: Re: Faceting machine head assembly.
Post by: MakkyBrown on February 02, 2024, 08:49:38 PM

A 10000cpr(40000ppr) encoder would give increments of 0.009 degrees. 90/10000. This is not accuracy, it is more like 10,000 0.009 degree stops(fixed marks on the code wheel). Make sure to get a 3 channel encoder so you can use the index for calibration. Up to you if you get an encoder with a line driver, or without.If you are going lower resolution I am using a 5000cpr/20000ppr encoder (Broadcom or Avago), these were available at Digikey and other stores like Element 14. This might do but not sure if it will be good enough for your comp cutting but price was a lot cheaper than USDigital. But covid stuffed supply of lots of things.

MB
Title: Re: Faceting machine head assembly.
Post by: MakkyBrown on February 02, 2024, 09:08:51 PM
https://au.mouser.com/ProductDetail/Broadcom-Avago/AEDM-5810-Z12?qs=nm95cbFn36yryX%2Fd2Onjlw%3D%3D (https://au.mouser.com/ProductDetail/Broadcom-Avago/AEDM-5810-Z12?qs=nm95cbFn36yryX%2Fd2Onjlw%3D%3D)

Most stores do not have stock but Mouser still looks to have a few. This is similar or same as what RC and I are using. 5000cpr/20000ppr, with 3channels.
Title: Re: Faceting machine head assembly.
Post by: Faceting Frank on February 05, 2024, 01:52:49 PM

I can tell by the digital gauge I have fitted to my machine to record the quill support position on the mast that having a 10k CPR encoder would be pointless. I can record the position of facets to 0.01mm, but going back to them after cutting other facets, it would easily be + or – 0.01mm out. So, the realistic accuracy of my machine quill support movement is 0.03mm and that equates to 0.015deg on the quill. A 5k CPR would have increments of 0.018deg.
So, I was looking at US digital E2 encoder 5k CPR with an 8mm hollow shaft to suit my quill shaft. But it says 3 channels on the encoder are optional, but I can’t find on their website where to choose that option.
Title: Re: Faceting machine head assembly.
Post by: Faceting Frank on February 08, 2024, 04:48:20 PM
Looked that Mouser encoder MB, and the options it comes in, but can't see what shaft they are using. 8mm is mentioned (which is what I want), but it's not saying if it's hollow or not and there are no pictures of any of them that show the shaft.
Title: Re: Faceting machine head assembly.
Post by: MakkyBrown on February 08, 2024, 10:42:59 PM
From memory that one was for a 6mm shaft. The centre of the code wheel is hollow with an alen key grub screw. Download the datasheet it should have all the info your want. If your shaft is 8mm machine the end of that goes into the encoder 6mm hole.

MB
Title: Re: Faceting machine head assembly.
Post by: RoughCreations on February 09, 2024, 08:41:59 AM
FYI - see link below to download specification sheet for the encoder used in MB & RC faceting machine modifications:
Download AEDM-5xxx spec sheet (https://aussielapidaryforum.com/storage/AV02-4926EN_DS_AEDM-55xx_2015-06-04-706336.pdf)

Encoder thread (https://aussielapidaryforum.com/forum/index.php?topic=6855.msg61328#msg61328)

RC
Title: Re: Faceting machine head assembly.
Post by: Faceting Frank on February 09, 2024, 07:17:02 PM
Thanks for the info MB and RC. That encoder comes with an 8mm hollow shaft which is good, as it will fit straight onto my machine. So, when I look through their options when placing an order I will be asking more questions.
Title: Re: Faceting machine head assembly.
Post by: MakkyBrown on February 10, 2024, 12:33:09 AM
Thanks for the info MB and RC. That encoder comes with an 8mm hollow shaft which is good, as it will fit straight onto my machine. So, when I look through their options when placing an order I will be asking more questions.
Quiet often they don't stock all the shaft sizes unless you want to order a larger quantity.
Title: Re: Faceting machine head assembly.
Post by: Faceting Frank on February 10, 2024, 01:26:14 PM
I can see they only have the 6mm. Though won't change anything till I'm ready to fit one. By then they may have an 8mm one.
Title: Re: Faceting machine head assembly.
Post by: Faceting Frank on February 14, 2024, 09:17:27 PM
 Have ordered an Avago Technologies AEDM-5810-Z12 5000cpr encoder from Mouser with a 6mm shaft. Not a problem making an adaptor for it to fit my setup. Been taking some pictures of my progress with this, but can’t make any real progress till I get the 20mm chromed mast for the linier bearing. Couldn’t source that here in OZ, so had to get it from China.
Title: Re: Faceting machine head assembly.
Post by: MakkyBrown on February 14, 2024, 09:33:21 PM
Yeah they are the best value encoder. Even if the price has gone up quite a bit of the last few year.
Title: Re: Faceting machine head assembly.
Post by: Faceting Frank on February 15, 2024, 10:29:49 AM
Looking at Tom Herbst book, one of the displays he recommends is a Hitachi HD44780. Also an Arduino Duemilanove microcontroller. Looked at the Hitachi displays and they look ideal, but I wouldn’t have a clue on the best Arduino for the job. I don’t intend to use the encoder as a stop, just the initial setting of the angle and maybe some occasional checks. So could you recommend an Arduino for this MB. Thanks.
Title: Re: Faceting machine head assembly.
Post by: MakkyBrown on February 15, 2024, 11:45:33 PM
You might aswell go with some grunt and get an NodeMCU ESP32 or if on a budget get an Ardriuno Nano. The screens RC have been using are nice color TFT screens. About $20 each. You want to use a good few 0.1uf decoupling capacitors. Talk nicely to RC he has code for the screen.Get voltage reg board aswell, can't remember the chip number will look tomorrow.
Title: Re: Faceting machine head assembly.
Post by: RoughCreations on February 16, 2024, 01:09:02 PM
I would definitely go the ESP32 board. Very powerful for the money, in fact you can get no-name boards as cheap as chips, and have Wifi, Bluetooth etc. You will also be able to directly use my/MB's code more easily.

RC
Title: Re: Faceting machine head assembly.
Post by: Faceting Frank on February 16, 2024, 02:27:59 PM
Thanks for the info MB RC and the offer of the code.
How many capacitors will I need, they come in packs from 10 to 500. The ones that I’m looking at on eBay are 0.1uf 100n 50v y5v 5mm. I can see the TFT screens are better because of the back light in them. The screen which seems to be ok for this is a 3.5” SPI TFT LCD module display screen with touch panel driver, has a lot of connection pins on the back of it. So will need something to fit onto. I assume I don’t want a reversing camera screen. The board is a bit more confusing. The options on eBay are.
NodeMCU-32S ESP32s WROOM Wi-Fi + BT 38Pin MCU Development Board for Arduino
ESP32 NodeMCU Development Board ESP32-Dev Kit 38 PIN Expansion WiFi Bluetooth
ESP32S NodeMcu Development Module 2.4GHz WiFi Bluetooth Dual-Mode Antenna.
Probably all the same thing with the description changed round.
Title: Re: Faceting machine head assembly.
Post by: MakkyBrown on February 16, 2024, 04:04:34 PM
I've used and have a good few of the NodeMCU Esp 32 boards, get two for when you blow one up. They are cheap on alixpress but harder to find which is which. Screen you want a 3.5 Inch LCD Screen Display Module ILI9488 TFT
Like    https://www.ebay.com.au/itm/265724979982?itmmeta=01HPR47HTK2GCGW8EXMA0CF0X2&hash=item3dde716b0e:g:IGkAAOSwKhNhYsZK:sc:AU_AusPostStandardLetterWithTracking!7052!AU!-1&itmprp=enc%3AAQAIAAAA4KJKfB%2FtZv5kZ1ibQTzdBEChBEAmw2IFIJPiYicQ%2BaejMzqCvwFCtfbuosPsjmIj58HPZFwW%2FdVNf%2FvO7Q3XNiV4jMWoVJ4cfWxO%2FtSf1tAw2%2F2zC44ZKWd8zRwDdWlH7oVXlGddc7Ow6Wi2ieaLd3PZGPXR1eLIAsmP99H%2B%2Fe7DTdeIaK%2Bc6ArkAmEP8g8xzsIkffH6x8VOLB6ePRzx922LFlH7ZDgB8FkRY6rvVMO3EEK4iax%2BpqEYGZWtt3mnVlgicNVGZOKUsPfiqqcvXei3494Zp%2BXIsH37P2MLHLnU%7Ctkp%3ABk9SR66dnoS2Yw

Screen some thing like this one. https://www.ebay.com.au/itm/364628661684?itmmeta=01HPR4HEJAF6FRV5G87HZ9MGQ3&hash=item54e58fd5b4:g:VuAAAOSwVVtlemX-&itmprp=enc%3AAQAIAAAAwHo6cNOBu70Qn8jlG47cYSJD6m0D%2Bygpv7CCEu4w1sRrpx%2B67Q2l4Zb8ct1BCGko5oUDtWZOAwXMLlKy%2Favvc5clBAAttL72%2BKUaPP9YCLfwVBO1lPcPWzX5rtZqmPRbXJfmcLgxdSB1On2JClS3%2BFWZxPtgHlfHhcLLtbFNCzciwV8LAgdgX9wtO4lK509eyW7jL7U1NW%2BvrtbD%2B7O59yOWQXVGd28kcytwVwY9yVkpVL9OmwEYeaT503sM3x1tSQ%3D%3D%7Ctkp%3ABk9SR57pxYS2Yw (https://www.ebay.com.au/itm/364628661684?itmmeta=01HPR4HEJAF6FRV5G87HZ9MGQ3&hash=item54e58fd5b4:g:VuAAAOSwVVtlemX-&itmprp=enc%3AAQAIAAAAwHo6cNOBu70Qn8jlG47cYSJD6m0D%2Bygpv7CCEu4w1sRrpx%2B67Q2l4Zb8ct1BCGko5oUDtWZOAwXMLlKy%2Favvc5clBAAttL72%2BKUaPP9YCLfwVBO1lPcPWzX5rtZqmPRbXJfmcLgxdSB1On2JClS3%2BFWZxPtgHlfHhcLLtbFNCzciwV8LAgdgX9wtO4lK509eyW7jL7U1NW%2BvrtbD%2B7O59yOWQXVGd28kcytwVwY9yVkpVL9OmwEYeaT503sM3x1tSQ%3D%3D%7Ctkp%3ABk9SR57pxYS2Yw)
Title: Re: Faceting machine head assembly.
Post by: MakkyBrown on February 16, 2024, 04:12:15 PM
https://www.jaycar.com.au/0-1uf-50v-blue-chip-monolithic-capacitor-pack-of-100/p/RC5496 (https://www.jaycar.com.au/0-1uf-50v-blue-chip-monolithic-capacitor-pack-of-100/p/RC5496)
I think I purchased the above, pm me your address and I'll send you a few. I used maybe five, RC may have not used any. My motor is very noisy. 

EDIT: Maybe just buy the 100 pack as you will used them on other projects and modding your current one.
Your going to need a project board or two, header pins, a cable. Project box, get a plastic not aluminum so there is less chance of blowing stuff up/shorting to case.
Title: Re: Faceting machine head assembly.
Post by: Faceting Frank on February 16, 2024, 07:14:30 PM
Saved those links, will look at them tomorrow. Thanks.
Title: Re: Faceting machine head assembly.
Post by: Faceting Frank on February 17, 2024, 09:22:24 AM
Ordered the board, screen and caps. So, when I have all the bits will start to put it all together. Don't need to have the machine ready to do that.
Title: Re: Faceting machine head assembly.
Post by: Faceting Frank on February 23, 2024, 10:10:37 PM
The two ESP 32 boards I ordered arrived today for my encoder, but don’t understand what they are meant to do. Looking at all the prongs on the back they are meant to plug into something. The board RC is using with his encoder is similar to the one Tom Herbst shows in his book. So, the question is have I got the wrong parts and need to get the same board as RC. Thanks.(https://aussielapidaryforum.com/forum/gallery/10/medium_120565-230224220705.jpeg) (https://aussielapidaryforum.com/forum/index.php?action=gallery;sa=view;id=10058)
Title: Re: Faceting machine head assembly.
Post by: RoughCreations on February 24, 2024, 10:59:58 AM
Hi Frank,
All good so far. My board is just a different form-factor - same basic components that are just arranged differently and the physical size is smaller with yours, I would get the one you got probably in future. The ESP32 is basically the processor chip on your board. You can plug it into a shield, or just solder it to a experimenter's board to make your connections nicer to the encoder, buttons, screen etc.
Will post a bit more when I get some more time,
RC
Title: Re: Faceting machine head assembly.
Post by: MakkyBrown on February 25, 2024, 12:35:03 PM
The two ESP 32 boards I ordered arrived today for my encoder, but don’t understand what they are meant to do. Looking at all the prongs on the back they are meant to plug into something. The board RC is using with his encoder is similar to the one Tom Herbst shows in his book. So, the question is have I got the wrong parts and need to get the same board as RC. Thanks.
Best way is getting some female header pins and soldering them into a project board. That way the EPS 32 can easily be removed if needed as they are really hard to unsolder. I will try and reply more later, bit busy.
(https://aussielapidaryforum.com/forum/gallery/10/medium_5704-250224123331.jpeg) (https://aussielapidaryforum.com/forum/index.php?action=gallery;sa=view;id=10059)
(https://aussielapidaryforum.com/forum/gallery/10/medium_5704-250224123429.jpeg) (https://aussielapidaryforum.com/forum/index.php?action=gallery;sa=view;id=10060)

Title: Re: Faceting machine head assembly.
Post by: Faceting Frank on February 25, 2024, 07:33:07 PM
Ordered the female header pins and a board the same as RC's, also an encoder cable the same as RC's. So must be getting close to having all the required parts.
Title: Re: Faceting machine head assembly.
Post by: MakkyBrown on February 25, 2024, 11:30:53 PM
How you planning to power it ? Definitely can power the encoder off the ESP 32 5V output, not sure if it can power the screen as well. Might be worth getting some voltage regulators one to VIN the ESP 32 and another for 5V to the screen. I have to check screen voltage.

I am bit rusty on it all atm will have to have a look at what all the voltages are including the logic voltages.
Might help if you draw up a schematic of the wiring and components etc. Read the data sheets. And I'll have a look at the screen I have wired up to an esp 32, screen and stepper tomorrow.
Title: Re: Faceting machine head assembly.
Post by: RoughCreations on February 26, 2024, 04:33:52 PM
I am bit rusty on it all atm will have to have a look at what all the voltages are including the logic voltages.
Might help if you draw up a schematic of the wiring and components etc. Read the data sheets. And I'll have a look at the screen I have wired up to an esp 32, screen and stepper tomorrow.
MB - I have been having a bit of a go at updating my code for use with the 480x320 colour TFT screens.
Found it interesting that you need to employ the use of Sprites for displaying the live encoder angle information for decent performance, i.e. no flickering with these screens. You create a Sprite (which is a fraction of the actual available screen real estate) using the TFT_eSPI library, draw to it, and then finally 'push' the Sprite (visibly update it) when needed, but not unnecessarily frequently, as this degrades performance. The smaller you make the Sprite, the better the performance if the Sprite is being pushed every loop. Visual elements that don't need to be updated every loop (such as fixed text) can still go in a Sprite, but are only pushed once at the beginning in the Setup() part of the code.
RC
Title: Re: Faceting machine head assembly.
Post by: Faceting Frank on February 26, 2024, 07:46:39 PM
Got the screen today, but have not downloaded the data sheet on it yet. Would prefer to have all the parts before trying to work out how it's all going to work. The mechanical parts of this build are going well and have taken a few pics as it progresses. Will start a new thread on this build shortly.
Title: Re: Faceting machine head assembly.
Post by: Faceting Frank on March 04, 2024, 02:20:16 PM
Now have all the parts I need to get the encoder working (I think), already have a suitable sized plastic control box. Saved a few You Tube links on wiring the esp32 to the screen some have links on getting code for the esp32 to ILI9488 touch screen. Will run them off my laptop USB and play around with it till I have a better understanding of it all. Then see how to connect the encoder to the esp32.(https://aussielapidaryforum.com/forum/gallery/10/medium_120565-040324141505.jpeg) (https://aussielapidaryforum.com/forum/index.php?action=gallery;sa=view;id=10061)
Title: Re: Faceting machine head assembly.
Post by: Faceting Frank on March 04, 2024, 03:11:52 PM
Just discovered the jumper cables I've bought are square pin and the board has round holes. So, it seems there are square holed solderless boards. Have just ordered a couple, plenty more stuff ups to come before I get this finished.
Title: Re: Faceting machine head assembly.
Post by: RoughCreations on March 04, 2024, 04:28:08 PM
Just discovered the jumper cables I've bought are square pin and the board has round holes. So, it seems there are square holed solderless boards. Have just ordered a couple, plenty more stuff ups to come before I get this finished.
Hi Frank,
The jumper cables are just for testing or prototyping, they should clip on fine to the pins on the screen, encoder and the ESP32.
Once you are happy with your basic circuit, you will solder most of your connections anyhow.

RC
Title: Re: Faceting machine head assembly.
Post by: RoughCreations on March 04, 2024, 04:30:41 PM
Now have all the parts I need to get the encoder working (I think), already have a suitable sized plastic control box. Saved a few You Tube links on wiring the esp32 to the screen some have links on getting code for the esp32 to ILI9488 touch screen. Will run them off my laptop USB and play around with it till I have a better understanding of it all. Then see how to connect the encoder to the esp32.
Might pay to use the same pin numbers on the ESP32 board as myself or MB, then it will be easier to exchange code between us.
Title: Re: Faceting machine head assembly.
Post by: Faceting Frank on March 04, 2024, 09:04:34 PM
Thanks for the help regarding the code. I will wait to get the new board before looking at this again, I understand that the plug-in thing is just to get it working first.
Title: Re: Faceting machine head assembly.
Post by: RoughCreations on March 04, 2024, 09:27:18 PM
Hi Frank,
There's nothing wrong with the nodeMCU ESP32 boards you originally got, the pin numbers will correspond to my Arduino Uno form-factor ESP32 board anyhow. Won't hurt to have some spares either way. As MB said earlier, two rows of 19 female header pins soldered to your project board will form the final mount for your ESP32 board. This will give you the ability to easily remove a board for replacement if ever required without having to solder/de-solder.
The following is my board to screen connection diagram, there are other variations to connect them together of course.

My board to screen connections (https://www.lveska.com/photos/ESP_TFT_circuit_drawing.pdf)

RC
Title: Re: Faceting machine head assembly.
Post by: Faceting Frank on March 05, 2024, 08:53:24 AM
Thanks RC, have saved that picture.
Title: Re: Faceting machine head assembly.
Post by: RoughCreations on March 05, 2024, 10:16:44 AM
Thanks RC, have saved that picture.
No worries, I have now updated the pdf to include the encoder wiring I used as well, please re-visit the link above to see the latest version,

RC
Title: Re: Faceting machine head assembly.
Post by: Faceting Frank on March 05, 2024, 10:40:04 AM
Thanks, have saved that. So, the whole thing is powered by the 5v USB on the esp32?
Title: Re: Faceting machine head assembly.
Post by: RoughCreations on March 05, 2024, 11:18:47 AM
Thanks, have saved that. So, the whole thing is powered by the 5v USB on the esp32?
The micro USB port powers everything - board, screen and encoder while you are experimenting, and allows uploading of code to the ESP32 board. When you are finished developing and want to install it into your plastic enclosure, a DC power adapter can power it all via the standard plug pack socket you can see on my board, or as MB has previously said, you can include a small voltage regulator board (Jaycar sell them for a few dollars) located between a plug pack adapter and the ESP32, which is what I have done. This allows you to put in a power switch if you want more easily too.

RC
Title: Re: Faceting machine head assembly.
Post by: RoughCreations on March 05, 2024, 11:39:42 AM
Just to prove I have nothing up my sleeve:

https://youtu.be/2KaA5wX_N9U
Title: Re: Faceting machine head assembly.
Post by: Faceting Frank on March 05, 2024, 04:34:42 PM
Looked at your video RC, looks good. When I bought the esp32, I didn’t know there were heaps of variants. But looking at info on them on the net, they are much the same with some having added features. Mine is a esp32s 38pin, they came as a pair for $25 inc. postage. Have downloaded some pinout drawings of them so I can get an idea of which pins match on different boards.(https://aussielapidaryforum.com/forum/gallery/10/medium_120565-050324163220.jpeg) (https://aussielapidaryforum.com/forum/index.php?action=gallery;sa=view;id=10063)
Title: Re: Faceting machine head assembly.
Post by: Faceting Frank on March 05, 2024, 04:41:42 PM
Can't make out the pin numbers, will take a better picture tomorrow.
Title: Re: Faceting machine head assembly.
Post by: Faceting Frank on March 06, 2024, 10:29:27 AM
MB recommended me getting the esp32S, which is different to yours RC, as it has 38 pins. So, MB must have a different wiring setup. The pin setup on the drawing of this esp32 is the same as mine, baring the numbered pins start with the letter G and mine start with P. I assume that means nothing. This board only has one 5v output, but the screen will run on 3.3v, so I can power the screen from the 3.3v and back to the GND on the opposite side. I will wait till I get my square pinned board before starting, as the cables I have are square pinned and I only need to solder it up when it all works.(https://aussielapidaryforum.com/forum/gallery/10/medium_120565-060324102707.jpeg) (https://aussielapidaryforum.com/forum/index.php?action=gallery;sa=view;id=10064)
Title: Re: Faceting machine head assembly.
Post by: RoughCreations on March 06, 2024, 01:10:41 PM
Thanks for the diagram of your board, could be helpful if there is any troubleshooting required. I have included the diagram for my current board for a reference. I think you should be able to use many of the same pin numbers as me initially, if that helps. You should be able to connect more than one wire to your 5V pin if required, i.e the encoder and screen VCC could both go to your 5V pin.

(https://aussielapidaryforum.com/forum/gallery/10/medium_112303-060324130944.jpeg) (https://aussielapidaryforum.com/forum/index.php?action=gallery;sa=view;id=10065)
Title: Re: Faceting machine head assembly.
Post by: Faceting Frank on March 06, 2024, 01:34:56 PM
Thanks for that RC, will be able to look at your wired up picture and compare it to this diagram and my diagram.
Title: Re: Faceting machine head assembly.
Post by: MakkyBrown on March 06, 2024, 06:02:44 PM
The Nodemcu esp 32 are pretty good and supported. Some of the Chinese ones will cause you grief.
Title: Re: Faceting machine head assembly.
Post by: Faceting Frank on March 07, 2024, 04:27:17 PM
Made a wiring diagram based on your info RC. Just put the basic description of the pins on the drawing, the reset on the 38 pin model is the EN pin. Did Google for info about connecting both the encoder and screen from the same 5v outlet on the esp32. Didn’t find a that’s ok answer, so powering the screen from the 3.3v pin and opposite ground pin.
As far as I can see the drawing is correct. So fingers crossed when I wire it up.
(https://aussielapidaryforum.com/forum/gallery/10/medium_120565-070324162434.jpeg) (https://aussielapidaryforum.com/forum/index.php?action=gallery;sa=view;id=10066)
Title: Re: Faceting machine head assembly.
Post by: Faceting Frank on March 07, 2024, 04:29:20 PM
For some reason it's on it's side. Will fix that.
Title: Re: Faceting machine head assembly.
Post by: Faceting Frank on March 07, 2024, 04:44:31 PM
Very strange, I've uploaded that picture three times and it turns it on its side every time. Even if I turn it on my PC, it will turn it back.
Title: Re: Faceting machine head assembly.
Post by: RoughCreations on March 07, 2024, 08:55:13 PM
Made a wiring diagram based on your info RC. Just put the basic description of the pins on the drawing, the reset on the 38 pin model is the EN pin. Did Google for info about connecting both the encoder and screen from the same 5v outlet on the esp32. Didn’t find a that’s ok answer, so powering the screen from the 3.3v pin and opposite ground pin.
As far as I can see the drawing is correct. So fingers crossed when I wire it up.

Looks promising. I would probably check first that you can upload code to the ESP32 OK by trying one of the simple example bits of code that are available in the Arduino IDE, and then go from there.
Title: Re: Faceting machine head assembly.
Post by: MakkyBrown on March 08, 2024, 09:17:45 AM
I was planning to put one to these TXS0108E between the encoder and ESP32. Converting the encoders 5V logic/ ESP 32 3.3V logic.
https://www.ebay.com.au/itm/155075908644?itmmeta=01HRDFGJPEZT0G9WESMETTJP0F&hash=item241b3e9424:g:ixYAAOSwNZxjOQzn&itmprp=enc%3AAQAIAAAA4EqeDEz9czKxkHM%2FcTItG0GcX9XnIR58gKS7qURbMwpKL7pjNn4lujMtYJJdNEer0UJdWrce3KvDmQu8bx56QZaG95bCgG0I7bkiTNVVe1iFdFKx3AWMFYJGyLTs0gsztjCRSqMcq0AqoO1tcFHBPQdJGYf%2BoADmBPpwfonnXPZwmLy9Y3Gzzb%2FVvmdbe8sQabyJiG9cYlLNRZEoY7oAUeMkqrzwOJfEHs0jN663guzzKgP91pHifc0geNIq1zfLOKAhKe7HvPzkL8nO4ykuqwaBhdtrXszgyGc5wFLHnUSP%7Ctkp%3ABFBMqKvCr8Nj
Title: Re: Faceting machine head assembly.
Post by: Ghost on March 08, 2024, 09:59:01 AM
1. If someone wants to look at the upside down diagram, drag it to the Desktop and use a viewing or drawing package to rotate it.
2. Try loading an upside down version and see if that comes out the right way up.
Just rambling.
Ghost.
Title: Re: Faceting machine head assembly.
Post by: Faceting Frank on March 08, 2024, 10:22:50 AM
MB, the screen runs on 3.3v to 5v, so it should work fine on the esp32 3.3v pin. Ghost, for some reason the drawing was turned 90deg to the right, so I turned the drawing 90deg left on my PC and uploaded that and it turned it 180deg right. Since then it has now turned the drawing another 90deg, so now its upside down. There is an edit picture option on here and I turned it round the right way up, but it won't save the changes.
Title: Re: Faceting machine head assembly.
Post by: Ghost on March 08, 2024, 10:40:39 AM
LOL.
At computers, not you.
Ghost
Title: Re: Faceting machine head assembly.
Post by: RoughCreations on March 08, 2024, 11:45:45 AM
MB, the screen runs on 3.3v to 5v, so it should work fine on the esp32 3.3v pin. Ghost, for some reason the drawing was turned 90deg to the right, so I turned the drawing 90deg left on my PC and uploaded that and it turned it 180deg right. Since then it has now turned the drawing another 90deg, so now its upside down. There is an edit picture option on here and I turned it round the right way up, but it won't save the changes.

FYI Think it is to do with the EXIF information that is embedded in the image by your camera/phone. I had this problem a while back with a rogue image doing the same. Can't remember how I fixed it, lol.
https://jdhao.github.io/2019/07/31/image_rotation_exif_info/ (https://jdhao.github.io/2019/07/31/image_rotation_exif_info/)
Title: Re: Faceting machine head assembly.
Post by: RoughCreations on March 08, 2024, 11:50:20 AM
MB, the screen runs on 3.3v to 5v, so it should work fine on the esp32 3.3v pin. Ghost, for some reason the drawing was turned 90deg to the right, so I turned the drawing 90deg left on my PC and uploaded that and it turned it 180deg right. Since then it has now turned the drawing another 90deg, so now its upside down. There is an edit picture option on here and I turned it round the right way up, but it won't save the changes.

Just to confirm, I connected the VCC pin of the TFT screen to the 3V3 pin on the ESP32, all works fine.

RC
Title: Re: Faceting machine head assembly.
Post by: MakkyBrown on March 08, 2024, 10:22:34 PM
It's not the screen, but the encoder 5V logic the converter is for. I don't think the ESP32 pins are rated for 5V logic input. Might work but but for how long.

The pic I sent you showed the pinout I'm using for the screen(including touch) and it works.
Title: Re: Faceting machine head assembly.
Post by: Faceting Frank on March 08, 2024, 11:31:55 PM
As I understand it the USB power inlet on the esp32 is 5v. The esp32s 38pin has only one 5v pin outlet (which I’m using for the encoder) and one 3.3v. pin outlet (which I’m using for the screen). RC has kindly tried his 3.3v outlet on his screen and it works ok.
None of this is wired up yet, so I’m only assuming this is going to work ok. The link you put on MB regarding the TXS0108E 8 channel bi directional logic level converter module, is way over my head as to what it does.
I greatly appreciate the time you are both spending helping me with this.
Title: Re: Faceting machine head assembly.
Post by: MakkyBrown on March 09, 2024, 08:11:28 AM
That is correct wiring the screen to 3.3v and encoder 5V output. There is an on board 5V regulator that feeds the pin. Might be 0.5A.
It is the logic connections outputs from the encoder A, B, I that probably need converting. This can be done with resistors but the logic converter is easier. If you wired it up with out the converter it would probably work, but it is a question of how long as the ESP32 is not rated for 5V logic.
Here is a discussion from the official ESP32 forum.

https://esp32.com/viewtopic.php?t=877
Use the logic convertor, I'd assume each channel is just wired up inline, then connect 5V, 3.3V and GND. There are other cheap converter boards, there is a 4 channel one but it might be more expensive. Lot of tutorials online, like this one I haven't watched.
https://www.youtube.com/watch?v=f7aySy_0URE


Title: Re: Faceting machine head assembly.
Post by: MakkyBrown on March 09, 2024, 08:20:00 AM
Here is the commonly available 4 Channel one. Bit cheaper. I think you wire it HV = 5V, LV = 3.3V. GND = GND, Connect HV1, HV2, HV3 to the encoder output, LV1, LV2, LV3 to ESP input pins.

https://www.ebay.com.au/itm/266692929404?itmmeta=01HRFZZ5JAWPE19RMAZZFTG545&hash=item3e1823277c:g:Z0MAAOSwG1Rl3aAv&itmprp=enc%3AAQAIAAAA4M56MQvm9hF61RAE2Tt8zfdbE%2BQDM%2BCllWlgc8oBDiFnmu%2Frgcnj5RDOadm6HZFlA701P1vkymKlsC6Os3kUjtpyPcv3DsWKPfzuB3CUaBjK0SKMxjtcNOczkfTKIyhA%2Fb%2BFhZe1au3trhzyM568EYnYEtyA399nu0svQ0xD2nd%2BugGjzj3%2BWcqC49ddY3bnZsdABoBWkR98ViUDBluqqUs861xe2xi%2FFog76C05sLsD%2BK4uzdmyTSQ9hCiBB6nHgo%2BvqdxSYfwL5lN8W7yXt%2FbZ4uYlo23yDDakfE7KOmaY%7Ctkp%3ABk9SR57Z_P_DYw (https://www.ebay.com.au/itm/266692929404?itmmeta=01HRFZZ5JAWPE19RMAZZFTG545&hash=item3e1823277c:g:Z0MAAOSwG1Rl3aAv&itmprp=enc%3AAQAIAAAA4M56MQvm9hF61RAE2Tt8zfdbE%2BQDM%2BCllWlgc8oBDiFnmu%2Frgcnj5RDOadm6HZFlA701P1vkymKlsC6Os3kUjtpyPcv3DsWKPfzuB3CUaBjK0SKMxjtcNOczkfTKIyhA%2Fb%2BFhZe1au3trhzyM568EYnYEtyA399nu0svQ0xD2nd%2BugGjzj3%2BWcqC49ddY3bnZsdABoBWkR98ViUDBluqqUs861xe2xi%2FFog76C05sLsD%2BK4uzdmyTSQ9hCiBB6nHgo%2BvqdxSYfwL5lN8W7yXt%2FbZ4uYlo23yDDakfE7KOmaY%7Ctkp%3ABk9SR57Z_P_DYw)

Tutorial

https://learn.sparkfun.com/tutorials/bi-directional-logic-level-converter-hookup-guide/all (https://learn.sparkfun.com/tutorials/bi-directional-logic-level-converter-hookup-guide/all)
Title: Re: Faceting machine head assembly.
Post by: Faceting Frank on March 09, 2024, 12:10:33 PM
Ordered a TXS0108E, so I can convert the 3.3v outlet on the esp32 to 5v for the screen. RC is powering his encoder directly from the 5v on the esp32 and connecting all the rest of the encoder connections directly to the esp32. That must work ok, so will stick with that. Saved quite a few links to You Tube vids on connecting rotary encoders to arduino’s to displays. Will have to go through them and keep the ones most relevant and easy to follow.
Not going to worry about the upside down drawing, it can stay that way.
Title: Re: Faceting machine head assembly.
Post by: MakkyBrown on March 09, 2024, 12:35:16 PM
"connecting all the rest of the encoder connections directly to the esp32. That must work ok, so will stick with that."
It might work but it is incorrect. That is what the  TXS0108E is for, converting the A, B ,I encoder output signals to 3.3V from 5V. The ESP 32 is not rated for 5V logic.
Read this link again from the ESP32 manufactures forum.
https://esp32.com/viewtopic.php?t=877 (https://esp32.com/viewtopic.php?t=877)
The ESP8266 RC has uses 3.3volt logic as well i think. I have some TXS0108E if  RC wanted one to try, have to crab it before Tuesday arvo. I also have NodeMCU ESP 32s. Or I could drop it in his letter box when I head off to Flinders.
Title: Re: Faceting machine head assembly.
Post by: Faceting Frank on March 09, 2024, 03:21:55 PM
I don't understand what those guys are on about on that link. I do know the encoder power input requires 5v and the esp32 power outlet I'm using is 5v. That converter module will change the esp32 3.3v outlet to 5v for the screen.
Title: Re: Faceting machine head assembly.
Post by: RoughCreations on March 09, 2024, 07:29:07 PM
Away this long weekend. Didn't realise the esp32 required 3.3V logic, makes sense. Will aim at hooking up a logic level converter you posted a link to MB into my circuit to do things properly and long-term.

RC
Title: Re: Faceting machine head assembly.
Post by: Faceting Frank on March 19, 2024, 04:15:58 PM
Got the 5v to 3.3v wired-up to the screen. Installed Arduino IDE on my PC and the cp2102 bridge controller, have the node mcu-32s setup in the Arduino, so I can now learn how to make “sketches”.
 Found some good You Tube vids for beginners on this after spending hours watching rubbish. Realised I must learn how this is all going to work, or if anything goes wrong, I’m stuffed. So, hopefully a couple of months from now will have the encoder setup and ready to fit to my machine.




(https://aussielapidaryforum.com/forum/gallery/10/medium_120565-190324160641.jpeg) (https://aussielapidaryforum.com/forum/index.php?action=gallery;sa=view;id=10095)
Title: Re: Faceting machine head assembly.
Post by: RoughCreations on March 19, 2024, 08:55:02 PM
Looking good. I would be tempted to start by running some of the example Sketches (programs) found under: File ... Examples ... ESP32 ... in the Arduino IDE menu.
Or even: File .. Examples ... 01.Basics.
See if you can get the Sketches to compile, then see if you can make changes to understand cause and effect.
You will have to configure your TFT screen libraries, (TFT_eSPI library) etc. before the screen will display stuff.
I will give you access to my online Github code repository.
RC
Title: Re: Faceting machine head assembly.
Post by: Faceting Frank on March 21, 2024, 09:56:28 AM
Just spending a couple of hours per day on the programming ATM, because I want the mast and quill assembly finished and working. That part is going well and will keep my other thread up to date on it. Then I can spend a lot more time on the screen and encoder.
Title: Re: Faceting machine head assembly.
Post by: Faceting Frank on April 15, 2024, 07:45:43 PM
Spent some more time on my encoder setup lately.
Finally got the screen test program working. The info I got from the net was that my ILI9488 screen would work with the ILI9341 driver in Arduino. But this does not seem to be the case and cannot find an ILI9488 driver to upload into Arduino IDE.
Most of YouTube vids on this subject seem to be using the Arduino Uno board and ILI9341 screen, so I ditched the ESP32s and got an ESPUNO-32 board and ILI9341 screen. It’s much easier to follow the YouTube vids if you have the same setup as they have.
Getting some of those wires that come in different lengths and are bent at the ends to fit flat onto the development board, my current cable setup is good for trying things out, but they come out at the slightest touch.
The 5v to 3.3v converter is a real pain to use and needs to be soldered to it’s pins to work properly. Disconnected it to take this photo.
Still a lot to learn on how to make this all work on my machine.

(https://aussielapidaryforum.com/forum/gallery/10/medium_120565-150424194307.jpeg) (https://aussielapidaryforum.com/forum/index.php?action=gallery;sa=view;id=10113)
Title: Re: Faceting machine head assembly.
Post by: RoughCreations on April 16, 2024, 04:24:46 PM

Finally got the screen test program working. The info I got from the net was that my ILI9488 screen would work with the ILI9341 driver in Arduino. But this does not seem to be the case and cannot find an ILI9488 driver to upload into Arduino IDE.

Hi, you will need to install the TFT_eSPI and TFT_eWidget libraries by Bodmer, as it is the ones MB and I use. Use the Library Manager in the Arduino IDE to install the latest version. The IDE installs the libraries automatically from memory once you find the libraries in the IDE sidebar. Then there are a couple of steps to configure the libraries for your screen. I tried to make you a collaborator on my Github code repository a few weeks back, you should have got an email from Github. Let me know if you didn't receive it and I will try again.

RC
Title: Re: Faceting machine head assembly.
Post by: Faceting Frank on April 16, 2024, 08:04:48 PM
Didn’t get an email from  Github RC, checked the deleted emails folder in case the wife deleted it and nothing there. Did include the TFT_eSPI library, but not the TFT_eWidget with the ILI9488 screen.
I have the ILI9341 working, so can get the ILI9488 screen to work later on.
Title: Re: Faceting machine head assembly.
Post by: Faceting Frank on April 17, 2024, 12:26:26 PM
Can now access the Github site RC. Thanks.
SimplePortal 2.3.7 © 2008-2024, SimplePortal