neurogears / vestibular-vr

Closed-loop VR setup for Rancz Lab
2 stars 0 forks source link

PMW3360 Sensor #19

Closed RoboDoig closed 6 months ago

RoboDoig commented 1 year ago

Want to utilise faster PMW3360 sensor for optic flow detection. Interface and addresses are in theory the same but when this sensor is used in place of PAA5100-JE the reported values do not appear to be linked to movement. Need to investigate firmware to see how we can have general solution for interchanging these sensors and also potentially PMW3389.

RoboDoig commented 1 year ago

From Ede:

Reading the docs made me realise that the optical sensor movement unit per 360-degree ball rotation is also an important parameter, which I measured, it is higher than with the original sensor we used, which is good, but it is also weird. I did full (slow) rotations with the ball and added an accumulated node to the X value in FlowSensor1. The weird thing is that it gives different values if rotating the ball clockwise or anticlockwise. One is consistent ~30500, the other ~24000 for 360 degrees.

I also checked the range of the PAA5100-JE just by hand-rotating the ball fast and looking at the sensor data. Bad news, at reasonably fast ball rotation speeds, the readout drops to low values. Brightness (SQUAL) values are good (90+).

ederancz commented 1 year ago

@RoboDoig, here is some more data.

The PMW3360 sensor I have is working as it should on a Teensy. The Arduino library is here: https://github.com/SunjunKim/PMW3360

Here is the readout from bonsai (both the csv file where you can see the readout ocassionally flipping between 2 values and the raw dump). https://drive.google.com/drive/folders/1R2CSanaWHLYM_wqbq9KUOYUN11Zdd0CX?usp=sharing

ederancz commented 1 year ago

From Andrew: A few things to check:

A PMW3360 and 3389 sensor was sent to OEPS on Monday 05 June. I can confirm that the current sensor is unable to keep up with our mice, so this issue is critical to our ability to start experiments.

RoboDoig commented 1 year ago

@filcarv can you confirm receipt of the sensors?

We are aiming to have the new sensor (PMW3360) integrated by end of June.

filcarv commented 1 year ago

Not yet. Do you have a tracking number?

ederancz commented 1 year ago

Damn! I checked with our postal service and they sent it as a simple letter, no tracking. I have 1 of each sensors left, will send them priority tomorrow morning, tracked this time...

Regarding practical usability, I just figured out that I used these in the very first prototype from a Logitech G502 mouse. Here's a video of how well it was working. https://drive.google.com/file/d/1sNaRegpXFsNwe5WQE0s7vkA3zGnt20T8/view?usp=sharing

filcarv commented 1 year ago

Let me tracking it down. To which address did you ship it?

ederancz commented 1 year ago

OEPS Att: Filipe CarvalhoEd. Neopark, Av Tomas Ribeiro 43Bloco 2, Piso 1, Sala 1J2790-464 CarnaxidePortugalCheers-----------Sent from my phone, please excuse typos and brevity.On 15 Jun 2023, at 19:41, Filipe Carvalho @.***> wrote: Let me tracking it down. To which address did you ship it?

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

filcarv commented 1 year ago

That's the right address. I will check tomorrow again.

ederancz commented 1 year ago

Hi @filcarv, I am about to post the sensors, did you have a chance to check if the first package arrived? Cheers!

filcarv commented 1 year ago

Didn't arrive. I will check tomorrow again.

filcarv commented 1 year ago

Sorry for the bad news, but there's nothing in the mail yet :(

ederancz commented 1 year ago

Sorry for the bad news, but there's nothing in the mail yet :(

OK, let's assume lost in action. 2 more were sent this morning, the tracking doesn't show yet, but it should be 2 days max. https://www.laposte.fr/outils/track-a-parcel?code=LJ002917055FR

ederancz commented 1 year ago

Hi @filcarv, according to the tracking info, it was delivered yesterday. Cheers!

filcarv commented 12 months ago

Hi @ederancz , good news! I've received the parts yesterday. And the initial shipping arrived today 😅

ederancz commented 11 months ago

Hah, great, thank you @filcarv! Long live La Poste! Let me know if you had time to look at these, the sensor speed is one of the critical bottlenecks for us now. Also, I am out of sensors now, so I would appreciate it if you could send 2 back close to the time when we need to test a new firmware.

ederancz commented 10 months ago

From Goncalo 11 Aug: The new PMW3360 integration will be developed by Filipe, he will be away for a couple of weeks but latest by sometime mid-September they should be ready to ship.

RoboDoig commented 7 months ago

Flow sensors have arrived and new firmware is ready for testing.

RoboDoig commented 7 months ago

Firmware for H1 was updated for the PMW3360 sensor (version 1.1).

Something to note that lost us a bit of time, the connector for the flow sensor must be in the correct orientation when the board is powered on, otherwise the H1 device will not be recognised.

RoboDoig commented 6 months ago

@EleonoraAmbrad have you tried out the sensor? Can I close this issue?

RoboDoig commented 6 months ago

Closing this issue as the sensor is tested and working. Still need to integrate into the proportional control workflow but this is a separate issue.

EleonoraAmbrad commented 6 months ago

true, sensor works fine! However the motor control seems to be a bit "jumpy" and changing the gain does not help a lot. We were wondering if one could introduce a smoothing function (that can be externalised) on the flow sensor output, to smooth the command sent to the motor.

RoboDoig commented 6 months ago

Opened a new issue #35