| | Struggling with encoder wheel
|
|
I'm having a hard time finding a good algorithm for the encoder wheel I came up with for use on my webcam. The way I packed the bits in the lookup table has made it hard to get any speed out of the algorithms. I'm using NQC, and the LEGO OS seems (...) (24 years ago, 11-Apr-01, to lugnet.robotics)
|
|
| | Re: Struggling with encoder wheel
|
|
Pretty neat Chris. You've very nearly recreated a special kind of optical encoder that was developed by my former employers called a virtual absolute encoder. It didn't use diferent colors but it used a "time-window" to read the last few states off (...) (24 years ago, 12-Apr-01, to lugnet.robotics)
|
|
| | Re: Struggling with encoder wheel
|
|
(...) Can't you just use a large switch() statement inside a function to simulate a 64 element array? If none of the values in the array ever change: int array ( int x ) { switch ( x ) { case 0 : return element_0 ; case 1 : return element_1 ; case 2 (...) (24 years ago, 12-Apr-01, to lugnet.robotics)
|
|
| | Re: Struggling with encoder wheel
|
|
(...) If I had room for a 64 element array, I'd just use that and make a lookup table. Unfortunately I don't, and I can't figure out a way to pack things in and still look them up with any speed. I also can't find any way to mathematically convert (...) (24 years ago, 12-Apr-01, to lugnet.robotics)
|
|
| | Re: Struggling with encoder wheel
|
|
(...) I was wondering how you were handling the edge conditions. Have you tried making a wheel which is a continuous gradiant from black to white over the 360 degrees of rotation? Lookup wouldn't be required as there would be a direct relationship (...) (24 years ago, 12-Apr-01, to lugnet.robotics)
|
|
| | Re: Struggling with encoder wheel
|
|
Chris, This idea would require an additional motor, but, an alternate approach might be to create your wheel with 36 alternating grey and white (perhaps by having a third or fouth shade/color you could have more information) segments. Then, in each (...) (24 years ago, 12-Apr-01, to lugnet.robotics)
|
|
| | Re: Struggling with encoder wheel
|
|
(...) Hey, that was a great idea! I couldn't use ?/: to do it (NQC doesn't know those operators), had to actually write out all the if/else, but I actually just added it into my wheel generation program, so it printed out the function for me and I (...) (24 years ago, 12-Apr-01, to lugnet.robotics)
|
|
| | Re: Struggling with encoder wheel
|
|
(...) The light sensor just doesn't have that kind of resolution. I'd never get a very accurate position by doing that, I wanted a finer positioning system than I can get from using a rotation sensor. I'm trying to build something that's got (...) (24 years ago, 12-Apr-01, to lugnet.robotics)
|
|
| | Re: Struggling with encoder wheel
|
|
(...) I thought about something like that, but using 2 wheels and 2 touch sensors, not just one, and using my 2 bit encoding system like on the light sensor wheel. But I'm not sure how to build small round things out of Lego that have 36 divisions (...) (24 years ago, 12-Apr-01, to lugnet.robotics)
|
|
| | Re: Struggling with encoder wheel
|
|
(...) Yah, but if I'm gonna build my own sensors, there's a lot I could do. I'm sort of a purist. I'm trying to stick with the stock sensors so that most people can build a copy of my system. Printing out something on a printer and gluing it to (...) (24 years ago, 12-Apr-01, to lugnet.robotics)
|
|
| | Re: Struggling with encoder wheel
|
|
Hello, (...) What is Lego made out of? ==> ABS plastic What can you buy in sheets with the same thickness as Lego? ==> ABS plastic So what I would do if I were you is go to a modelbuilder's supplier and ask for a sheet of ABS of 1.5 (?) mm thick. (...) (24 years ago, 12-Apr-01, to lugnet.robotics)
|
|
| | Re: Struggling with encoder wheel
|
|
hi Chris, (...) That's in fact a good principle. Isn't it possible to improve the dynamic range of the light-sensor by taping the red LED, I read that somewhere but I don't know where. Why not use a continuous grayscale, with pure with and black (...) (24 years ago, 12-Apr-01, to lugnet.robotics)
|
|
| | Re: Struggling with encoder wheel
|
|
(...) You could make a big wheel made of lego plates, and put smooth ones on top for 'colors'. Then you could use a touch sensor, and use the difference between the low spots and the high spots as 1 location. Do you really need to know the direction (...) (24 years ago, 12-Apr-01, to lugnet.robotics)
|
|
| | Re: Struggling with encoder wheel
|
|
(...) I did an experiment printing out many different gradients and I now understand part of your problem. It was hard to get any change in the reading (~40 - 50). So next I then cut a wedge shaped slit in a piece of white paper. Aiming the sensor (...) (24 years ago, 13-Apr-01, to lugnet.robotics)
|
|
| | Re: Struggling with encoder wheel
|
|
As I am not so purist, I think that an angle sensor based on a small potentiometer (There's a description on Michael Gaspari's site) would be the simplest solution... But your absolute encoder is a challenge in itself! What about using two (...) (24 years ago, 13-Apr-01, to lugnet.robotics)
|
|
| | Re: Struggling with encoder wheel
|
|
(...) You could build a rotation sensor found on Michael Gaspari's site, using a magnetic strip. It is supposed to give 40 or so counts per revolution. Andy (...) -- See my Visual Interface for leJOS at (URL) (24 years ago, 13-Apr-01, to lugnet.robotics)
|
|
| | Re: Struggling with encoder wheel
|
|
(...) That was the first version of the webcam mount. After rotating back and forth a few times you can't tell where the camera is anymore. There also aren't any 42 tooth gears BTW, just a 40. Last night I used the datalog to record what the light (...) (24 years ago, 13-Apr-01, to lugnet.robotics)
|
|
| | Re: Struggling with encoder wheel
|
|
(...) I have noticed the lost count phenomenon also (you attribute it to gear slop on you web page, but gear slop will give you errors in the 1/2 a tooth range or less and it doesn't get worse over time). In fact there was a very long thread about (...) (24 years ago, 13-Apr-01, to lugnet.robotics)
|
|
| | Re: Struggling with encoder wheel - Not anymore!
|
|
Well, I think I got it working last night. Many thanks to Steve Baker for the brilliant idea of hardcoding the lookup table array as a function. It works great! I had to gear down the rotation for the tilt mechanism, but the pan was fine as-is. When (...) (24 years ago, 14-Apr-01, to lugnet.robotics)
|