# Makerspace Papers #1: How to regain 20% of lost joystick input space through Squarificaiton and Input Theory

The long awaited Makerspace Papers are finally being worked on! I apologize for the immensely long wait. I will be releasing more papers soon!

1 Like

The white paper is locked so that you have to request permission to view it

7 Likes

The white paper is locked for me as wellâ€¦

The white paper is locked so that you have to request permission to view it for me also

I unlocked it apologies

I unlocked the paper publicly

Format

Please, please, please have clearer formatting and organization of information. Knowing where the definitions are and where the novel ideas starts is very helpful for understanding a paper.

Also, if you must insert informal sections about your life in a paper (this is CD - we all have to be humored every once in a while), please make it in clearer sections instead of randomly interrupting content with it.

Content

So from the point of your paper, youâ€™re mapping the range of a circular joystick onto a square, and saying that this gives you ~20% more input space. I would like to ask what the point of this is.

It appears that the mapping you proposed gives you extra range at the extremes (max forward and max left, max forward and max right, etcâ€¦). Have you found this to actually matter in driving?

In practice, weâ€™ve personally found that making high speeds turns can be achieved by kansai dorifto and pushing the stick max left to force the robot to drift. I question the controllability and drivetrain response of the input range you are trying to achieve.

Given the face that this method turns all â€ślinesâ€ť on the circle into a square. When you are turning left or
right but want to maintain the same forward thrust, you will have to follow along a circle. For more
advanced drivers who want more, this will be an ideal option as it still offers some form of intuition.


This also seems like a major issue, as it turns a simple go straight and push right to turn to following a curve thing to maintain constant velocity instead of using simple x-y controls.

All in all, what Iâ€™m saying is that this seems like a lot of work for something of minimal importance/consequence. Do you have any evidence to the contrary?

5 Likes

Interesting reading so far, thanks for publishing.

It must be noted that a differential drive robot can be controlled with two joysticks â€¦ My team only wanted me to do a single joystick algorithm.

Were you aware of the off-the-shelf arcade drive code that exists in WPILib?

But for a single joystick, even though the displacement detector for each axis has a input set of [-1,1], the joystick is bound in a circle!

Not all joysticks are limited to a circular input region. RC plane transmitters typically have square joystick input regions. Some industrial joysticks have user-replaceable â€ślimiter platesâ€ť which mask off unwanted areas of the input region:

2 Likes

Take the range [0, 1] which is graphed above. All possible values are between 0 and 1. Thus, the poles are 0 and 1

nope, still isnâ€™t what a pole is

3 Likes

I will say that I did end up not using the algorithm in the end. But it was a satisfying mathematical exercise that yielded some insights and might lead into more advancements in the future.

I also ended up deriving a polar equation for a Square which may be unique in the mathematical community. I remember trying to find such an equation and could not so I spent the night deriving one myself. I wanted to avoid the piecewise version knowing modulo would allow me to exploit the symmetry.

On a note: If a driver did become highly skilled, the algorithm would allow them to access higher levels of robot control without suffering too much oversensitivity. It would â€śraise the ceilingâ€ť of what they could do with the robot.

Using tank controls (left joystike left track right joystick right track) would preserve all of the â€śinput spaceâ€ť. But in terms of space, you do sacrifice the horizontal components of the joysticks. You could use them but they would be for something unintuitive and trying to access that while in main motion might prove even more difficult that a single joystick with higher sensitivity.

Of course, this optimization, because of the â€śCrush Theoremâ€ť (or Conjecture at least), states that there will be higher sensitivity, means that this is not suited for beginners. But for those seeking a higher ceiling of control, this will provide it to them without much cost.

has this higher level of control been experimentally proven, or is that also a conjecture

Again, if you want full range of travel on the x and y axes, just buy a joystick without a limiter plate.

It is mathematically proven that the input space is now at 100% since it is stretched out to cover all of the outputs..

What I havenâ€™t explicitly proven for the continuous sets was the â€śStretch theorem.â€ť Basically if you map an input space with a smaller size to larger one, there will be higher sensitivity since the smaller set has to have the larger amount of points pushed â€ścloser togetherâ€ť. This is intuitively correct. I just didnâ€™t hammer out any equations to prove it mathematically which is why I mentioned it was more of a â€śconjectureâ€ť at the moment.

Using gradients would yield the proof for 2 dimensional continuous input sets.

The Pigeonhole Principle is the proof for discrete input sets

maths modelling human control of a system is only useful if it can be experimentally verified

2 Likes

That wasnâ€™t an option in the discussion on my team. We couldnâ€™t afford such joysticks. I told them track control also was generally better in executing manuevers. But then the drivers wanted single joystick and a single controller. So I wanted to add that option for them if they wanted to attempt more advanced maneuvers.

Even though the use for the math outlined in the paper wasnâ€™t too necessary. It was a mathematically solution when the engineering solution wasnâ€™t possible. And the math in the paper that was developed has the potential to evolve into more advanced applications.

The most odd thing was when I place my own algorithm into their previous robot, the oversensitivity of their robot disappeared. Itâ€™s odd how just a few lines of code can change things drastically. They actually had to half the input to keep it from being hypersensitive(it was already oversensitive with the inputs halfed).

Small side rant: In the end. Engineering didnâ€™t make the robot in time and I was made driver by default. (I developed the tele and auto software on the robot for the previous year so that was a fun â€śdebug on the flyâ€ť experience-seriously, it was pretty fun.)

It was experimentally verified, but the geometric principles were already solid. In the paper it did mention the experimental validity of said math if you actually read it.

your refusal to use terminology consistent with broader mathematical usage, making up variable names without explanation, and throwing formulae and life stories in between derivations made it a little tough to extract meaning, gonna be honest

11 Likes

Mappings for Squaring the Circular Disk, Chamberlain Fong

In case anyone wants to properly understand the math that hid in the last couple pages

4 Likes

Hereâ€™s some stuff to chew on:

Although it may seem that a joystick position is continuous, itâ€™s actually discrete with a high number (probably 1024 or 4096 per axis, if I had to guess) of states. Instead of an infinite cardinality (size) the cardinality of your domain and range are large but finite. This may seem unimportant but it changes the math quite a bit- finite and aleph-null cardinality sets are fundamentally different from larger infinity cardinalities.

Building on that, I think you should re-think about what youâ€™re doing here. Youâ€™re not actually increasing the sensitivity of the joystick or regaining any â€ślostâ€ť control, youâ€™re just changing the shape of the output. I think you got close to this concept in post #13 but ended up turned around. If there are 1024 states per axis, then the cardinality of your domain (circle) is roughly \lfloor 512^2 \pi \rceil . The cardinality of your range (square) is 1024^2. Itâ€™s intuitive to see that itâ€™s impossible to write a function (one output per input) limited to the domain while spanning the range, which is an application of the pigeonhole principle.

Aside: If your domain and range were continuous (subsets of {\rm I\!R} which are aleph-one cardinality) you wouldnâ€™t have this limitation, which is kind of a mind-bending concept as your domain has a smaller area than your range and yet has the same cardinality, and so you can form a one-to-one mapping between the two.

In set theory terms this is a non-surjective injective function. There are elements in your range that do not have a corresponding key in the domain.

So really what youâ€™re doing is reshaping your output from a circle to a square, which is still a really useful concept to turn circular joysticks into ones that operate on the [-1,1] square that you want for FRC purposes, but not the same thing as reclaiming lost sensitivity.

I highly recommend you take a discrete math class as well as some other college-level math classes as you seem passionate about the subject.

5 Likes

Thatâ€™s basically right, but itâ€™s even worse: regardless of what your physical joystick is capable of, the DS will only send 8-bit data.