02-21-2009 12:24 PM
(PLEASE NOTE THAT THE SCREENSHOTS OF MY CODE THAT SHOULD BE IN THIS POST ARE ACTUALLY IN A WORD DOCUMENT WHICH CAN BE FOUND IN THIS LINK or can be found attached below)
So this was my attempt at traction control. We figured that the pre-created arcade drive was a good idea to use and so I copied and pasted the contents of arcade drive into a new vi and the motors drive which was inside arcade drive into another subvi and replaced the original motors drive vi inside of the newly created arcade drive with the newly created motors drive. However, before I even made any modifications for traction control, it gives me this error that occurs inside of the new motors drive:
Modified Arcade Drive:
Modified Motor Drive (Inside of modified arcade drive):
The device reference from the begin vi is the same as the original device reference for arcade drive. However, it gives me this error:
So right now, this doesn’t even work.
Nevertheless, we still proceeded to work on our traction control by modifying arcade drive (since we thought that preserving all the already done work in arcade drive would be worth it) and tried to add the P part of PID into it using encoders.
In the modified arcade drive we have:
And inside of the motors drive:
where the current speed of the robot is being subtracted by the m/s being pulled from the encoder and then multiplied by 10 to make the change more noticeable.
So my question is
1) is this even a good way to implement traction control
2) if it is, how do we fix this error???
3) If it is not, what is the best way to implement traction control???????????
Thanks everyone in advance!
02-23-2009 11:36 AM
Please, if possible, don't post screenshots embedded in a word document. You can very easily save them as a gif or png (paste into MS Paint in Windows, for example) and upload those.
What you're seeing here is that many of the original motor drive VIs are contained in a LabVIEW library (.lvlib); in this case RobotDrive.lvlib. Some of the VIs contained in that library can only be called by other VIs that are also in that library (they are "private") - for example, GetPWMReference.vi. When you copied the block diagram from the motor drive VI, it copied the calls to those private subVIs, but since your new VI isn't in the library it can't use those subVIs, generating the error that you're seeing. The best way to fix this would be to rewrite your code using only the VIs that are available to you through the Robotics Library palette; it should be possible to do everything you need to do with those functions.
I don't recommend that you create another copy of the entire library, nor that you add your modified VI to the library, since either of these approaches may cause you problems if a new version of the library is released.
02-23-2009 03:12 PM
Great thanks for the tip. But I am just wondering, what if we added these newly created arcade drives to the robot drive .lvlib? (It seems to work...)
02-23-2009 04:01 PM
Adding new VIs to that library will work for now, but if NI or FIRST releases an update that contains a newer version of that library you may lose your code (or at least, the library will no longer include your VI as one of its members).