View Single Post
  #22   Spotlight this post!  
Unread 06-11-2012, 13:12
apalrd's Avatar
apalrd apalrd is offline
More Torque!
AKA: Andrew Palardy (Most people call me Palardy)
VRC #3333
Team Role: College Student
 
Join Date: Mar 2009
Rookie Year: 2009
Location: Auburn Hills, MI
Posts: 1,347
apalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond repute
Re: paper: Talon, Victor884, Victor888, and Jaguar speed vs torque tests

Quote:
Originally Posted by Ether View Post
Paul, would it be useful to ask the folks at WPILib to change their 884 (and future 888) driver to use a period of 5ms instead of 17ms? I realize it probably makes little difference in the vast majority of cases, but there may be teams who want to close a loop at 10ms.


The current PWM setup in WPIlib (at least in LabVIEW) is a PWM output with a 5s period and a 'period multiplier' of 1,2 or 4. It's enumerated, so 1x, 2x, and 4x correspond to 0,1,2 respectively (I don't think you can add more multipliers if you want).

The Jaguars use a period multiplier of 1, for a 5ms period. The Victors use 2, for a 10ms period. Servos use 4, for a 20ms period, and raw PWM channels can use whatever they want (of the three choices).

All it takes to add a new motor controller (in LabVIEW) is to duplicate one of the Open blocks and change the scaling and period multiplier parameters. The Write and Read blocks will adhere to the scaling set in the Open block, and the drivers will use the period multiplier set as well.

However, the fact that the driver (in LabVIEW) uses uint8's to store full-range pulse position, so the uint8 stores the widest pulse that the library can generate and devices using a narrower range perform the scaling before converting to uint8 essentially makes the uint8 sent to the fpga the bottleneck for resolution on the entire pwm output system. So, added input resolution on any new devices (e.g. 10bit internal vs 12bit internal) makes no difference due to the 8bit limit of the library.

Looking at the library (specifically WPI_PWMConvertDeadbandMillisecondTimeTo8Bit) it looks like the u8 is a number of DIO loop ticks to hold the pulse high, and the DIO loop runs every 261 ticks of the main clock (40mhz). That would make 40mhz/261ticks the smallest interval of a pulse change possible in the fpga.

I could be wrong, but that's what I get from reading the LV code.
__________________
Kettering University - Computer Engineering
Kettering Motorsports
Williams International - Commercial Engines - Controls and Accessories
FRC 33 - The Killer Bees - 2009-2012 Student, 2013-2014 Advisor
VEX IQ 3333 - The Bumble Bees - 2014+ Mentor

"Sometimes, the elegant implementation is a function. Not a method. Not a class. Not a framework. Just a function." ~ John Carmack
Reply With Quote