URDF Files, New Inverter, and Dynamic PID Gains
Some updates.
First, I’ve been spending the last few days working on generating a URDF (simulation model) file for Abby, complete with 3D meshes generated from my Inventor CAD models. I’m using a combination of a few pieces of software to do this:
- I have my model in Inventor, and using MathWorks' Simmechanics Link plugin for Inventor to generate a Simmechanics XML file and accompanying STL mesh files.
- Rename all of the STL files to use lowercase file extensions (stl instead of STL). This is important later.
- Over in Linuxland, use the ROS Simmechanics to URDF package to create a URDF file. I started from the tutorial here, but had to make a few alterations. Notably, their code will have timing issues waiting for frame transforms and can't handle any units with Lbs (which I had been using in Inventor). My altered version of their code, which I haven't published yet, but will probably submit to the maintainer of the package (David Lu), fixes both of these problems. I increased the publish rate on the frame transforms by a factor of ten and added conversion code for Lbs (it already had code for slugs).
- At this point, everything loads into Rviz, but the scaling seems to be wrong (the models are all squeezed together and not placed properly). I think this is a units issue. The simplest fix is probably to change all of my Inventor files to use meters and re-export.
As a solution to our puny inverter problem, I’ve tracked down this one from the same supplier as our current inverter. It meets or exceeds all of the specs of the inverter ABB used. Hopefully, this will work for the arm.
Wyatt expressed some interest last week in dynamically changing the PID gains to allow the drivetrain to be selectively compliant. This would be particularly useful in situations such as opening doors, allowing the robot to slide backward instead of rigidly holding position. I emailed Eric about this, and he says that as of right now, PID gains are set in configuration files on the cRIO, so they are software-settable, but not through ROS. The C code on the cRIO could be changed to allow setting the gains through the ROS gateway, and he gave me access to the C code repository. He does warn that the whole thing could go unstable and Bad Things(TM) would happen. From Eric:
The Labview files live on Farnsworth in an SVN repo (I think they are at this path: http://farnsworth.case.edu/svn/igvc/mobilerobots/trunk/LabviewPlatform/ ... full repo is /svn/igvc . For laziness, just use ****** as the login details if you want to pull it down). I have no idea if those will ever compile with a newer Labview... 2010 I think was the last thing Chad used. Also, it takes a little bit of tweaking to update the FPGA used by the C code, which I still don't think there are good directions for anyplace. But it is rather configurable, so you may not actually need to recompile it. The PID gains can be set by config files that the C code reads. Those config files live on the cRIO (pid.ini), so you could modify them via FTP to change them without rebuilding the software. You could extend the C code to dynamically set them instead of just reading the config files once as it does right now. The code is here: https://github.com/cwru-robotics/crio-code (if you don't have access... email me your GitHub user name and I'll add you to the people that do... we didn't make this open-source because we had no idea about the licensing of the NI generated FPGA interface code). None of that was ever exposed through the network interface as it is particular to the robot and we didn't expect it to change during operation.WARNING: The PID was never designed for dynamic gains (and who knows about whatever Chad was using internally (the NI PID block maybe...)) so who the hell knows what will happen if you change the gains between loops or while in motion. I can say for certain I wouldn't want to be anywhere near the thing while the PIDs have dynamic gains...