Yuxuan’s Status Report for 03/11/2023

This week I’ve been mostly working on creating a demo on Bluetooth communication and writing part of the design review document. The package initially used for Bluetooth communication is Pybluez. However, the package is not stable on Mac OS. I tried to install and import the bluetooth package and it already says it’s missing other packages. After installing the missing packages, it then says it cannot find the method inside the package. I’ve looked at many issue threads related to it on the repo and still cannot fix the bug. I believe that the code is importing packages that have conflicting versions that require manual fixes on the code after installation.  I’ve also tried a well-maintained package called Bleak but it’s mostly acting as a Bluetooth client and it provides little documentation for creating a Bluetooth server.
An alternative way to establish communication between two devices is using a TCP connection via a socket. I’ve tested the round-trip communication time between Mac running as an echo server and iPhone running as client but the result is not optimal. Sometimes the round trip time is more than 200ms which won’t meet our design requirements. The TCP solution and USB serial connection should be put as our backup plan in case the Bluetooth connection solution fails.

The work is mostly on schedule. I’m going to focus on installing the Bluetooth packages on a Windows PC once it’s available next week. Once the Windows PC is received, I will also try to test the Xbox emulator package and codes that read data from the game. If all the packages can be successfully installed and tested, the latter implementation for the game controller can be much smoother.

Qiaoan’s Status Report for 03/11/2023

This week I mainly focus on designing the gyroscope and analog trigger tuning algorithm. Those already existed solutions seems too simple for our design and I think it’s necessary for me to try to generate some methods of our own to map the gyroscope input to the output to the PC.

The first goal is to minimize the effect of shaking. It’s inevitable for a mobile steering wheeling holding by our user. The most straight forward solution is to add a threshold that filter out any changes smaller than 2.5 degrees in 0.1 seconds. In order to improve this, I’m thinking using a Gaussian filter which is usually used to blur images in image processing to generate an average degree output based on the gyroscope reading if the reading doesn’t change much for a while, which means the user is holding the steering wheel steady. By using a Gaussian filter that use time as the factor of proximity, we can make sure the geryscope reading closer to the current time has a higher weight, while the transformed output is not bouncing up and down rapidly since the reading a while ago is also considered. The exact weight for readings by time should be tuned by testing after receiving the component. Generally speaking, I think this can provide the user with a smooth transition rather than obvious change due to shaking. The picture shows a simple example of a Gaussian filter. Here in our case we will assign higher weight to newer reading. I’m looking into how to implement this, I think there are packages related with Gaussian filter and I need to transform my reading into the matrix it takes, or I can write a function of my own and in this way I can tune the filter easily by varing the weights I set.

The second goal is to map the linear reading from the sensor to a tuned non-linear output to better match the user experience. I would like to use logistic curve to represent the mapping from 0 to +/-180 degrees. The S-shaped curve provides less sensitivity when the steering wheel points toward straight forward or turning as much as possible, which allow users to perform these two actions when they are close to 0 or 180 degrees rather than exactly at those positions, and hence avoid cases like find it’s hard to drive a straight line since the user cannot hold the steering wheel exactly at 0. The center part of the curve is relatively linear and this will give users a more familiar feeling while steering normally. The graph below shows the function between reading from sensors and output toward to computer.

The sub-systems I need will be the gyroscope and analog triggers that I need to tune. The tool will be python language to let me write those algorithms. Numpy will be the main package that I will use. For the physical shell part Fusion360 will be used to build the 3D model.