Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Mecanum steering (http://www.chiefdelphi.com/forums/showthread.php?t=114574)

carrillo694 06-03-2013 15:32

Re: Mecanum steering
 
I forgot to answer your other questions!

Quote:

I assume that you must need encoders to ensure that the motors are spinning at exactly the same speed. How would that be done?
The state-of-the-art solution would be to implement a PID feedback control loop. What motor controller are you using? Jaguars provide an easy-to-use speed controller, whereby you plug your encoder into your jaguar and set your PID constants in code. There is also a program through which you can quickly update Jaguar PID constants for tuning. With Victors, you must implement your own speed control feedback loop, but this is still made easier by the fact that WPIlib provides us with a plug-and-play PID loop. What programming language are you using? You can see an example implementation here. For more on PID in the FRC world, searching ChiefDelphi would probably yield good results.

Quote:

How about field-centric steering? Is that particularly difficult to program?
I already answered this in a prior post in this thread. But ask away for further clarification!

Ether 06-03-2013 16:57

Re: Mecanum steering
 
Quote:

Originally Posted by mrklempae (Post 1244501)
So it's really that easy to drive like that? I assume that you must need encoders to ensure that the motors are spinning at exactly the same speed.

I assume you meant "each motor is spinning at the correct speed".

Quote:

How about field-centric steering? Is that particularly difficult to program?
That's what a gyro is for.

The WPILib RoboDrive methods have an input for gyro angle.

Code:

/**
    * Drive method for Mecanum wheeled robots.
    *
    * A method for driving with Mecanum wheeled robots. There are 4 wheels
    * on the robot, arranged so that the front and back wheels are toed in 45 degrees.
    * When looking at the wheels from the top, the roller axles should form an X across the robot.
    *
    * This is designed to be directly driven by joystick axes.
    *
    * @param x The speed that the robot should drive in the X direction. [-1.0..1.0]
    * @param y The speed that the robot should drive in the Y direction.
    * This input is inverted to match the forward == -1.0 that joysticks produce. [-1.0..1.0]
    * @param rotation The rate of rotation for the robot that is completely independent of
    * the translation. [-1.0..1.0]
    * @param gyroAngle The current angle reading from the gyro.  Use this to implement field-oriented controls.
    */
    public void mecanumDrive_Cartesian(double x, double y, double rotation, double gyroAngle)



lcoreyl 16-03-2013 20:17

Re: Mecanum steering
 
Quote:

Originally Posted by pfreivald (Post 1243589)
Right. We checked for that, and the powered gyro was drifting at that speed.

any more information on what happened here? I'm hoping to take a look at an issue that was reportedly like what you are describing. We used the gyro in 2011 with no issues, but I've never personally worked on it.

To anyone, how does the gyro temp feedback work in the code? (I don't usually get into the programming so you should talk to me like I'm 6) I'm poking through the java API and didn't notice temp anywhere in the gyro class. Since the temp is obviously going to a different channel than the gyro, it seems i would need to also set temp up as a separate sensor, but that too i didn't see in the sensorbase class. ??

Also to add 2 cents on the general mecanum talk: We've used mecanum since 2011 and never seen the "forward command equals horrible spin result" described all the time on CD. This is without gyro or encoder feedback. We have never been accused of having really fantastically designed and constructed drivetrains and have never given much (or any) time to weight distribution. This year a test drivebase was made which exhibited something kinda like the "forward command equals spin", but it was very minor and the driver was able to compensate for it without much trouble. Just looking at it everyone figured the problem was the fact that the electronics board thrown on top had the battery cantilevered outside of the frame. At this point the battery had to be 25-50% of the total weight. :eek: THEN it was discovered that the 8020 frame was assembled incorrectly causing the frame to be warped. :eek: :eek: The combination of the 2 had one wheel taking almost none of weight. And still the driving behavior was not that bad. This leads me to the hypothesis that "forward command equals horrible spin result" behavior reported frequently is almost always caused by incorrect use or poor functionality of the gyro...

pfreivald 16-03-2013 21:23

Re: Mecanum steering
 
No, no additional information. Our driver is nails without it, and we don't need it for autonomous, so it's something we plan on investigating further in the off season.


All times are GMT -5. The time now is 22:50.

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