![]() |
Re: Encoders on mecanum drive?
Quote:
|
Re: Encoders on mecanum drive?
Quote:
Swiveling caster with an encoder will only track total distance traveled from starting. Unless you track wheel spin and another encoder of the orientation of the caster. Which may, in fact, be what the poster meant originally and I misunderstood. |
Re: Encoders on mecanum drive?
Quote:
Code:
/* |
Re: Encoders on mecanum drive?
Quote:
|
Re: Encoders on mecanum drive?
Quote:
|
Re: Encoders on mecanum drive?
Quote:
This is different than absolute field position. It would seem in autonomous we are concerned with absolute position of the robot in relation to the field and/or field elements so we know where to make the robot go to in order to pick up a tote or other task. Field oriented drive (the code posted) does not help with that aspect of the task. |
Re: Encoders on mecanum drive?
Quote:
How do you intend to process 2 encoder signals to detect those 3 motions? (forward, strafe, rotate)? |
Re: Encoders on mecanum drive?
Quote:
|
Re: Encoders on mecanum drive?
Quote:
|
Re: Encoders on mecanum drive?
Quote:
|
Re: Encoders on mecanum drive?
Okay, well, I seem to only have gotten one decent solution, that I get encoder values and reverse the mecanumDrive trig functions to get distance.
problem: i still don't understand where they even attach to and what exactly they measure. Do they still measure distance traveled? How do I even track direction with 1 encoder per wheel? If i go 45 deg to the right of initial orientation, and I move 1m, what would the 4 encoders even read? as of right now we don't have a base, nor anything to attach mec wheels to, so... until then us programmers are kinda sitting here putting stuff on smartdashboard... |
Re: Encoders on mecanum drive?
Quote:
|
Re: Encoders on mecanum drive?
Quote:
2) There are several sensors available to us. We need to be careful on units. Encoders measure rotation of a shaft. A quadrature encoder also detects the direction (CW/CCW) the shaft is rotating - VEX has a good writeup on how that works. If you know the circumference of the wheel turning the shaft and divide by the pulses per rev (PPR), you can calculate the distance travelled. If in addition you know the time over which you took the measurement, you can calculate the linear velocity of the wheel. The WPI API code for the encoders will both count the pulses and convert them to velocity. 3) The typical way to (indirectly) measure R is to use a gyroscope. The gyro gives you angular velocity at the physical location of the sensor. If you want the direction you are facing, you need to "integrate" the velocity over time to get degrees from your starting orientation. This is useful for mecanum in that you can use it to drive straight by adjusting the power to the wheels in such a way to maintain a zero angular velocity (not turning) while you move in any combination of X and Y. Gyros are notorious for having "drift" which means that very small errors in the measurement of the angular velocity can create large errors during the integration process to create the current orientation angle. You tend to use velocity for teleop control and angle for autonomous (only 15sec, so drift not an issue). 4) encoders can be used on either the driven wheels or on separate non-driven wheels (which my team calls a pedometer). Most FRC gearboxes have an easy way to mount an encoder. If you are using mecanum wheels, you may need to reverse the trig to separate X and Y. 5) Another way to measure R, is with an electronic compass. This directly measures the sensor orientation with respect to magnetic north of the earth. The issue is that other magnetic fields (motors) can confuse it. In the end, you need to first decide what you want to control, then how you are going to measure it (and with what sensor). There are lots of example code on how to control a mecanum drive with encoders plus a gyro. |
Re: Encoders on mecanum drive?
Quote:
By the way, there are no "trig functions" required to do mec inverse kinematics. *due to an incorrect inverse kinematic computation, or differences in motor controller calibration, or differences in performance among the 4 motors, or differences in resistance among the 4 motor wiring circuits, or differences in friction among the 4 gearboxes, or differences in friction of the rollers among the 4 wheels, etc etc etc. |
| All times are GMT -5. The time now is 06:28. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi