Tuesday, December 10, 2013

Acrylic Box

The outer box was made using 2D laser cut acrylic and put together using painters tape.  This led to a strong connection and an appealing appearance.

Saturday, November 30, 2013

Nunchuk Arduino Coding

The code to take advantage of the Nunchuk information was all pulled from the Internet in the form of an Arduino library, and then a sample code was edited for our uses.


The code in this example was what was used to test the different axes on the Nunchuk. The final code will just take advantage of two axes, and the buttons. While the actual coding for using the button presses has not been coded, it has been planned and written on paper to get the step by step coding planned.


 


The thought process behind this code is that when the button is pressed it will keep the last value of the servo position stored, and use that as a reference value to go into 'fine tuning mode'. In this mode, the angles will be mapped to a small range that involves negative numbers. This will allow it to go clockwise and counter clockwise in small increments around the last known position. When the button is released it will go back to using the normal servo position variables.


--
Andrew Southworth

Sunday, November 24, 2013

Overall Design

While originally the goal was just to create the basic Nunchuk controlled laser bot, we realized we wanted it to have a much more finalized look to it.

Since we had no place where the acrylic sheet was being used, we decided to cut it up into a box to house the electronics and make it look 'cooler'. The actual bot will sit on the top of the box, being slightly embedded, with the wires going through a hole to the internal Arduino circuit. The Nunchuk wire will go through a hole on the side of box. Depending on how it works out, a hole will also be made for an LCD screen to show the name of the bot. Inside of the box there will be LED's lighting to add some visual appeal.

It was also decided that there will be an option on the controller to go into 'precision mode', where the turning angles will be smaller to make it easier to aim to a specific location. The box, the LCD screen, and the LED's are purely visual features, but they also make it easier to carry around the entire project. It may seem superficial, but if this were ever to be an actual product the visual aspect would be extremely important. No one wants to carry around something with circuits exposed and wires hanging around just waiting to be accidentally ripped out.

All of this was decided during last weeks lab with myself (Andrew Southworth), and Joe Nguyen. Joe met up with Robert Hudson later on that night to discuss this further.

--
Andrew Southworth

Friday, November 22, 2013

WiiChuck Adapter - Controlling a Servo with the Nunchuk


Originally the adapter was not supposed to come in the mail until around the day before Thanksgiving. It ended up arriving last night, which is over a week early (and they sent me two!). I decided to fool around with it and see if I could get everything working. There is an online library for coding the WiiChuck, and many example codes as well. By using the libraries, and adding a few lines of code for controlling the servo, the servo could be controlled using the Nunchuk.

Testing the Nunchuk!

I have only tested the X and the Y axis from the Nunchuk so far. However, from reading the serial monitor in the Arduino interface it was clear that the buttons and the joystick do in fact work. The servo had a little difficulty moving with the negative X direction from the Nunchuk, which could be from using an old Nunchuk found in the bottom of an old video game box, or from not mapping the values from the Nunchuk correctly. Some experimentation with different Nunchuks and different values in the coding should resolve this problem. Another issue is that it is a little shaky in its values. This may be overcome by increasing the 'read time' from the Nunchuk, or by only changing the position when a certain increment of motion has occured.
--
Andrew Southworth

Planning And Working On The Laser


Figure 1: Planning and Brain-Storming

We got together last week in lab to plan exactly what we were going to do and figure out what we would need to do it. There would need to be two servos to control the motion in either axis, and they would have to be attached in a decently stable way. For our 3D printer part, there are essentially unlimited options for parts to design to attach the servos. The method was chose was essentially a 'U' shape to wrap around the upper servo, with a slot underneath to allow the lower servo to attach into. The part could be made more detailed and have parts snap in, but considering the limitations on accuracy for the 3D printer, this was avoided. The part is still dimensioned to be a close fit, but now it will be attached with super glue instead of a 'built-in' approach.


Figure 2: Wiring the Laser Pointer
 
The design for getting the laser to work was also decided. At first we were thinking of having a servo press the button in some way, but that would be hard or not very reliable. There could be some kind of wrap around the button, and turning the servo would tighten the wrap around the button and depress it. To avoid doing this, the batteries were removed and the circuit was completed through the Arduino. This would allow for the Arduino to control the laser directly, in a much more reliable manner. One of the connections has to be made with the spring, and the other connection has to be made with the rim around where the back end of the laser pointer screws back in. This was discovered by just messing with the laser pointer for a short amount of time. This will most likely be held in place more permanently by either alligator clips or solder.


--
Andrew Southworth
Joe Nguyen





Tuesday, November 19, 2013

Concept

The idea for the project is to have a Wii Nunchuk controlled laser pointer.

Aiming the laser only requires two servo motors, one used for the horizontal angle and one for the vertical angle. Turning the laser on would involve completing the laser pointer's circuit through the Arduino, to allow it to be controlled without physically pushing the button.

Since the Nunchuk used for the Wii gaming system has a three axis accelerometer, two of these axes can be used to control the horizontal and vertical angles. One of the buttons on the Nunchuk can be used to tell the Arduino when to complete the circuit and turn the laser on. Using the Nunchuk will make controlling the Nunchuk-Laser-Bot very intuitive, as the motion of the laser will follow the motions of the Nunchuk.

So far the parts planned for use are:

-An Arduino
-Two small servos
-A laser pointer
-A Wii Nunchuck
-A component used to attach the servos correctly, made with the 3D printer.
- Some kind of base so that everything can be connected.

--------

We have thought of several optional goals if the main project is completed with spare time:

-Making the Nunchuk-Laser-Bot mobile
-Giving it some type of self aiming ability (for example, aiming at the closest object, or at the brightest/darkest light source)
-Having some kind of small projectile to shoot instead of a laser pointer

These will require either motors, sensors, strong servos, and possibly Arduino shields to accomplish. Since they can be done independently from the main idea, these will simply be thrown on as 'extra features' depending on how much time is available after the main goal is accomplished.

--
Andrew Southworth