Go to Post It's often not the code you are focused on that causes problems, but the code you dismiss out of hand as "unrelated". - Mark McLeod [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
  #7   Spotlight this post!  
Unread 03-02-2012, 08:02
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,756
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: I woke up...and discovered CAN

Absolutely horrible is a pretty strong sentiment to place on something. This is a good opportunity to practice troubleshooting the elements you are using and tracking down the issue.

If you were reading them as digital inputs and doing your own logic for advancing or reversing the position, that should work if done properly, but it will only work for a slow progression. I suspect you are reading the pulses every few ms at best, and probably more like every 20ms +/- 5. If you have a 1024 pulse encoder, the 20ms sampling rate would start to fail at something like 1/80 rpm I think -- not very fast. By comparison, the fpga reads the digital inputs at a rock steady 6.xxx microseconds. I don't remember the number, but that is actually limited by the bus access time for the module. With a faster module, it could go far higher.

My initial advice would be to make a small test project using just an encoder example. spin the encoder by hand. If it is flaky, make sure that the issue isn't with the wiring, the digital breakout, or the sensor. Being the programmer, you are often the first to see that the system doesn't work, and since the system is complex, the issue could be any number of places. Being able to isolate parts of the system and determine if they are at fault is a valuable technique, and is actually fun once you become good at it.

Greg McKaskle
 


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


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

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