Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   New version of WPILib (http://www.chiefdelphi.com/forums/showthread.php?t=42237)

BradAMiller 19-01-2006 18:29

New version of WPILib
 
There is a new version of WPILib that will automatically operate the compressor if connected in the background. You need to call:
Code:

InitPressureSwitch(unsigned char pressureSwitchPort, unsigned char relayPort)
Call the function only once from your Initialize function and WPILib will start checking the status of the pressure switch every 500ms and operate the compressor when needed. The compressor should be connected to a spike connected to the specified relay port.

You can pick up the new version from the WPILib web site.

Enjoy...

BradAMiller 22-01-2006 20:55

Re: New version of WPILib
 
There is a new version of WPILib on the web site that has some changes that were just added today to help us with some motor control. So here you go:
  1. Modified Motor function to be aware of the deadband in the Victor 884 speed controllers. The Victor 884 has a built-in deadband that runs from 117-137 of PWM values sent to it. The Motor function will now take values from 0-127 and 0-(-127) and scale them to fit into the actual working range of the Victor which is 23-116 and 138-232. This means that values sent to the motors will tend to be more continuous without the discontinuity in the range. The Motor function is used by Drive and Motors so if you use these functions, the change will be seen in those functions as well.
  2. There is another function added,
    Code:

    unsignd char GetPacketNumber(void)
    that returns the OI packet number. Each time a new packet is received from the master processor this number is incremented. It is only a 8 bit value so it wraps around every 256 packets, but it provides an indication of when there is new data received.
Let me know if you find any problems, particularly with the Motor change. I think this will help - it did for some motors controlled by PID loops for us. There were too many conflicting controls and was getting very confusing.

dcbrown 23-01-2006 15:08

Re: New version of WPILib
 
Tried to download the zip file, got the following error:

"You don't have permission to access /~bamiller/WPILib/WPILib060122.zip on this server"

BradAMiller 23-01-2006 15:55

Re: New version of WPILib
 
Quote:

Originally Posted by dcbrown
Tried to download the zip file, got the following error:

"You don't have permission to access /~bamiller/WPILib/WPILib060122.zip on this server"

Sorry about that... it's fixed now.

dcbrown 23-01-2006 16:23

Re: New version of WPILib
 
Got it. Thanks!

DCBrown

dcbrown 29-01-2006 19:33

Re: New version of WPILib
 
Quote:

Originally Posted by BradAMiller

...Modified Motor function to be aware of the deadband in the Victor 884 speed controllers. The Victor 884 has a built-in deadband that runs from 117-137 of PWM values sent to it. The Motor function will now take values from 0-127 and 0-(-127) and scale them to fit into the actual working range of the Victor which is 23-116 and 138-232. . .

Does this change also effect SetPMW()?

Regards,
DCBrown

BradAMiller 30-01-2006 08:43

Re: New version of WPILib
 
Quote:

Originally Posted by dcbrown
Does this change also effect SetPMW()?

Regards,
DCBrown

No - the SetPWM function still sends whatever value you give to the PWMs. That way you can use the Motor(port, value) function to get the scaled version, and SetPWM(port, value) to get the unmodified output version.

BradAMiller 04-02-2006 13:16

Re: New version of WPILib
 
There is another new version of WPILib that has the following changes:

1. The capture camera packet functions now have a one second timeout. If the timeout happens, then zeros are returned for all data.
2. A bug in the servo control code was fixed where it was sending bad values when the middle digit was zero in a three digit servo value.
3. There are functions to read the backup and main battery voltages.

You can get it from my website and following the links to the software. As always please post any problems that you might encounter.

Joe Hershberger 04-02-2006 17:45

Re: New version of WPILib
 
Quote:

Originally Posted by BradAMiller
There is another new version of WPILib that has the following changes:

1. The capture camera packet functions now have a one second timeout. If the timeout happens, then zeros are returned for all data.
2. A bug in the servo control code was fixed where it was sending bad values when the middle digit was zero in a three digit servo value.
3. There are functions to read the backup and main battery voltages.

You can get it from my website and following the links to the software. As always please post any problems that you might encounter.

Brad,

I'm attempting to compile a student's program that was written and exported from EasyC. I don't have EasyC and as such I'm using MPLab and your library to build the project. Everything goes well until the link step. It then notifies me that the "Coff file format is out of date" for the objects in the lib file. It wants to rebuild the library, but I obviously don't have the source. Naturally, Microchip changed their coff format with the new version of their compiler. I'm using version 3.01 of the compiler, which comes with version 4.01 of the linker. Can you post the source to the library so it can be rebuilt? If not, what version are you using to build the library so I can downgrade?

Thanks,
-Joe

BradAMiller 04-02-2006 18:03

Re: New version of WPILib
 
Quote:

Originally Posted by Joe Hershberger
Brad,

I'm attempting to compile a student's program that was written and exported from EasyC. I don't have EasyC and as such I'm using MPLab and your library to build the project. Everything goes well until the link step. It then notifies me that the "Coff file format is out of date" for the objects in the lib file. It wants to rebuild the library, but I obviously don't have the source. Naturally, Microchip changed their coff format with the new version of their compiler. I'm using version 3.01 of the compiler, which comes with version 4.01 of the linker. Can you post the source to the library so it can be rebuilt? If not, what version are you using to build the library so I can downgrade?

Thanks,
-Joe

WPILib is built with the version 7.20 of MPLab and 2.40 of the compiler. The newer tools generate a different output file format, and do some (possibly) incompatible optimizations with interrupt handlers. The IFI code which is included with WPILib is also on the older tools and also prevents the use of the new compiler.

To be sure, I'd suggest switching to those versions of the tools. You can get them from the CD that was included in the kit of parts.

Joe Hershberger 04-02-2006 18:11

Re: New version of WPILib
 
Quote:

Originally Posted by BradAMiller
WPILib is built with the version 7.20 of MPLab and 2.40 of the compiler. The newer tools generate a different output file format, and do some (possibly) incompatible optimizations with interrupt handlers. The IFI code which is included with WPILib is also on the older tools and also prevents the use of the new compiler.

To be sure, I'd suggest switching to those versions of the tools. You can get them from the CD that was included in the kit of parts.

Brad,

Thanks for the quick response!

-Joe

TubaMorg 05-02-2006 12:31

Re: New version of WPILib
 
I've updated our EasyC with the new libraries. To test I added

InitPressureSwitch(1,2);

to our code and built it. It returned no errors but a warning that the above function call had no prototype. I'm not sure how to rectify this with EasyC, any thoughts?

BradAMiller 05-02-2006 21:55

Re: New version of WPILib
 
Quote:

Originally Posted by TubaMorg
I've updated our EasyC with the new libraries. To test I added

InitPressureSwitch(1,2);

to our code and built it. It returned no errors but a warning that the above function call had no prototype. I'm not sure how to rectify this with EasyC, any thoughts?

You should also replace the UserAPI.h file to get the new functions to be available in your version of EasyC. Then if you reference the function there won't be any warnings.

There are additional functions in Builtins.h that you might also want to use. They are documented (mostly) in the PDF file.

Kruuzr 07-02-2006 08:36

Re: New version of WPILib
 
Hi Brad...

I started coding up our full application using WPILib but I ran across a big difference between the documentation and what I assume are new functions. In the userAPI.h file, there are two camera functions:

void InitCamera(unsigned char cameraInitIndex);
void CaptureTrackingData(
unsigned char *centerX,
unsigned char *centerY,
unsigned char *x1,
unsigned char *y1,
unsigned char *x2,
unsigned char *y2,
unsigned char *regionSize,
unsigned char *confidence,
unsigned char *pan,
unsigned char *tilt);

The first is obviously a changed version of InitializeCamera() and the second must be new. Could you give a quick rundown of how they work, especially the 'cameraInitIndex' parameter of InitCamera() ? And how do we set camera parameters as there is no place to set up a CameraInitializationData struct.

Thanks

TubaMorg 07-02-2006 10:11

Re: New version of WPILib
 
Quote:

Originally Posted by BradAMiller
You should also replace the UserAPI.h file to get the new functions to be available in your version of EasyC. Then if you reference the function there won't be any warnings.

There are additional functions in Builtins.h that you might also want to use. They are documented (mostly) in the PDF file.


Oh yeah! :D Compiles and runs fine now, thanks! :rolleyes:


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

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi