From: "Andrew Warren" Sent: Friday, February 20, 2004 7:41 PM Subject: Re: [PIC:] RPM to pulses, pulses to RPM > In another post, you asked about dividing 6666666 by 444 to get > 15015... So I assume that your motor spins at around 15000 RPM. If > it really does spin that fast, you might try working with frequency > rather than period. Yes. The system uses that method by now. The pic read TMR1 value each second, makes a huge division, and displays the RPM in a 7 segments display. Also makes a log in a computer. > If you count pulses over 60/9 = 6.666 seconds, for instance, the > number of pulses will be exactly equal to the RPM. If 6-second > updates aren't fast enough, you could count pulses over a shorter > period of time, then multiply. Amazing. I'd never realized! :) no more huge divisions!... I will play with this now. Thank you Andrew, as always very clear! Dennis Crawley Argetina PS: This is a log of the dc motor @150/1024 pwm at 310vdc You can see how fast it get speed. I need to control that acceleration faster to any speed required. from 300 to 6000 rpm. 15000 is a future maximum speed. Not used by now. time rpm pwm(150/1024) 09:45:35 270 150 09:45:36 960 150 09:45:37 1380 150 09:45:38 1660 150 09:45:39 1890 150 09:45:40 2080 150 09:45:41 2250 150 09:45:42 2400 150 09:45:43 2520 150 09:45:44 2640 150 09:45:45 2740 150 09:45:46 2840 150 09:45:47 2920 150 09:45:48 3000 150 09:45:49 3080 150 09:45:50 3140 150 09:45:51 3210 150 09:45:52 3270 150 09:45:53 3320 150 09:45:54 3380 150 09:45:55 3430 150 09:45:56 3480 150 09:45:57 3520 150 09:45:58 3560 150 09:45:59 3600 150 09:46:00 3640 150 09:46:01 3670 150 09:46:02 3700 150 09:46:03 3740 150 09:46:04 3770 150 09:46:05 3800 150 09:46:06 3820 150 09:46:07 3850 150 09:46:08 3870 150 09:46:09 3900 150 09:46:10 3920 150 09:46:11 3940 150 09:46:12 3960 150 09:46:13 3990 150 09:46:14 4000 150 09:46:15 4020 150 09:46:16 4040 150 09:46:17 4050 150 09:46:18 4070 150 09:46:19 4080 150 09:46:20 4100 150 09:46:21 4120 150 09:46:23 4140 150 09:46:24 4160 150 09:46:26 4180 150 09:46:28 4200 150 09:46:30 4210 150 09:46:31 4220 150 09:46:32 4240 150 09:46:34 4250 150 09:46:35 4260 150 09:46:37 4270 150 09:46:38 4280 150 09:46:40 4290 150 09:46:41 4300 150 09:46:43 4310 150 09:46:44 4320 150 09:46:47 4340 150 09:46:51 4350 150 09:46:52 4360 150 09:46:55 4370 150 09:46:57 4380 150 09:47:01 4390 150 09:47:04 4400 150 09:47:08 4410 150 09:47:12 4420 150 09:47:18 4430 150 09:47:22 4440 150 09:47:28 4450 150 09:47:33 4460 150 09:47:44 4470 150 09:47:53 4480 150 09:48:11 4460 0 09:48:12 4380 0 09:48:13 4320 0 09:48:14 4240 0 09:48:15 4170 0 09:48:16 4100 0 09:48:17 4030 0 09:48:18 3960 0 09:48:19 3900 0 09:48:20 3830 0 09:48:21 3760 0 09:48:22 3700 0 09:48:23 3630 0 09:48:24 3570 0 09:48:25 3500 0 09:48:26 3440 0 09:48:27 3380 0 09:48:28 3320 0 09:48:29 3250 0 09:48:30 3190 0 09:48:31 3130 0 09:48:32 3070 0 09:48:33 3010 0 09:48:34 2950 0 09:48:35 2900 0 09:48:36 2840 0 09:48:37 2780 0 09:48:38 2720 0 09:48:39 2670 0 09:48:40 2620 0 09:48:41 2560 0 09:48:42 2500 0 09:48:43 2440 0 09:48:44 2380 0 09:48:45 2330 0 09:48:46 2280 0 09:48:47 2220 0 09:48:48 2170 0 09:48:49 2120 0 09:48:50 2060 0 09:48:51 2010 0 09:48:52 1960 0 09:48:53 1900 0 09:48:54 1860 0 09:48:55 1800 0 09:48:56 1760 0 09:48:57 1700 0 09:48:58 1650 0 09:48:59 1600 0 09:49:00 1550 0 09:49:01 1500 0 09:49:02 1450 0 09:49:03 1410 0 09:49:04 1360 0 09:49:05 1310 0 09:49:06 1260 0 09:49:07 1220 0 09:49:08 1170 0 09:49:09 1120 0 09:49:10 1080 0 09:49:11 1040 0 09:49:12 990 0 09:49:13 940 0 09:49:14 910 0 09:49:15 860 0 09:49:16 820 0 09:49:17 780 0 09:49:18 740 0 09:49:19 690 0 09:49:20 650 0 09:49:21 610 0 09:49:22 560 0 09:49:23 520 0 09:49:24 480 0 09:49:25 440 0 09:49:26 400 0 09:49:27 360 0 09:49:28 330 0 09:49:29 290 0 09:49:30 250 0 09:49:31 210 0 09:49:32 170 0 09:49:33 130 0 09:49:34 100 0 09:49:35 60 0 09:49:36 20 0 09:49:37 0 0 -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu