Help with encoders
pjtaylor84
Posts: 4
Hi all,
I am brand new to this forum and I am in desperate need of help. Here is my situation in a nutshell...
I am a senior at Sacramento State University and in a class taught by Estelle Eke. A very challenging and complex course was given to our class as the final project. The challenge consists of using 2 boebots simultaneously performing specific and limited tasks. For boebot #1 we had to design and build a robotic arm to lift and arrange 4 legos, place them on a tower, and sweep them into a small tub. This we have overcome and are now focusing on boebot #2. Robot #2 must traverse this course with 12 separate motions (forward, back, CCW turn, etc...) and do it all with a very high level of precision all while dragging a small tub. The need for the precision is driven by the fact that the legos are arranged in a way which is wider than the tub that they need to fall into. The larger pattern which the legos are place in demands that the tub is placed as close to the center of the tower as possible. Upon programming the boebot with standard code we quickly realized that the sequence of steps is to complex to accurately and consistently align the tub. We than surveyed ideas and decided to use digital encoders.
After many hours working with applying the encoders we realized that something is really NOT right. The encoders seem to function, but one major problem is apparent. While using Phil Pilgrim's code to calibrate the encoders to the exact pulse width we ran into a problem. While using the file calibrate_all.exe our data under the "pulse width vs. velocity" section seems to be very wrong. The data seems to follow a linear trend for the first and third set of 16 data points, but the second and fourth set are all 255.
We have tried everything that we can think of to rectify this problem. We have done the following... as a summary:
1. Tested our wiring for correctness (many times including complete rebuilds)
2. Tested ports to ensure proper function
3. Tested encoders to ensure proper function with an oscilloscope
4. Nulled servos as exactly as possible
If ANYONE has any information for us on using this code (calibrate_all.bs2) or anything that I could use to troubleshoot the code and find out where those 255 values are coming from PLEASE let me know. I will be checking my email very often.
Thank you!!
I am brand new to this forum and I am in desperate need of help. Here is my situation in a nutshell...
I am a senior at Sacramento State University and in a class taught by Estelle Eke. A very challenging and complex course was given to our class as the final project. The challenge consists of using 2 boebots simultaneously performing specific and limited tasks. For boebot #1 we had to design and build a robotic arm to lift and arrange 4 legos, place them on a tower, and sweep them into a small tub. This we have overcome and are now focusing on boebot #2. Robot #2 must traverse this course with 12 separate motions (forward, back, CCW turn, etc...) and do it all with a very high level of precision all while dragging a small tub. The need for the precision is driven by the fact that the legos are arranged in a way which is wider than the tub that they need to fall into. The larger pattern which the legos are place in demands that the tub is placed as close to the center of the tower as possible. Upon programming the boebot with standard code we quickly realized that the sequence of steps is to complex to accurately and consistently align the tub. We than surveyed ideas and decided to use digital encoders.
After many hours working with applying the encoders we realized that something is really NOT right. The encoders seem to function, but one major problem is apparent. While using Phil Pilgrim's code to calibrate the encoders to the exact pulse width we ran into a problem. While using the file calibrate_all.exe our data under the "pulse width vs. velocity" section seems to be very wrong. The data seems to follow a linear trend for the first and third set of 16 data points, but the second and fourth set are all 255.
We have tried everything that we can think of to rectify this problem. We have done the following... as a summary:
1. Tested our wiring for correctness (many times including complete rebuilds)
2. Tested ports to ensure proper function
3. Tested encoders to ensure proper function with an oscilloscope
4. Nulled servos as exactly as possible
If ANYONE has any information for us on using this code (calibrate_all.bs2) or anything that I could use to troubleshoot the code and find out where those 255 values are coming from PLEASE let me know. I will be checking my email very often.
Thank you!!
Comments
-Phil
-Phil
I do not have the boebot here with me. We work on it at school. If it helps the information that I typed in for the data example is quite close to the real data. The graph is in no way how it appears on the PDF demo. It seems that the data for the angular correction is ok (correlation coeff ~ .989). If you need the exact data I will get it you tomorrow am, ASAP.
Thanks a million!!!! I am very pleased to talk with you and I am dieing to see the code work to its full glory!!!
-Phil
Here is a screenshot of the debug screen.
I hope this helps.
Thanks,
Patrick
After hitting reset three times and watching it circle a few times in each direction, what does it do next?
1. Waggle back and forth three times?
····If yes, you've got a sensor that's miswired.
2. Just sit there?
····If yes, you need to wait awhile. Eventually it will start rotating counter-clockwise, very slowly at first, then with ever-faster speeds. Next, it will do the same clockwise.
The data you posted suggests that at some point -- who know's when -- it got halfway through this latter process (i.e. the counter-clockwise part) but got interrupted. It takes awhile, so you have to be patient.
The whole process can be broken down as follows:
1. Output the "neutral" pulse and make sure no encoder pulses are received. This checks the nulling.
2. Go fast counter-clockwise, then fast clockwise. This makes sure that the encoders are working and also determines what the top-end speed is in each direction.
3. Slowly ramp up the speed in each direction. This performs the linear interpolation necessary to determine pulse width from speed, given an array of speeds based on pulse-width.
-Phil