harvard-microrobotics / dpss

All of the important code for the Custom DPSS laser
MIT License
0 stars 0 forks source link

The new origin shift routine amplifies errors in position over many moves #3

Closed cbteeple closed 3 years ago

cbteeple commented 3 years ago

If you shift the origin several times, the position error gets larger and larger.

cbteeple commented 3 years ago

Why does this happen?

The routine measures the position offset from the home position each time the origin shift button is pressed. This means any error in position from the previous "origin shift" motion is measured as a user-desired position shift rather than an error shifting to the desired position (relative to home).

How to fix it:

Only update the "offset position" when the user is pressing a move button or using the joystick. This way the desired stage position (relative to home) is only updated when the user intends to move it.

cbteeple commented 3 years ago

This has been fixed HERE