Strange Translation Values

Post questions, comments and feedback to our 3Dconnexion Windows Development Team.

Moderator: Moderators

Post Reply
Jared
Posts: 6
Joined: Mon Jan 14, 2008 3:20 pm

Strange Translation Values

Post by Jared »

I'm using C++/CLI to poll the sensor. In general it appears to be working right:

Code: Select all

float translationX = tdx->Sensor->Translation->X;
fLength += translationX;
But, sometimes the sign value for pushing in the x direction flips for a short period of time and my object starts moving in the wrong direction (it is either flipping, or getting the wrong number entirely). Am I missing a step? This appeared to work fine for other test code I've written.

Jared
jwick
Moderator
Moderator
Posts: 3341
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Post by jwick »

Hi Jared,

Does this only happen around zero? The device can oscillate a bit when you let go of it.

How fast are you polling it?

Jim
3Dx Software Development
Jared
Posts: 6
Joined: Mon Jan 14, 2008 3:20 pm

Post by Jared »

It occurs even when the pushing the device all the way forward. It seems that the flipping of the sign occurs around the time the device re-zeros as once it is moving, the sign appears to stay static until I let the device rest (or come close to rest anyway).

The polling occurs ~10 a second.
Jared
Posts: 6
Joined: Mon Jan 14, 2008 3:20 pm

Post by Jared »

Here is an interesting observation. When moving the device forward on the x axis, the after a while the number started to get smaller and smaller until it nearly zeroed. Then when I let the device settle back into natural zero, it started to get numbers of the opposite sign.
Jared
Posts: 6
Joined: Mon Jan 14, 2008 3:20 pm

Post by Jared »

Do I need to be doing something with the Length property? I haven't had to use it in the past, but I've never fully understood what it (and angle) actually did.
jwick
Moderator
Moderator
Posts: 3341
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Post by jwick »

Is fLength something in our COM interface? I'd treat it as read-only. Don't set it. Just get it.
Jared
Posts: 6
Joined: Mon Jan 14, 2008 3:20 pm

Post by Jared »

I'm an idiot. I had an axis typo which I finally figured out by disabling all the axis in the control panel except the one I thought I was working with. Thanks for the help.
vijay555
Posts: 5
Joined: Sat May 31, 2008 4:35 am

Post by vijay555 »

Jitter - hi all.

I'm having a similar problem, when reading raw axis input values using Direct Input, that you get a degree of "jitter", so eg when pushing extreme left, you will see the input values for deflection jitter and jump back towards what would be perhaps 50-70% left deflection.
So eg, where deflection should be (notionally) eg -100, the deflection jitters around -80, -50, -100, -100, -100, -80 etc

Does anyone know how to eliminate the jitter? The 3DX driver seems to eliminate or smooth out the jitter, but ideally I would like to eliminate the driver and just use Direct Input values.

Many thanks!

V
jwick
Moderator
Moderator
Posts: 3341
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Post by jwick »

Hello vijay555,

Do you have an example to show this to us? Do you get the same jittering when you are not at the extremes?

If you are polling with DirectInput, make sure you don't poll faster than 60 Hz (30 Hz to be safe). If you poll faster than the device can send data (62.5Hz) you will get erroneous data from the operating system.

The 3DxWare driver and the API do have some techniques to iron out various wrinkles.

Jim
3Dx Software Development
vijay555
Posts: 5
Joined: Sat May 31, 2008 4:35 am

Post by vijay555 »

Many thanks Jim.

For an example of my experience, I was just using the "DI8ExamplePoll" example from the SDK/FTP (unmodified). Monitoring the input values, I could see that as I move in any particular direction, you would receive "jitter", eg where I am holding the cap at an approximately stationary position, the deflection values received in DI8ExamplePoll read as if you get the occasional "blip", say every 5 polls. This blip would typically be a random reading anomalously in the opposite direction, quite a bit off of the "actual" position (so more than just a little shake from my hand, but quite a bit off, indicating a positive deflection even when I am at the extreme left deflection etc).

As you say, the 3DxWare driver seems to iron this out, I presume by taking averages or rejecting such anomalies, but I was interested if anyone has any techniques in place to do this without the driver?

Many thanks again,

Vijay
jwick
Moderator
Moderator
Posts: 3341
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Post by jwick »

Hi Vijay,

Yes, I also see what you are reporting. It seems to have a heart beat that causes it to misrepresent the values on a regular basis. It may have something to do with the time between polls. I'd have to look into it further to see if it is a problem in that demo or in DirectInput. I'd suggest trolling the Microsoft DirectInput sites for information. That demo code is based on a MS DI example.

We don't specifically recommend DirectInput. We provide the sample in case someone already has DI code and wants to see how to incorporate the 3Dx device into that code.

Jim
vijay555
Posts: 5
Joined: Sat May 31, 2008 4:35 am

Post by vijay555 »

Many thanks Jim.

If you get a chance, I'd really appreciate it if you can spot anything in the demo. I'm afraid this is my first DirectInput device, so I wouldn't really know where to start on MS's site, but I'll have a look around.

For now, I'm with you: I'm happy to use the 3Dx driver as it eliminates that "heart beat", but you know the coder's itch - I'd love to figure out the problem in the other code as well :)

Thank you once again for your help.

V
lhmncantoni
Posts: 18
Joined: Wed May 28, 2008 11:35 am

Post by lhmncantoni »

Hi, I've been getting the same problem, however I am not seeing where in the 3DxWare driver you can have it iron out those little "jitters".

Just a little background on my problem. This "jitter" doesn't happen only at the extremes, in fact, while testing I've noticed it more when going slowly. Also, my "jitter" is not originating from a sign change either. I've been pringting out my data to a log file that I tail and I see that the values involved are of the same sign but just different, usually by a decent margin. To better track the numbers I would turn off all but my Rz axis and twist it slightly right then recalibrate it like that. Then when I let go of the device it reads a constant left rotation however the values still come out different.

Thanks again
~Nick~
"Know something about eveyrthing, and everything about something."
vijay555
Posts: 5
Joined: Sat May 31, 2008 4:35 am

Post by vijay555 »

@lhmncantoni
Yes, exactly what I've seen.
Agreed, not just at the extremes, although I pushed to the extreme just to be sure the value shouldn't go any higher, and I still find jitter.

Also agreed, the jitter will not necessarily be a different sign, but can be off by some margin, eg going from -300 to -200, but when this represents a jump of 30% of maximum deflection, it makes a big difference.

Also agreed this is in every axis - yesterday I tried changing the polling frequency, and it makes no difference, high or low, you still exhibit the same jitter.

Anyone who wants to test this, have a quick go with this slightly modified example from the SDK.

http://www.vijay555.com/vj/releases/spa ... lePoll.exe

I've not noticed this problem with the 3dxware driver: I presume that they average out a number of readings, but even so, one would see some minor deflection, but no, the 3dxware driver is rock solid under the same conditions.

@mods - Any chance we can find out what smoothing is being applied in the driver?

Thanks!

V
jwick
Moderator
Moderator
Posts: 3341
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Post by jwick »

The driver doesn't use DirectInput. I suspect the problem is in DirectInput.
Post Reply