collapse

Author Topic: Magnetic Encoders  (Read 4165 times)

Faceting Frank

  • Global Moderator
  • ALF'er VIP
  • *****
  • Posts: 609
Re: Magnetic Encoders
« Reply #30 on: February 14, 2025, 12:36:10 PM »
I get what you mean with the linear meter RC.
Thought I would see what happened when I changed the 100ms millis() delay Tom has in his loop to 5ms and cut an 8 faceted centre point at 40deg with it. 1200 lap at about 400rpm using my usual method of not swinging the stone from side to side once the green light comes on and stopping with the red light.
It was 10x loupe perfect, which is great.
So, it appears that if the lap is not going to fast and the facet is not moving from side to side with the encoder and red light reading at 5ms, I can get away without averaging. The only thing I need to do is change the screen and green light refresh rate to 100ms because the flicker is annoying.

Nerb

  • ALF'er Bronze Member
  • *
  • Posts: 15
Re: Magnetic Encoders
« Reply #31 on: March 25, 2025, 12:56:55 AM »
The better magnets from Infineon arrived on Saturday.  Carefully glued one into the protractor I am using to test the idea and code.
What a difference between these and the ones purchased from China!
Both are diametrically magnetized , difference appears to be these are better balanced with equal strength for both poles.
The odd jumps as the magnet rotated are gone. It is now an even progression as the magnet is rotated over the chip.
Back to messing around with the code again.
They sent 3 so am set, could not find these when trying to purchase magnets so ended up buying from a Chinese source.

RoughCreations

  • Administrator
  • ALF'er Platinum
  • *****
  • Posts: 428
    • Rough Creations homepage
Re: Magnetic Encoders
« Reply #32 on: April 03, 2025, 09:03:44 AM »
Sounds encouraging, be interested in seeing a photo of your testing setup and what the magnets look like.
RC
Rough Creations - Beauty from rough beginnings

Nerb

  • ALF'er Bronze Member
  • *
  • Posts: 15
Re: Magnetic Encoders
« Reply #33 on: April 14, 2025, 09:36:40 PM »
Already moved past the testing gizmo as the wife wanted to park in the garage again.
Since it is working sent the board designs off and am waiting for them to arrive.
Then will start creating the board housing.

Had to design a little PID controlled hotplate
since the odds are using the hot air rework station on the tiny SMD parts would not go well.
Would have ordered one but ummmm someone with a big stick is really stirring up the ants.
Noticing lots of parts I used to order are either unobtainium or really jumping in price.

Here's the board design, uses a JST PH right angle connector on the other side.

https://imgur.com/a/dYHWHCC

Nerb

  • ALF'er Bronze Member
  • *
  • Posts: 15
Re: Magnetic Encoders
« Reply #34 on: April 15, 2025, 12:22:36 AM »
Here is the little PID controlled hotplate. Warning nerd stuff below.

https://imgur.com/a/3wxUhmN

Used some of the spare stuff I had laying around. Arduino Nano, rotary encoder , little display with a SSR to control a 300W PTC hotplate.
Had some old ceramic standoffs so cut them down and used them with a bit of insulation to protect the 3d printed box.
Tried using the hotplate by itself and it was way to hot so it cooked the little test board I tried it on.  The ATtiny85 did not work after.  Figured I'd test with a ATtiny85 as they have similar ratings for heat and are much lower in cost.

This in manual mode was set to150°C with the board  on it until I see the low temp solder paste melt then I quickly remove the pcb's. Not as fancy as a real plate but the new test board survived fine on it.Eventually I'll figure out what I want the auto mode to do.

Should work fine to place parts on the boards.
« Last Edit: April 15, 2025, 12:26:17 AM by Nerb »

Nerb

  • ALF'er Bronze Member
  • *
  • Posts: 15
Re: Magnetic Encoders
« Reply #35 on: April 15, 2025, 09:15:37 AM »
The magnets look like normal disc magnets but do not have a north or south on the top or bottom. Instead it is on the sides.
They can be stacked and one flipped and they will stick together. Regular magnets when that is done will repel. But when stuck by the sides if you turn one of them it will repeal when it changes polarity. I'd like to find some iron shavings and see what the lines of force for these are.

Nerb

  • ALF'er Bronze Member
  • *
  • Posts: 15
Re: Magnetic Encoders
« Reply #36 on: April 20, 2025, 05:29:18 AM »
A question, the TLE5012B is a absolute encoder. At start up where ever the magnet is aimed is the angle it will give.
No need to find initial position if I were able to place the magnet exactly at the angle needed to give 0 it would always be at 0.
But the odds of that or the encoder chip sitting perfectly on the board are nill so I need to calibrate.
But that is easily solved with a bit of math to change the angle output to what I want.

So the question. Would it be OK to depend on Facetron accuracy  and set the angle to zero mechanically then calibrate. Or use the 45 degree adaptor method to find 45 degree and then use that to calibrate the encoder? Or another method?
I know you had to calibrate yours so would like to know what worked for you.

Still waiting on the boards to arrive but doing some coding while I wait.
Decided whatever value is need to correct the reading will be stored in eeprom since it is small.




Faceting Frank

  • Global Moderator
  • ALF'er VIP
  • *****
  • Posts: 609
Re: Magnetic Encoders
« Reply #37 on: April 20, 2025, 07:26:31 AM »
45 degree dops are not accurate, mine is 46.4 degree I found this out after fitting my optical encoder. I use Tom Herbst code to operate mine and changing the number on line 29 will set the 90 degree position with the quill level with the lap. I fit a 150mm long bit of 1/4 brass rod for this. I check the quill home position is always the same, as I have dropped the quill onto the hard stop twice and moved the encoder very slightly. Having to work out what the number on line 29 need to be changed to get back to 90 degrees.

Pro-oz

  • ALF'er Silver Member
  • *
  • Posts: 94
Re: Magnetic Encoders
« Reply #38 on: April 20, 2025, 11:21:38 AM »
My 45-degree dop is 45.5 Not too bad I suppose.

Nerb

  • ALF'er Bronze Member
  • *
  • Posts: 15
Re: Magnetic Encoders
« Reply #39 on: April 20, 2025, 11:26:16 AM »
After I noticed the only thing holding the shaft of the 45 degree adapter was a set screw to a round shaft I modified it.
Mine is aligned and will not move again so it might be usable to check.
It did explain why I was having worse and worse table problems. A slight tilt will play hell with tables.
I'll do your trick with the brass dop and calibrate to 90 degrees.

Nerb

  • ALF'er Bronze Member
  • *
  • Posts: 15
Re: Magnetic Encoders
« Reply #40 on: Today at 01:06:52 AM »
And using the brass dop that was made found another problem to fix. Cut 200 mm of stock and milled the the end so fits it into the quill .
Verified it was flat by rolling it on the granite surface plate.
Discovered while laying it on a ceramic polishing lap that I needed to go beyond 90 degrees. to remove all daylight from under the test dop.

Needed the display set to 91 with the minor digit between 4 and 5. Stayed close to that when checking while turning the lap. Removed the test dop and recheck it to be flat which it was. Cleaned the inside of the quill and verified nothing was on the platen or stuck to the ceramic lap. Tried again with the same result. Swapped to a known flat master lap with the same result. Checked the base of the mast then verified the mast to base is square. Then verified the aluminum base was flat and finally checked from the base to the platen. Mine had a slight tilt towards the machine.

 Removed the platen and guess what I found.
A tiny piece of what looks like iridescent glitter was stuck under it. Very thin but it still offset the machine sightly. With it all cleaned and polished up and reassembled the measurement changed to 90 with the minor digit slightly over 1 with the 2 just barely showing. I'll take that measurement as my digital encoder should correct for it.

Wonder if mine was made near some holiday where glitter is thrown? Or how knowing that glitter gets everywhere if a piece hitchhiked its way to my machine. Once  thing I did get from this is it looks like the bearings in the platen assembly  will be easy to replace if I ever need to.

Having fun puzzling over how I will calibrate an absolute encoder. If I cross zero the output jumps to 360 . So I would have 3,2,1,360,359.  Looks like I need to create a rollover function that can handle fractional math. Map does not handle fractions so would drop them.
« Last Edit: Today at 02:24:16 AM by Nerb »

Faceting Frank

  • Global Moderator
  • ALF'er VIP
  • *****
  • Posts: 609
Re: Magnetic Encoders
« Reply #41 on: Today at 08:40:46 AM »
I wouldn’t worry to much about it being super accurate Nerd all the angles on the stone are relative to each other. If 90 degrees is 90.05, then all the other facets are 0.05 degrees out.
Your comment about the angle counting to 360 and then back to zero every full rotation is the same with an optical encoder. That point of changeover must be kept out of the full swing of the quill. My quill swings from 0 degrees 6pm to 212 degrees around 2am.

 

Recent Activities

Magnetic Encoders by Faceting Frank
[Today at 08:40:46 AM]


Cutting the table by Faceting Frank
[April 19, 2025, 09:34:39 AM]


Mt Strzelecki on Flinders Island by Bucket
[April 12, 2025, 09:59:34 AM]


Fossicking trip by Barry Simiana
[April 09, 2025, 03:51:18 PM]


Butterfly cut by MakkyBrown
[March 29, 2025, 03:42:54 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]


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]

SimplePortal 2.3.7 © 2008-2025, SimplePortal