Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
07/26/03 05:25
Read: times


 
#51491 - RE: stepper motor ramp up problem
Responding to: ???'s previous message
The idea of using a higher speed timer interrupt in a multiplexed manner to control multiple similar but out of phase activities is a viable scheme. I attempted to illustrate this concept in the "State machine tutorial" code I published in this thread.... http://www.8052.com/forum/read.phtml?id=47505 .

For your application you should able to evaluate the feasibility of using the single timer interrupt to ramp multiple motors by looking at:

1) Determine the maximum step rate you need for the motors. (i.e. this corresponds to the rate needed to cycle the state machine that runs the A/B/C/D phases of the stepper.

2) Evaluate the feasibility of implementing the ramping up and down of the motor not by varying the timer interrupt period but instead using a software divider which controls the number of timer interrupts between the times you cycle the stepping state machine.

3) Determine how much time it takes to execute the logic of one path via the interrupt through the stepping state machine for the longest state.

4) Decide how many steppper motors you need to control.

5) Determine the fastest interrupt rate that is feasible for your processor to be able to execute one state for the stepper motor state machine for each of the stepper motors in a multiplexed manner. When you perform this deterimination it is good to realize that if you spend too much time in the interrupt context then your mainline non-interrupt thread wont get too much of the processor bandwidth.

The crux of this is that is should be possible to easily drive 4 steppers but your top stepping speed will be limited to how fast of interrupt you can process. I would think that high speed processor like a 1x clocker like a Cygnal part @ 25 MHz should easily be able to support stepping rates up to about 1 KHz for four steppers operated in a multiplex manner. My gut feel is that also if you ran the interrupt at a rate of 50 microseconds (each motor would get serviced every 200 microseconds) then there would be a net of 5 timer events to a given motor at the 1KHz stepping rate (i.e. 200 uSec * 5 = 1 msec). Ramping the stepper would consist of approaching the maximum speed by using an integer number of timer events between running the stepping sequence state machine to a given motor.

I'll have to leave it to you to determine if stepping rates like I have given above are both fast enough for your motors and if the 200 microsecond resolution of the step timing results in a smooth enough speed ramp for you.
@ 200 microsecond rate / motor.....
Numb    Step     Step
Timer  Period    Rate
Events  mSec      KHz
------ ------   ------
5	1.0	1.0000
6	1.2	0.8333
7	1.4	0.7143
8	1.6	0.6250
9	1.8	0.5556
10	2.0	0.5000
11	2.2	0.4545
12	2.4	0.4167
13	2.6	0.3846
14	2.8	0.3571
15	3.0	0.3333
16	3.2	0.3125
17	3.4	0.2941
18	3.6	0.2778
19	3.8	0.2632
20	4.0	0.2500
21	4.2	0.2381
22	4.4	0.2273
23	4.6	0.2174
24	4.8	0.2083
25	5.0	0.2000
26	5.2	0.1923
27	5.4	0.1852
28	5.6	0.1786
29	5.8	0.1724
30	6.0	0.1667
31	6.2	0.1613
32	6.4	0.1563
33	6.6	0.1515
34	6.8	0.1471
35	7.0	0.1429
36	7.2	0.1389
37	7.4	0.1351
38	7.6	0.1316
39	7.8	0.1282
40	8.0	0.1250
41	8.2	0.1220
42	8.4	0.1190
43	8.6	0.1163


Michael Karas



List of 7 messages in thread
TopicAuthorDate
stepper motor ramp up problem            01/01/70 00:00      
   RE: stepper motor ramp up problem            01/01/70 00:00      
      RE: stepper motor ramp up problem            01/01/70 00:00      
   RE: stepper motor ramp up problem            01/01/70 00:00      
   RE: stepper motor ramp up problem            01/01/70 00:00      
      RE: stepper motor ramp up problem            01/01/70 00:00      
         RE: stepper motor ramp up problem            01/01/70 00:00      

Back to Subject List