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.

motor controller with quardrature encoder to receive feedbac

Status
Not open for further replies.

vibz86

Newbie level 6
Joined
Aug 17, 2009
Messages
12
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,373
microc codes for dc motor

hi, i have to build a dc motor controller with a quadrature encoder, which is going to be used to automate a telescope.I thought of using pic16f877a. im new to microc codings. can some one help me out to programme this pic, is there any place to learn the syntax in micro c?
 

motor encoder

It would be better to use a Pic that has support for Motor control.
A Pic18 series or Pic30.
Some of these chips have a dedicated quadrature encoder input port.
Look on Microchip at the Motor control pages for more info.
 

motoren met encoder schema

hi, thnaks for the help. Now iv started programming pic16f877a. Does that pic have a quadrature encoder module? if it doesnt hv, hw can I get feedback fr a encoder? can some one please help me out with this
 

4 motor encoder controller

Hello,

You can use the external interrups to do that. Just need two interrups

And increment or decrement an counter depending the way of move cw or ccw.

Remember that encoder ticks are 90º phase shifted.

Just attend the interruption in the transisitions os the signal.

After that, if you use an base time, you can calculate the speed of the motor as well with the position.

take in mind that you need to avoid the overflow of the counter, so the timming udes is important to calculate and put the result out. you just need to calculate the difference off ticks and related this with the radius of the wheel or the gearbox ratio you use for example.

For motor control recomend to use an PID with feed foward to elimibate the initial error in the integration part.

Regards
 

pic encoder controller motor

Ave_Rapina said:
Hello,

You can use the external interrups to do that. Just need two interrups

And increment or decrement an counter depending the way of move cw or ccw.

Remember that encoder ticks are 90º phase shifted.

Just attend the interruption in the transisitions os the signal.

After that, if you use an base time, you can calculate the speed of the motor as well with the position.

take in mind that you need to avoid the overflow of the counter, so the timming udes is important to calculate and put the result out. you just need to calculate the difference off ticks and related this with the radius of the wheel or the gearbox ratio you use for example.

For motor control recomend to use an PID with feed foward to elimibate the initial error in the integration part.

Regards

hi thanks for the note. Im finding it difficult to code the scenari as im new to pic programming... Do u hv any sample codes to insert the encoders. I have written the code in mikroc for the pwm functions and taken the encoder signals, but dont hv an idea , hw to deal with the encoders... can someone help mee out.. iv uploaded the schematic also

 

how to read motor encoder input

vibz86 said:
hi, thnaks for the help. Now iv started programming pic16f877a. Does that pic have a quadrature encoder module?
No, it doesn't. See a datasheet.
vibz86 said:
if it doesnt hv, hw can I get feedback fr a encoder?
There are some useful app notes on how to conrol dc motor there. **broken link removed** Read them.
You can also connect your encoder directly to pic using interrupts. However I would use a polling method to exclude debouncing and any disturbances.

Added after 5 minutes:

vibz86 said:
Do u hv any sample codes to insert the encoders. I have written the code in mikroc for the pwm functions and taken the encoder signals, but dont hv an idea , hw to deal with the encoders... can someone help mee out.. iv uploaded the schematic also
Again I recommend you to read the app notes above.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top