Go to Post I have photos of students working the lathe dressed for a concert! Makes me wish for a formal dress night at robotics. - 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

 
Closed Thread
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 02-02-2008, 19:33
Adrien's Avatar
Adrien Adrien is offline
Registered User
FRC #1414 (IHOT)
Team Role: Leadership
 
Join Date: Jan 2005
Rookie Year: 2004
Location: Atlanta, GA
Posts: 13
Adrien is an unknown quantity at this point
Send a message via MSN to Adrien
Get Motor Values with WPILib?

Hello all!

This is our first year running WPILib and so far we like it a lot. However, I was wondering how we can get the current value of the motors on the robot. I read through the entire WPILib documentation and I couldn't find any functions for getting current motor values. With the default code, we could just look at pwm01 through pwm16 to get the motor values. I know I could just store the value I last gave the motor and use that when I need to, but with WPILib your code can loop faster than 26.2 ms, so it is possible to assign values to motors faster than the processor does. So how can I find the current actual value for the motors?

Thanks,
Adrien
  #2   Spotlight this post!  
Unread 03-02-2008, 00:28
dcbrown dcbrown is offline
Registered User
AKA: Bud
no team
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Hollis,NH
Posts: 236
dcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud of
Re: Get Motor Values with WPILib?

Is the question: "How do I read the motor values last sent to the master processor?"

I don't believe there is an interface call that can do this... and I'm not entirely sure you need that info.

If you just want to know what is the current packet to be transmitted to the master processor, check out ifi_defaults.h and the txdata packet. Specifically you should be able to read the data I think you're looking for in

Code:
  current_pwm01 = rxdata.rc_pwm01
  #3   Spotlight this post!  
Unread 03-02-2008, 12:12
jacobhurwitz jacobhurwitz is offline
Registered User
FRC #0449 (Blair Robot Project)
Team Role: Programmer
 
Join Date: Jan 2008
Rookie Year: 2007
Location: Maryland
Posts: 45
jacobhurwitz has a spectacular aura aboutjacobhurwitz has a spectacular aura aboutjacobhurwitz has a spectacular aura about
Re: Get Motor Values with WPILib?

We're using WPILib, but we copied over ifi_aliases.h and a few other header files from the default code. After commenting out a few lines, we got rid of all duplicate functions and #defines. Once you have that, you can call pwm01 as normal. You don't even have to use WPILib's SetMotor function. You can just say pwm01 = 127 or printf("%d\r", (int)pwm01) or whatever you'd normally say without WPILib.
Closed Thread


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
Code Won't Compile in MPLab with WPILib Inverted Programming 1 20-02-2007 22:12
can't get joystick right with the motor coolguybigt Motors 1 16-02-2007 10:20
Motor advice: what to get? Dustfinger Motors 9 07-06-2005 22:27
How to get Nippon-Denso Motor walterj Motors 2 05-02-2004 07:20


All times are GMT -5. The time now is 23:46.

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