View unanswered posts | View active topics It is currently Fri Jul 25, 2014 2:40 pm






Reply to topic  [ 3 posts ] 
Angle Sensor RPM Readings on SMUX 
Author Message
Rookie

Joined: Fri Nov 19, 2010 3:34 pm
Posts: 14
Post Angle Sensor RPM Readings on SMUX
Hi,

HiTechnic Angle Sensor plugged into...
HiTechnic Sensor Multiplexer
3rd Party Drivers v2.4

We never could find a description of what sort of RPM readings we should be seeing when the HT Angle Sensor is running counterclockwise (guessing this is the direction we're having issues with). When we spin it clockwise (guessing this is the direction we're NOT having issues with) we get reasonable RPM readings, like 0 to 200 or so, depending on how fast we spin it. However, when we spin it in the opposite direction, we see readings that start at around 760 and start going down as we spin it faster. Yes, we were expecting negative readings, but didn't think it would baseline so high. We were expecting it to start at 0 and go down from there.

Is this the way the driver is intended to output RPM readings? Is there documentation about the output in both directions?

I don't remember seeing this issue before we put it on the SMUX, but we may not have had our program working to the point where we would have noticed. We think we're configuring the SMUX correctly since we're getting reasonable accumulated angle readings, and RPM readings in the positive direction.

Thanks in advance.


Thu Jan 05, 2012 6:26 pm
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3163
Location: Rotterdam, The Netherlands
Post Re: Angle Sensor RPM Readings on SMUX
I will investigate. Bug reports for my driver suite are best reported in this subforum: [LINK] or via the email address in all the header files :)

Please keep in mind that I am on vacation for a week and mostly indisposed the week after that.

- Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Fri Jan 06, 2012 4:03 am
Profile WWW
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3163
Location: Rotterdam, The Netherlands
Post Re: Angle Sensor RPM Readings on SMUX
Copy of my mail to Ken:

Hiya Ken,

Really dumb mistake in my driver. Just comment out line 212 in HTANG-driver.h. I basically have two return statements in the int HTANGreadRPM(tMUXSensor muxsensor) function. The correct function should be:

Code:
#ifdef __HTSMUX_SUPPORT__
int HTANGreadRPM(tMUXSensor muxsensor) {
  memset(HTANG_I2CRequest, 0, sizeof(tByteArray));

  if (HTSMUXSensorTypes[muxsensor] != HTSMUXSensorCustom)
    HTSMUXconfigChannel(muxsensor, HTANG_config);

  if (!HTSMUXreadPort(muxsensor, HTANG_I2CReply, 2, HTANG_RPM_H)) {
    return -1;
  }

  // return HTANG_I2CReply[0] * 2 + HTANG_I2CReply[1];  <-- stupid typo!

  return (HTANG_I2CReply[0] <<  8) +
          HTANG_I2CReply[1];
}
#endif // __HTSMUX_SUPPORT__


Unfortunately due to time pressures I will not be releasing a new version of the suite before I go on vacation.

I'll post this fix in the thread as well. Thanks for reporting the bug!

- Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Fri Jan 06, 2012 4:01 pm
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


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 post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.