Go to Post Well our closest regional is a Hawaii, it's a bit hard for us to drive 8000km (5000 miles) across the pacific... - timytamy [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 04-02-2005, 22:35
MaxM's Avatar
MaxM MaxM is offline
Registered User
#0473 (Corvallis High School Robotics)
Team Role: Student
 
Join Date: Feb 2003
Location: Corvallis, Montana
Posts: 13
MaxM is on a distinguished road
Send a message via AIM to MaxM Send a message via MSN to MaxM
Unhappy Kevin Watson's encoder code with RPM output

I'm the programmer on Team 473. I've been trying to use Kevin Watson's encoder code to measure the RPMs of our transmission in order to write a shift scheduler. I've been trying to do this by getting the number of encoder counts which occur over 25 cycles of Process_Data_From_Master_uP. Since Process_Data_From_Master_uP runs every 26.2 ms, I can convert from rpms into encoder cycles per Process_Data_From_Master_uP runs. However, this is not giving me anything near an accurate RPM output (I have a digital tachometer to check the RPMs with).

Here's my code from Process_Data_From_Master_uP:
Code:
	if (++counter >= (24))
	{
		Left_Encoder_Count = Get_Left_Encoder_Count();
		printf("RPM Left: %5d\n",(int)((Left_Encoder_Count - previous_count_left)*0.698666667));
		previous_count_left = Left_Encoder_Count;
		counter = 0;
	}
0.698666667 is the conversion factor counts per 25 Process_Data_From_Master_uP cycle to RPMs. (1 rotation/1 min*1 min/60 sec*1 sec/1000ms*655 ms (25*26.2ms)/1 program cycle*65 counts/1 rotation)

Either my conversion factor is totally wrong or my method is totally wrong (or my tachometer is wrong, but since it's digital I don't think it is). Can anyone help?

Thanks,
__________________
Max Masnick
Montana Robotics Team 473
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Team THRUST - Kevin's Code and Camera Code Combine Chris_Elston Programming 3 31-01-2005 22:28
Kevin Watson's Kick-off Demo Code! Mr. Lim Programming 27 22-01-2005 03:38
Updated Encoder Code Available Kevin Watson Programming 2 04-01-2005 01:00
heres the code. y this not working omega Programming 16 31-03-2004 15:18
Rookie Programmer has question about the default code DanL Programming 3 26-01-2002 19:59


All times are GMT -5. The time now is 18:01.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi