Using XOR to convert a Graycode Encoder

(instructions, reset, WDT, specifications...) PIC17Cxx, PIC18Fxxx

Re: Using XOR to convert a Graycode Encoder

Postby GettinBetter » Sat Aug 10, 2019 11:07 am

Roche wrote:I did just write it...


Lol that's cool. I've found the problem with the blank spots, the encoder is 12-24VDC, and I supplied it from a separate source (battery charger 12.8V), upon closer inspection of the encoders circuit diagram it appears the encoder needs the 0V from the 12V supply, and it was grounded at the dev boards pin. Checking the voltages at the outputs of the encoder measure 12+ volts. So it seems if I want to continue with these encoders I'll have to put a buffer inline. In theory it won't affect the coding of the PIC, its just a hardware issue. I'll fix that then come back to the coding.
If I buy these encoders again I'll do as ric suggested and get the binary output version, plus now I realise I also need the 5V version as well....

Do you mind if I use your asm code as a starting point?

I'm trying to make a feedback system where the encoders confirm the position of a motor driven spindle. The spindle is given a predetermined position, the geared motor drives the spindle the encoder makes sure it gets to the correct spot.

Regards
Les
History teaches us that history doesn't teach us.
User avatar
GettinBetter
 
Posts: 16
Joined: Wed Jun 06, 2018 8:48 pm

Re: Using XOR to convert a Graycode Encoder

Postby Roche » Sat Aug 10, 2019 12:07 pm

Do you have the spec/part number of the encoder?
The code is there, free to use. Like I say, I think it could use refining. It was just to make sure I understood what was going on...
Sounds like an interesting application - where are you?
Roche
 
Posts: 41
Joined: Fri Jul 11, 2014 12:35 pm
PIC experience: Professional 5+ years with MCHP products

Re: Using XOR to convert a Graycode Encoder

Postby GettinBetter » Sat Aug 10, 2019 5:05 pm

Roche wrote:Do you have the spec/part number of the encoder?....

It's an Autonics EP50S8-1024-3F-P-24, and I have two of them. Not ideal, but I'll have to make do at the moment, I have other priorities. It's not like I don't have other things to get on with, I still need to get to grips with this 9 axis IMU.

Roche wrote:...The code is there, free to use. ...

Thank you.

Roche wrote:where are you?


I'm on the south coast in Kent, UK, and you?

Regards
Les
History teaches us that history doesn't teach us.
User avatar
GettinBetter
 
Posts: 16
Joined: Wed Jun 06, 2018 8:48 pm

Re: Using XOR to convert a Graycode Encoder

Postby Roche » Sat Aug 10, 2019 5:58 pm

I'm near Reading in Berkshire.
I can see why you wouldn'y want to replace the encoder in a hurry. Good luck with the IMU.
Roche
 
Posts: 41
Joined: Fri Jul 11, 2014 12:35 pm
PIC experience: Professional 5+ years with MCHP products

Re: Using XOR to convert a Graycode Encoder

Postby GettinBetter » Sat Aug 10, 2019 7:19 pm

Roche wrote:I'm near Reading in Berkshire....

8-) I was half expecting you to be on the other side of the planet. My daughter lives in Reading I know it quite well, and a close friend I went to uni' with also lives there....I grew up in Slough/Burnham, and moved to Kent over 25 years ago.
Small world :D
Les
History teaches us that history doesn't teach us.
User avatar
GettinBetter
 
Posts: 16
Joined: Wed Jun 06, 2018 8:48 pm

Re: Using XOR to convert a Graycode Encoder

Postby Roche » Sun Aug 11, 2019 9:03 am

I did come from the other side of the planet - about 30 years ago.

It depends on your application, but I always fancied trying a LVDT for angular position. Very high resolution. I got involved with one once which was used for positioning a 6m satellite dish. Ever since then I've been looking for an excuse to use one...
Roche
 
Posts: 41
Joined: Fri Jul 11, 2014 12:35 pm
PIC experience: Professional 5+ years with MCHP products

Re: Using XOR to convert a Graycode Encoder

Postby GettinBetter » Sun Aug 11, 2019 10:40 am

LVDT... I had to search it.... Looks like RDVT would be an option..my main issue is ruggedness, the application is prone to repeated vibration and shocks, so it's all about whether the internals would be up to the task.
The encoder I'm using has a delicate disc (with probably etched markings) and electronics inside, with a rather large "Do not impact" on the side...
Looking at a cutaway image on the web shows similar style of internals for the RDVT, but it'll probably come down to trial and error/evolution ...need to do more homework on that one...still replacing the one's I have is a long way off yet.

Thanks for the heads up.

Les
History teaches us that history doesn't teach us.
User avatar
GettinBetter
 
Posts: 16
Joined: Wed Jun 06, 2018 8:48 pm

Previous

Return to 16-Bit Core

Who is online

Users browsing this forum: No registered users and 1 guest