Wednesday, October 30, 2013

Robotics - Infrared Sensor

While some other people tried to get the other conveyor belt on (without enough links), I tried to correct the lack of sensitivity on the controls. Since the joystick puts in values up to 128, but the motors take values up to 100, I figured that it could be more sensitive if I scale the inputs instead of clamping them. That took quite a while to get right. At first, the scale function produced zero for a negative input. I fixed that by changing some of the variables to floats. Then, it was insanely more sensitive going forward than backward. That was fixed by compacting the function to one line. Finally, the scale function produced positive outputs even from negative inputs. Evidently, I didn't think that the nature of division would keep the sign and had added an inverter factor; removing that part made it work correctly. We then started to investigate the infrared sensor, which will be useful during the autonomous period. It's been attached (somewhat) and I have begun reading white papers on how to properly address it in code.

No comments:

Post a Comment