Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

how to write algorithm for absolute encoder in C?

Status
Not open for further replies.

Johnyc

Newbie level 2
Joined
Mar 27, 2008
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,299
how to write algorithm

Hi everyone,

Im facing a problem in developing a algorithm for a sensor absolute encoder that need to count the number of rotation for example 5 rotation or 4.5 rotation (1 full rotation = 360degree)
The characteristic of the absolute encoder is, the change of degree in rotation will also changing the duty cycle width of the PWM ( eg. large angle of rotation will gives larger duty cycle width) which is output by the sensor. The data sheet for this sensor is found https://www.usdigital.com/products/ma3/

i want to develop an algorithm for detecting the number of rotation of the motor that need to be turned to the desired position. the mircocontroller for this system is PIC 16F876. my application is that the motor will need to turn more than 1 full rotation sometimes to achieve the desired position.

Im using CCS C compiler to write program in PIC,
so what is the algorithm that can be write in C to detect such an application?
can anyone give me an idea and solution?

thanks
 

how to write an encoder in c

Thes solution depends on the maximum rotational speed in your application. Basically the sensor gives an angle measurement, you have to count the overflows with detecting the direction. That implies more than two measurements per revolution, then a |delta| > 0.5 range indicates a position overflow, the delta sign gives the direction.
 

encoder overflow algorithm

Sorry, i don't understand what you mean. how to count overflow with detecting the direction? why |delta|>0.5 indicates a position overflow? can you or anybody show me some example source code for this application?

thanks for reply:D
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top