|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Hey guys
Been working with encoders the past few days on the drive train. Both encoders are e4p models, though one has an H in the model while the other has all Ds. I'm not exactly sure of the entire model number as I don't have them in front of me, but I definitely know one is all Ds and the other has Ds and a H. Our Problem: The one with the H is reading the values way slower than the other. The robot could be on full throttle for 5 seconds and this encoder would be at 40 while the other would be at 1500. Major difference. I figure you could just scale the faster one way down to match the slower...? Any ideas? please help!!! |
|
#2
|
||||
|
||||
|
Re: Encoders getting different rates
are they both consistant (when the fast one reads 3000 does the other read 80)?
|
|
#3
|
|||
|
|||
|
Re: Encoders getting different rates
what do you mean by consistent? I haven't really looked at the numbers like that if they are consistent with one another.
|
|
#4
|
||||
|
||||
|
Re: Encoders getting different rates
if, for exampe, for every 800 counts of one of the encoders is 1 count for the other, the slow one you can set 800 for the distance per count, and the other one (the faster one) you can set 1 for that amount. This will make them equal the same.
|
|
#5
|
|||
|
|||
|
Re: Encoders getting different rates
Quote:
I have another question: The side with the higher reading on the encoder right now spins faster than the other side. Once I tune the encoders to be consistent like you said, is there a way I can get the faster side to spin the same speed as the slower? I assume like a pid system where the encoder on the slower side is the setpoint and the encoder on the faster side is the process variable. How would I make this work with a tank drive though? Any help? |
|
#6
|
||||
|
||||
|
Re: Encoders getting different rates
you would have to tune them when both motors are running at the same speed. do you have a rpm meter in your shop?
|
|
#7
|
|||
|
|||
|
Re: Encoders getting different rates
I don't believe we have one. Yesterday, I was trying to multiply the faster side by a constant before it is fed into the tank drive block to attempt and get it close to the other side. I didn't get very far as my mentor was telling me that it would be easier to do it when the encoders are in sync.
|
|
#8
|
||||
|
||||
|
Re: Encoders getting different rates
that is right, but how would you get them in sync if the motors aren't turning at the same speed?
|
|
#9
|
|||
|
|||
|
Re: Encoders getting different rates
That's exactly what I was thinking. Today when I go to work on the robot, I'll probably work again with that constant to multiply by. Seems like the only way I can really get both sides close to each other.
|
|
#10
|
|||||
|
|||||
|
Re: Encoders getting different rates
This seems like a very bad idea. You currently have two encoders that aren't functioning at all the same, and you're thinking of fixing the problem by scaling the outputs? You don't even know if you're getting good reliable values from the encoders. I would very much recommend that you first verify that the values from your encoders at least somewhat correspond with reality.
If you get the wheels off the ground and give your drive train a full forward command, the motors will be turning pretty darn close to their no-load speed. That'd be 5200 RPM. You should be able to calculate what the rate reading of your encoder should be based on that and the gear ratio of your transmission. Hopefully one of your readings gets close to this number. Then you know which encoder is wrong and you can start looking at that one to figure out what's wrong. It might be bad wiring, a bad code wheel, a different code wheel, an incorrectly installed code wheel, bad programming.... What ever it is, you're better off figuring out why these encoders are so different and fixing that problem instead of making a workaround based off assumptions you haven't verified. For all you know, the encoder that's reading 50 counts isn't actually plugged in and you're reading noise on the digital IO lines. |
|
#11
|
|||
|
|||
|
Re: Encoders getting different rates
Quote:
|
|
#12
|
||||
|
||||
|
Re: Encoders getting different rates
i said to do that if they are consistant, meaning that there isn't a problem, other than different scaling
|
|
#13
|
|||||
|
|||||
|
Re: Encoders getting different rates
Quote:
Find out what the full part numbers are and you'll probably see why one of them is reporting much smaller values. |
|
#14
|
|||
|
|||
|
Re: Encoders getting different rates
Quote:
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|