Position Scale and Max Position Error
Inside the Stagehand Motion ControllerInternally, the Stagehand has no idea about Position Scaling, the Stagehand only deals in raw encoder counts. We hide raw encoder counts most of the time in Spikemark, and let the operator describe movements in terms of real-world units by establishing a simple ratio between encoder counts and real-world units. We refer to that ratio as Position Scale. Whenever Spikemark sends a command to the Stagehand that involves position data, it multiples the on-screen value by the position scale to compute the raw encoder counts that the Stagehand requires.
What About Position Error?This works great 90% of the time, but the abstraction leaks a little bit when discussing Max Position Error. Position Error is the difference between desired motor position and actual motor position. This is calculated several thousand times per second. There will always be some amount of Position Error since the world is an imperfect place, but the software allows the operator to set at threshold for what is ‘normal’ position error and what constitutes a real malfunction. Max Position Error is a setting which is the line in the sand between normal operation and ‘oh boy, we have a problem’. The ‘problem’ could be a disconnected encoder, a physical obstruction, or some other failure. Like every other position parameter in Spikemark, we display this value in real-world units, not raw encoder counts.
Let’s Play With NumbersSo you set this value to be something sane like 10″, or 3″, or 4 degrees. A value that makes sense for your rig (eg. “if my wagon is ever more than 3″ off during a move, it probably hit a screw in the track”). Internally the Stagehand uses the LM628 motion chip from National Instruments. This chip has a 16-bit register for storing position error. That means it can store position errors from -32,767 thru 32,768. So… when setting aMax Position Error, the value can’t exceed the raw encoder value of that range. Therefore, when Spikemark calculates the Max Position Error it has to limit the product of Position Scale * Max Position Error to some value that equals less than 32,767. The higher your position scale, the lower the allowable value for Max Position Error, because after the ratio is applied the final raw encoder count value can’t be more than 32,767.
How We Got HereIn earlier versions of the firmware, we had a bug where max position error was being incorrectly limited to 4 significant digits, so the max position error was 9,999. We fixed that bug and opened up max position error to the full value of the 16-bit register, but that was only done in the past few years so you may need to upgrade your firmware if you are running anything lower than rev-10. So now you now more than you thought was possible about Position Scale and Position Error.
If you have additional questions, feel free to email us at firstname.lastname@example.org. Thanks for tuning in to this month’s Spikemark Tip!