Sunday, May 5, 2013

Firmware Calibration Mode

After a lot of back and forth with the guy over at oDesk, we are now very close to finish this up. He has added filtering and the calibration mode! He has gone way beyond what I expected as well. Not only is the LEDs indicating in a nice way what is going on, he just now also added the Joystick USB descriptor which will send the filtered and scaled data over the USB as if it was a joystick/gamepad.

 LEDs explained:

Normal operation:
- green led on.
- yellow led blinks on motion detection.
- red led is off if all is fine, otherwise it's on to show some error occurred.

Calibration mode:
- the green led start blinking.
- the red led is off until you start moving and no stable value is found
- when running the red led blinks if there is no stable value
- when moving the red led is always on if a stable signal is detected
- the green led stops blinking if the calibration is done (stable for more than 5sec).

It will time out after 25sec if it doesn't finding a stable value.

He has added so it responds quickly (150ms), and from what I've tested in a joystick test application it really behaves beautifully! It outputs 16 bit values so value range is  −32768 to 32767 and I get around 3000-5000 when sneaking, 14000-16000 when walking, 22000-24000 when walking a little faster, and maximizing at 32767 when running. I love it!

Here are some graphs of data, and one can clearly see that it can handle noise and variations beautifully. What I did was walking, and then stop, and then run.




Tuesday, April 9, 2013

Omni Treadmill by Virtuix

A college of mine gave me a link to this cool project:



This is basically the vision I've had in my head for a long time with my own project here. Other things has kept me too busy though.

This will be a Kickstarter project later this year. May or so. I really hope it won't be expensive. However, I will probably back this on Kickstarter anyway, because it's what I want as well. Hell, it's why I'm doing this project in the first place!

This project of mine will still be ongoing. If nothing else, it will be a much less expensive alternative. With my solution, you can already use your existing treadmill or exercise bike. And besides, my PCB has other uses as well. Virtuix Omni Treadmill is much more intuitive though. Especially with Oculus Rift which is helping them out as well. Combining those two and you have a whole 360 degree virtual world. Mine is more 90 degrees. Also, Virtuix is more of a business, this is more of a hobby. At least so far.

Wednesday, March 6, 2013

Firmware Improvements - Behind The Scenes!

So, you might be wondering what progress is made since I hired the guy at Odesk? Well, here are some early photos from the guy himself:







And this is images from a few days ago:








Man, isn't that awesome!? Talk about dedication!

During the process, he send me the .hex file (compiled firmware), ready to flash on the device to use.

So, what I did was, flash mine with it, put it on my treadmill, and started recording the data that was send over serial connection. I first start walking for a while. Then I stop. And then I run/jog on the treadmill.


First firmware I got gave this result:

This isn't all bad, but not particularly good either, as it basically is the same kind of noisy data I got. Only difference here is the higher values.


Second firmware I got gave me this:

I have no idea what happened here (averaging too much?), but this is obviously bad. I did walk first, and run second, but they are at the same height and way too blocky...


Third firmware I got gave me this:



Wow! Look at that! I'm quite pleased with that result right there! Best I've gotten ever! Almost no noise at all, and seems quite stable!

And now, he is working on the "calibration mode" which will make it possible to teach the device what this data actually means!

Monday, February 4, 2013

oDesk - Treadgaming Firmware Improvements Part 2

A while back I posted about hiring someone at oDesk to help me improve the firmware. Back then I decided to not do it as it seemed it could turn out quite expensive as it wasn't a fixed price. I wanted it to be ongoing, but then I realized that for those improvements, it would be too much money.

I have made a few improvements since. Important ones being moving data from the interrupt routine (which should just take a few milliseconds maximum, but I had main code there) to a main loop, outside the interrupt. And it behaves a lot better. It basically responds better.

I also fixed two things at the same time - overflow and timing. That is, I fixed so the timing actually is what is excepted, such as being 1s instead of 500ms, and this was solved by enable a overflow interrupt. An overflow interrupt basically calls a interrupt routine (function) when a counter makes a address/variable overflow for what high value fits in it.

As I'm quite busy and I figured that it's more beneficial to the project to have someone more experienced with DSP and knowledgeable in assembler for AVRs (to optimize) to do the last important part, so I went back to oDesk again to hire someone. This time at a fixed price. This way, it will be able to reach high quality faster, as it will take time for me to learn what I need to, to do this by myself.

You can find the job here: https://www.odesk.com/jobs/Treadgaming-Firmware-Improvements-Fixed-Price_~01901c68264f5ea51a

And, as you can see, I already hired one guy that seems quite promising. I just send one PCB to him today, which means he should be able to start working on this latest Monday next week. I will send my firmware soon as well, so I suppose he will start even sooner.

While I was talking to the guy, sending him some example data, he gave me some graphs back.

 Original

This is a graph of my raw data I send to some applicants. Here I first walked for a while. Then I paused for a moment. And then started to jog/run. Even the small backwards motion at the end is correct as my treadmill went backwards a little when I walked off.

 Filtered

So, this is better than the Low Pass filter. As you can tell from the graph above, it's not reaching 0, but he will fix that as well.


  Spectrum


Gotta love graphs! :)


He will also add "calibration" mode to the firmware, which will basically teach the device what speeds are what, so walk and run can be mapped correctly over USB as a gamepad or whatnot.

I can't wait to see what he does! I'm quite excited to see what comes out of this! And, if all goes according to my plan, the end product out of this will be at a acceptable quality level to sell the thing! I haven't been satisfied with the software quality, which is why I haven't started selling it yet.

I don't even know how many are interested in buying this, which normally is bad I know, but I do this just to learn how doing these kind of things works. So whether it will sell well or not, it's a good learning experience! And, when I actually sell it, I want it to give a fantastic first impression and just let it scream quality! Besides, I haven't done much marketing at all, so I'm expecting slow start anyway. But, I'm a strong believer in making something of quality, so if you are interested in this kind of thing, you shouldn't have to be disappointed! That way, it's a win-win. I would also love to see some creativity using it not only for what I had in mind. Anyway, time will tell here I suppose...

Also, I will also update this blog more often when there is more activity here. Especially when more and more of those PCBs are sold. Posting tips and tricks or whatnot. Would be fun to post about what other creative people come up with as well!

Oh, and there is also one new guy at oDesk that I'm thinking of hiring just because he seemed so into the project, and he also gave me a simplified version of the Kalman filter, which I applied and had some nice results out of.

Sunday, October 14, 2012

Simple Low-Pass Filter

After the odesk post, I did some major improvements in the firmware, and thus it wasn't as important to hire anyone anymore.

I've also looked into the Kalman filter, but for now, maybe a simple Low pass filter is enough...

Why? Well, just look at these graphs:


Raw Data

Low-Pass filter test 1




Low-Pass filter test 2


Isn't that lovely? I mean, it's pretty clear what is what. Obviously the data should be smoother, and is something I will experiment with some more. In a way though, it's good like that because if this can be handled, better data will obviously work as well! There will be a "calibration" mode where one will teach the device "walking" and "running", so what values that actually means, shouldn't matter as it will be based on the "calibration". In this test, one could say average of 500 is running, and average on 250 is walking, which is funny as 250 is half of 500... :)

So, I tweaked the low pass filter to put really low value on current raw data and I got this:

Low-Pass filter test 3 - 0.005


Low-Pass filter test 4 - 0.001


Look at that! I didn't even bother marking what is walking and running here as I suppose that is quite obvious! The main problem here though is that it will not reach 0 if you stop too soon... I guess that can be solved by just implementing some kind of "idle" timer of some sort... Again, it's only a problem when there is no data coming from the sensor, aka, no movement. So, I suppose a simple idle timer could just send 0 after a short while and that should solve that issue.

Wednesday, September 12, 2012

oDesk - Treadgaming Firmware Improvements

I thought I would give oDesk a try. And what better than to improve the firmware that is making this project stall for too long?

I'm busy with other projects as well, so I thought, why not pay someone to help me getting this project out there?

Thing is, I really want to the first impression and the quality of this product to be amazing! Which is why I haven't started selling seriously yet. I want the initial firmware to be useful, but the raw motion data I currently get just don't want to play nice with me. So, I put this up:

https://www.odesk.com/jobs/Treadgaming-Firmware-Improvements_~~3d304b5956ff3190

And hopefully, there will be someone that can help me with the things needed to get up to par with the quality I want before I sell this.

I'm also working on that "Mouse add on", which will be put up on Thingiverse as well, so people can create their own "Open Source High-end Mouse".

I just want the starting point to be an easy one. Naturally, then I'm hoping for community improvements. :)