Magnetic encoder simple use. Please help

Thread Starter

Electron_23

Joined May 6, 2014
8
Hello everyone,

I am going to use the AS5145 encoder for a motor control application, but when I read the data sheet there are things I don't understand. I just want to give a pretty standard use, not program it. So my question is:
- Do I have to connect the pin CLOCK? If yes, where? Im using a dsPIC33.
- What pins I don't need to use? I mean pins like DO PDIO, I don't know what to do with them.
Sorry for the simple questions but I am not familiar with this device or any other magnetic encoder at all.

Thank you very much in advance, I really appreciate any help, and I really need it.
 

Papabravo

Joined Feb 24, 2006
21,225
I'm not sure I understand the purpose of a magnetic encoder in a motor control application. How about a link to a datasheet and a preliminary schematic along with a description of what you are trying to accomplish.
 

Thread Starter

Electron_23

Joined May 6, 2014
8
I'm not sure I understand the purpose of a magnetic encoder in a motor control application. How about a link to a datasheet and a preliminary schematic along with a description of what you are trying to accomplish.
Hello,

First of all thank you for you answer. What I want to do is a maze solver micromouse, and for that I have to put encoders in the wheels. The space is not enough for a optical encoder, so I will be using a magnetic encoder since it would perfectly fit in my mechanical design. My problem is that I have no idea how to connect the encoders to the dsPIC. Here I leave the data sheet of both, and the schematic I have for now:
For some reason I couldn't upload de dsPIC data sheet. The device is dsPIC33EP256MU806
 

Attachments

Papabravo

Joined Feb 24, 2006
21,225
In your abbreviated first post you left out the critical word "rotary", as in "magnetic rotary encoder". A quick scan of the datasheet does not suggest that there is a method of using the chip without programming it. The programming interface is an industry standard called SPI (Serial Peripheral Interface) originally developed by Motorola (now Freescale). In the generic form there are four signals to be concerned with:
CLK: Any periodic signal with the correct number of pulses, one per data bit.
DI: A one bit wide serial data input stream
DO: A one bit wide data output stream
CS: Chip Select, a control signal that selects a particular device when there is more than one connected to a particular set of data and clock lines.

An SPI transaction is the simultaneous exchange of "word" between the dsPIC and the AS5145. It looks like the length of the word is 16 bits.

Your job is to see if the dsPIC has specific hardware support for SPI peripherals. That will get you connected to the chip. The second job is read that AS5145 datasheet in excruciatingly graphic detail until you can grok* the chip.

*http://en.wikipedia.org/wiki/Grok
 

MaxHeadRoom

Joined Jul 18, 2013
28,696
The Utube video shows the once-rev PWM signal and the means of programming if neccessary.

Manuf. Quote:
AS5145 is a contactless magnetic rotary encoder for accurate angular measurement over a full turn of 360°. It is a system-on-chip, combining integrated Hall elements, analog front end, and digital signal processing in a single device. To measure the angle, only a simple 2-pole magnet, rotating over the center of the chip, is required. The magnet may be placed above or below the IC. The absolute angle measurement provides instant indication of the magnet's angular position with a resolution of 0.0879° (4906 positions per revolution). This digital data is available as a serial bit stream and as a PWM signal. An internal voltage regulator allows the AS5145 to operate at either 3.3V or 5V supplies.

Max.
 

MaxHeadRoom

Joined Jul 18, 2013
28,696
Just scanning the data sheet it appears that you can program for quadrature output with 1/rev marker. so if this were used for multi rotation, then this would require the count and direction reading of the two quadrature signals, commonly done in optical encoders.
Max.
 
Top