View Single Post
  #3   Spotlight this post!  
Unread 22-12-2009, 12:15
buddyb's Avatar
buddyb buddyb is offline
Registered User
FRC #1885 (ILITE)
Team Role: Programmer
 
Join Date: Dec 2009
Rookie Year: 2008
Location: Haymarket, VA
Posts: 65
buddyb has a spectacular aura aboutbuddyb has a spectacular aura aboutbuddyb has a spectacular aura about
Re: [FTC]: Breaking DC Gearboxes Fix

Quote:
Originally Posted by PhilBot View Post
Since you're talking "power Switches" I assume you are talking about the DC motors, and not the LEGO motors.

So, I am surprized that Robot C is using 16 Bit ints for the encoder values.
Are you sure about that..?

The encoders report 1440 pulses per revolution, so it only takes 22 revolutions to overflow an int16.

The Hitechnic motor controllers actually report 32 Bit ints, so it doesn't seem logical to throw away 16 of those bits. (eg: LabVIEW uses all 32 bits)

However, I guess the real question is whether it's possible to put the motors into "coast" to let them slow down normally. The Hitechnic manual says that it is possible. Does Robot C need a flag for that?
Yes, I am talking about DC Motors.

I'm pretty sure that it 'throws away' the 16 extra bits; I had a program print the nMotorEncoders value to the NXT screen, and it overflew at 32,767 mark. There could have been an unseen conversion to 'short' (16-bit) somewhere else in the program (when I was passing the nMotorEncoders value to the print function?), but I certainly didn't see it. >.<

I've looked for a way to set the motors in to 'coast', but all I've been able to find is LEGO-specific functions (RobotC has LEGO and DC motors split up, EX. there's nPIDUpdateInterval for LEGO, and nPIDUpdateInterval12V for DC) for coasting vs breaking; no DC . I'll play around with a spare motor later on today, though, to see if any of this will apply to DC motors.

Thanks for the input!
__________________
FRC - Team 1885 - Programmer.
Reply With Quote