Wednesday, December 21, 2011

Update: fail-Way gets a new accelerometer

Hooray! More new posts.

I was walking around Fry's and I spotted a Nyko-brand nunchuck for $9 so I picked it up. Testing showed that the nunchuck worked, so I proceeded to open it up. This secific nunchuck had a vibration feature, so there was a small pager motor, as well as some additional circuitry for controlling the motor.

After confirming that it worked, I figured I would try to minimize things, and since I wouldn't be using the joystick portion, I removed it. Unfortunately, the process of doing that resulted in the loss of some SMD components, and the Nyko board stopped functioning correctly. It's not totally broken, as the accelerometer still reports data, it's just very slow and unresponsive at times now. There goes $9. (I did salvage the two buttons, the motor, and the joystick, so I guess it's not a total loss)

Yesterday I was browsing Radioshack and saw a Gigaware-brand (Radioshack's brand or something like that) nunchuck on clearance for $8: even better, if it worked. Tearing into that one showed an even simpler construction, with less wires. After testing that the connector worked, I de-soldered the wires from the board to directly connect my WMP board to the NK board. Luckily the board has convenient labels to show which pad is which.

At first, I was worried because now neither device was responding. After double checking power and data connections, I logically figured out the problem was switched SCL and SDA lines. What had thrown me off was the fact that the Gigaware nunchuck board is mislabeled, with those two lines switched. I did get it working in the end, though.

Now I have a nice and tidy sensor package with convenient mounting holes, ready to be put into use. As a bonous I also get 4 buttons and two 2-axis joysticks.

Sensor costs: $18 for the Wii Motion Plus and $8 for the Gigaware Nunchuck = $26 isn't bad for a 6DOF IMU (for the same functionality as this $60 product, no offense Sparkfun...) [$36 if you count R&D for the Nyko Nunchuck...)

Thursday, December 15, 2011

Update: fail-Way v0.1

Hey look, an update. This is promising.

I've since tracked the problem with my Arduino to a fried diode (I'm assuming I tried to pull too much current through it) which I have since replaced with a piece of wire (since I can't readily buy a replacement). I just have to remember not to apply external power while connected to the computer.

The hardware is essentially the same. I just tried to use less rubber bands on everything (and instead went with electrical tape...)

With a working Arduino again I've continued my quest to make this thing balance. The first thing I did was try to optimize the code by removing all calculations not related to the roll axis (the one I'm using for my robot). I also added a line to convert gyro_roll readings from degrees/second to radians/second. It seems to react faster with radians, so I'll deal with those. It also fixed the problem I was having the the PD control code. Here is the most recent iteration:

Out1Raw += (int) rollCF * KP + rollR * KD;
Out1Srv = map(Out1Raw, -120, 120, 27, 163);

1: PD control code from Shane Colton's SegStick instructable, with my variables
2: the motor controllers I'm using accept servo signals, so I use the Servo library and map the output to controller's range (27-163)
3: debug purposes
4: output to the motor controllers

I still haven't gotten this thing to balance, but I'm closer. It either oscillates rapidly or responds too slowly, so I'm hoping I can fix that by tuning Kd and Kp. I also have some sensor drift problems that are probably related to the unstable nunchuck mounting.

[maybe I'll make this a weekly thing, who knows...]

Wednesday, December 7, 2011

Introduction: the fail-Way, a crappy balancing robot that almost works

"Last post: April 20 2011" This blog is neglected.

I figured I'd document this here, since I intend to actually continue improving on this for a while. Hopefully this won't fade away like my other projects (water rockets, R/C cars, custom laser tag...)

The origin of this project stems from 3 parts:

1) A 4WD robot I built 4 years ago for Science Olympiad
2) A Wii Motion Plus sensor I bought for a quad copter I never built (inspired by this Hackaday post)
3) Buying an Arduino for a Science Olympiad even this year

Having the ease of use of the Arduino combined with the multi-purpose robot was what got me started on the idea of using my WMP sensor and a Wii nunchuck for a balancing robot. Because it was so easy I managed to do it in three days.

I did a lot of research on getting the two sensors to work together, as well as getting useful, filtered data out of them. I'm using the code from that link to fetch the accelerometer and gyro data from the Wii sensors over I2C. It also used some complementary filter to parse the data.

I then used some code from Shane Colton's Segstick Instructable to figure out motor control.

Or at least, tried to. I had to do some clever working around stuff, and rather than convert units or change equations, I just stuck something together to try and make it work. In the end, I had this:

PDangle = rollCF;
PDrate = roll;
PDoutput += PDangle * KP + PDrate * KD;
m1pwr = map(PDoutput, -100, 100, 27, 163);

It sort of works. It's enough to make my robot react correctly, but it's still not enough for it to stay upright for very long. It could also be the fact that I'm using a nunchuck held on by rubber bands, but I think it's a software problem.

Sadly, I hooked some things up wrong, and I messed up my Arduino. It still runs the last program uploaded (the fail balance one) but I can't program it anymore. Oh well. I plan to a) get an ISP programmer, b) replace the FTDI chip, or c) get a new Ardunio.

I'm sure I'll update this more, but it's late and I'm tired of typing, so here it is.

Wednesday, April 20, 2011

Completion: Mission Possible (P1)

(new format for titles, woo)

Anyways, here we are. Albeit it a bit late, I believe a completion post is required for our most labor intensive project: our Mission Possible device for Science Olympiad.

Quite literally, it is the most over-engineered, hand built, scientific, unreliable... 90 second timer.

Does a 90 second timer deserve all of those descriptors? You can decide that for yourself one you see the actual thing.

First, some information:

Time spent: ~168 hours
Cost: ~$150
Primary material: wood
Secondary material(s): LEGO, simple electronics, electric motors, screws, WIN
Primary purpose: Autonomously complete a sequence of tasks in a specific amount of time.

Design objectives:
Win Science Olympiad competition - FAIL
- Regional Competition - 3rd place
- State Competition - 12th place
Provide design and engineering education - WIN
Incorporate hand built mechanisms - WIN
Score the highest amount of points possible - WIN
- all highest point tasks completed
- longest time for sand timer running
- block stacking device win
- customized features (custom built fan, bottle, motor system)
Impress the Judges - WIN

Personally, I have to say I'm disappointed that we didn't get anything for our efforts, but in the end, I know that, with the amount of hard work we put into building this thing, we won that competition (we could have).

To follow in part 2: build pictures, maybe video links, task descriptions

Friday, March 18, 2011



We've been working on several thousand projects. loljk. But we have done a lot of things.

So, I wanted to share about recent things that we have acomplished.

Here's a list of a few things we've done in between then and now.

- Science Olympiad (Two building things: Mission Possible and Wind Power)

Actually, before I continue, this brings up the topic of Mission Possible.

It was probably the most challenging/difficult/complex build that was completed from scratch.

We designed it. Built it. Tested it. And got 3rd place.

[oh yeah. blogging from the floor of my garage.]

But that has kept us pretty much preoccupied until now.

So there's not really much else going on because of SO and school.

Just a quick update.

Oh, we're planning on releasing the time lapses from our build sessions very soon. Like tomorrow. Now proclaimed as "Intersphere day", the 3rd Saturday of March.

So happy Intersphere eve!

Wednesday, August 25, 2010

Just an update on...

...nothing really.

Unfortunately, school has begun, which means less time for projects. And we're pretty busy.

So, I, for sure, will not be updating for a while. I'm not quite sure about Joey.

Sure, the projects are still on our minds, but we still have things to do.

Well, maybe on a rare free weekend or week off we might do something, but may not update.

So I will talk to you...later.

Monday, August 9, 2010

Lasertag project update

Hey look an update.

[I'm a bit at a loss as to what to do considering we already have many projects in progress but this is the start of the blog ... I was thinking that any previous updates will end up on the site, or on their own page, but that doesn't really make sense (mostly because I'm trying to fully transition over to the blog).]

I guess a recap will have to do.

  • Stage 0 was working up the initial idea to make the lasertag project
  • Stage 1 was mainly a proof of concept by me to see if we could get a 30kHz receiver working with a 555 and IR LED
  • Stage 2 was...something. Probably adding in the monostable pulse circuit.
  • Stage 3 was for range testing, I guess. We set up the receiver and transmitter on different breadboards.
  • Stage 4 was testing with a LED bar graph and counter
  • Stage 4.5 was testing with a 7-segment LED display instead of the bar graph
Currently, we're on Stage 4.5.

On the transmitter side, we have a LM556, with one half generating a short pulse when triggered, and the other half modulating the pulse to ~30kHz.

On the receiver side, we had the 30kHz detector, with its output leading to the "Down" input on a "74192 up/down decade counter" IC. The counter's BCD outputs connected to a "4511 BCD to 7-segment display decoder" IC. (alternatively, you can use a 7447 decoder IC if you use a common anode LED display versus a common cathode display)

We had some weird fading between numbers going on, probably because of electrical noise. We hope to eliminate that by using ICs with higher noise immunity. Something else we hope to add is another 555 timer circuit, connected to the "Up" input on the counter; we have yet to find a way to stop the separate 555 when the count has reached its maximum.