|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools |
Rating:
|
Display Modes |
|
|
|
#1
|
||||
|
||||
|
Re: Mecanum Encoders
Thanks for the replies. We have a gyro on the front of our mecanum chasis and coded in, however values only seem to range from 0.0-0.3. Is this normal? Also, we did believe that weight distribution among the wheels was a problem for rotation, but it seems that the wheels just are not spinning properly all-together. This might be due to a motor being inverted, I'll have to test this theory on Monday.
Also, could you explain how to either set the PID paramaters for each motor or use the gyro properly? I figured out how to set each individual PIDF for the 4 Talon SRXs in the loop so that shouldn't be a problem but only testing will tell. |
|
#2
|
|||||
|
|||||
|
Re: Mecanum Encoders
What kind of gyro are you using, and how do you have it wired? Does it work properly when you use the LabVIEW gyro example?
For completeness, are your mecanum wheels mounted correctly? At the top of the wheel, the roller axles should point toward the center of the robot. It should look sort of like an X from above, and the rollers should sort of form an O or diamond shape on the floor. If you have them reversed, the robot will not be able to control its direction very well. It might not be able to turn in place at all, and it will very likely rotate some when you don't want it to while trying to drive straight. |
|
#3
|
||||
|
||||
|
Re: Mecanum Encoders
Quote:
|
|
#4
|
|||||
|
|||||
|
Re: Mecanum Encoders
The Talon SRX always uses raw encoder counts as its PID unit. If you want to control them in closed-loop speed mode, you have to give them set points in "encoder counts per one hundred milliseconds".
|
|
#5
|
||||
|
||||
|
Re: Mecanum Encoders
When we meet again on Monday, I will check exactly how the wheels are mounted and post a picture. I will also check everything about the gyro. Lastly, I will post the results of that "test" of yours Ether
|
|
#6
|
||||
|
||||
|
Re: Mecanum Encoders
Where was this documented?
|
|
#7
|
|||||
|
|||||
|
Re: Mecanum Encoders
I found it in the TALON SRX Software Reference Manual, specifically the second paragraph of section 17.1. (Quadrature) Encoder Position.
|
|
#8
|
||||
|
||||
|
Re: Mecanum Encoders
Just as an update, I checked all wheel positions and they are mounted in the proper orientation where the rollers make an "X" towards the center. I also figured out what was wrong with the strafing/rotating. All I had to do was invert 2 motors, both of the left side mecanum wheels and the robot now can strafe, drive foward/backwards and rotate with ease. previously we could only Go forward and backward and rotate or go forward and backward and strafe. This brings up the old problem however...
Upon strafing at higher speeds, the robot spins out since the wheels don't turn at a constant speed. I have everything programmed in, the encoders, accelerometer, and gyro, I just need to know how to implement them into the code. Thanks! |
|
#9
|
||||
|
||||
|
Re: Mecanum Encoders
Quote:
Quote:
|
|
#10
|
|||||
|
|||||
|
Re: Mecanum Encoders
If the problem is mostly with the robot turning when you don't want it to, use the gyro to determine how far you're off heading and derive a "turn" correction to feed into the rotation input of the Mecanum Drive function.
|
|
#11
|
||||
|
||||
|
Re: Mecanum Encoders
Sorry Ether, I forgot to record this but I will do it tonight.
Alan, the problem is I don't understand how to incorporate the gyro back into the code after pulling the value out. |
|
#12
|
||||
|
||||
|
Re: Mecanum Encoders
Quote:
|
|
#13
|
|||||
|
|||||
|
Re: Mecanum Encoders
The value you get out of the Gyro Get represents the direction the robot is currently facing. Can you describe for me, in specific terms, how you think a skilled driver could use that information to keep the robot facing in a particular direction while it was erratically trying to turn on its own? If you can give enough detail about what you want the robot code to do, I can tell you how to wire functions together to do it.
|
|
#14
|
||||
|
||||
|
Re: Mecanum Encoders
The way I envisioned it, and correct me if I'm wrong, is that the gyro will capture the value of the angle that it is currently facing. This would work for any direction so that when you strafe, rather than having part of the robot swing out, the gyro will force the robot to maintain this header.
|
|
#15
|
|||
|
|||
|
Re: Mecanum Encoders
Quote:
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|