CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

step motor AN906

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
hawk123



Joined: 16 Jun 2005
Posts: 4

View user's profile Send private message

step motor AN906
PostPosted: Thu Jun 16, 2005 4:39 pm     Reply with quote

Hi, I am using AN906 to design a step motor system. But it seems the program Microchip provided is not right because the values of the timer0, timer2 and micro-step are not right. For example, they use andlw 0x07 and I think that should be andlw 0x0f. Who can help me to determine the value of timer0 and time2 when using microstep control? Thanks a lot.
Ttelmah
Guest







PostPosted: Fri Jun 17, 2005 3:23 am     Reply with quote

andlw 0x7, is correct.
Why not just try the code. It does work.
The key thing to understand, is that they are using eight 'micro steps' to each 'half step'. The andlw 07, selects these micro steps, and adjusts the PWM values to the two outputs.
There are four bits controlling the 'main' steps.
If you look at a standard step 'table' for a half stepping motor, you get:
Code:


        A B C D
0      1 1  0 0
1      0 1  0 0
2      0 1  1 0
3      0 0  1 0
4      0 0  1 1
5      0 0  0 1
6      1 0  0 1
7      1 0  0 0


(Hopefully the 'code' tab will keep the table aligned...).
Now you will see that there are eight phases, and each has just one or two poles energised. What has to be done, is that the power feeds to the possible pairs, come from the two PWM outputs, and then microstepping is achieved by adjusting the ratio of power smoothly from the 'off' state to the fully 'on' state, with the timing following a sinusoid. The Microchip example, uses eight possible values for this, effectively dividing each half step, into eight further states. This gives sixteen 'micro steps' to the full step.
So, though thre are sixteen microsteps, there are only eight 'sub positions' used to the half step.

Best Wishes
hawk123



Joined: 16 Jun 2005
Posts: 4

View user's profile Send private message

Thank you
PostPosted: Fri Jun 17, 2005 10:33 am     Reply with quote

Thank you very much!
hawk123



Joined: 16 Jun 2005
Posts: 4

View user's profile Send private message

Thank you
PostPosted: Fri Jun 17, 2005 10:34 am     Reply with quote

Thank you very much!
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group