2015年3月29日日曜日

フォトセンサテーブル作成

マイクロマウスのフォトセンサの出力は距離に対して比例しない.なんとなく走らせるのであれば単調でさえあればリニアかどうかは気にしなくても良いかもしれないが,それではすぐに限界が見える.左右の特性の差も気になる.

そこで,何かしらの方法でセンサの出力を距離に変換するわけであるが,壁との距離d,センサ出力sとすると,対数近似(d=log(s)) やべき乗関数近似 (d=s^n)がわりとよくフィットするので広く使われているようである.こじまうすでは昔は対数だったが,何年か前にべき乗に切り替えた.特に意味はなく,そちらの方がよく一致していたからである.

と・こ・ろ・が,である.ピーコのセンサは全然違う特性を持っているではないか.既出とはいえ,本当に全然違うからまいった.

とはいえ,結局テーブルを作るのでそもそも何かの関数で近似できる必要はない.そこで,無理矢理5次関数近似で間を補完してテーブルを作った.次数の高い多項式近似では外挿が全く役に立たないことが多いので,計測範囲外は補完しない.赤丸が計測値,緑線が5次近似の結果であり,LDは左横センサ,LFは左前センサである.

なんとも気持ちの悪い特性である.

4 件のコメント:

Unknown さんのコメント...

That looks to me like the sensor begins to saturate at short ranges. What if you half the load resistor on the phototransistors?

Kojima さんのコメント...

At first, I also think that the sensors saturate at short ranges, but now I found that this characteristics comes from the layout of LED and phototransistor.As this photo shows, the distance between the LED and the phototransistor is large due to the PCB of 1.6mm thickness. In addition, beam angle of LED and reception angle of phototransistor are small. As the results, the phototransistor cannot receive enough light reflected from very near walls. So, I believe that changing the resistor has no effect for this characteristics.

Unknown さんのコメント...

I agree they are a long way apart and that will have the same effect. What are the devices? Recently, I was testing sensor pairs that are properly spaced and this is exactly the response shape I see if the emitter has too much current or the detector load resistor is too high.

Kojima さんのコメント...

Photo devices are OS5RKA5111A and ST-1KL3A. This robot (Pi:Co Classic) is designed by RT Corporation and the detailed information is not allowed to be opened.

I noticed another possibility. The tendency of the figure I showed may be caused by the saturation of rising time of photo transistor. I will write about it in the next post.

コメントを投稿