Go Down

Topic: Arduino Lightsaber (Read 461942 times) previous topic - next topic

RCNiner

Has anyone done an led string blade with these set ups? I haven't seen anything in the forums

billpealer


wailer

Thanks i'll take a look. Se if i can use it or abuse it.My hypothesis (untested) may be novel ( or not)-  will be to trigger swing, with the ADXL using a state change mechanic. quantify all the axis readings upon start up, and trigger the swing based on the total state change.

so- and the below code sample is me thinking out loud.  it is not syntax accurate.

setup for the pin outs and whatnot.

int state
State = AnalogRead (X+Y+Z);

void loop
If (New_State + State) is < or >  (300 - New_State) // this number is totally arbitrary till i solder up the ADXL and start getting reads from rests and swings.

Send_Command(1);  //swing
Delay (100); // if you can swing more than 10 times a second, have a cookie.

New_State = State;
I think you are absolutely right keep it simple as possible.
Tried to update my mathematical skills but quaternion's just gave me a headache...
And hey a arduino is good but not a pentium i7 keeping the code as small as posible reduces the risk of lag.

neskweek

#678
Feb 19, 2016, 06:44 pm Last Edit: Feb 19, 2016, 07:21 pm by neskweek
I think you are absolutely right keep it simple as possible.
Tried to update my mathematical skills but quaternion's just gave me a headache...
And hey a arduino is good but not a pentium i7 keeping the code as small as posible reduces the risk of lag.
Nonsense !

1. You don't have to understand mathematics behind quaternions tu use them. Just like you don't need to know how to read hexadecimal to code or know how an engine works to drive (would be best tho...)

You just need to know what they do (they determine your hilt orientation) and find a library that can calculate quaternions from your gyroscope data.
Of course you can still use only the gyroscope data, but you'll have to address "cadrant lockup" problems (and good luck with that)
As for using G force to finely detect swings... I still don't see how you're going to manage to do that.
But hey! If you find a better way to do this with your idea: be my guest !

2.Do you find this laggy ?

[EDIT]
Sorry I didn't get the ADXL335  was only an accelerometer and not an IMU. :P
So my solution is not applicable to your devices
But hey still good luck with that !

katan007

Hey Star Wars Guys and Gals,

I just got my sound modules (WT588D-16p 8m) for my sabres in last week though still need my arduino pro-mini usb program connector. I've made this sketch based on connecting the module to one of my mega's. It plays really well so far and is quite a bit different than the ones I've seen partially posted on this thread (sorry not yet at wanting to deal with accelerometers). There is the odd issue that will cause bouncing in the blade on/off function, however this attempt is the least buggy of my efforts thus far. It could use a new pair or multiple pairs of eyes to go over for optimizing and improvements if anyone is willing to take a crack. The end of the code hasn't been completed for the change in sound or colour states but that is wicked easy i just haven't decided which goes where I suppose.  

Also for all those who are interested in my code here feel more than welcome to snag it as it has been posted for anyones use!

stinky1

Hey Star Wars Guys and Gals,

I just got my sound modules (WT588D-16p 8m) for my sabres in last week though still need my arduino pro-mini usb program connector. I've made this sketch based on connecting the module to one of my mega's. It plays really well so far and is quite a bit different than the ones I've seen partially posted on this thread (sorry not yet at wanting to deal with accelerometers). There is the odd issue that will cause bouncing in the blade on/off function, however this attempt is the least buggy of my efforts thus far. It could use a new pair or multiple pairs of eyes to go over for optimizing and improvements if anyone is willing to take a crack. The end of the code hasn't been completed for the change in sound or colour states but that is wicked easy i just haven't decided which goes where I suppose. 


Code is nice!  But what parts are you using?  Old school tilt sensors and clash sensor?  Cant blame you the 6050's code is dammned confusing and complex.

Anyways a list of parts used makes it easier to understand or for someone to replicate.   oooo so many codes recently!  Thanks!!!


katan007

My arduino mega has both open 5 & 3.3V pins that i use for the power supply to the module so there would be a few changes for people who need to switch it to the mini (as I will be soon), but if your competent in the arduino playground that shouldn't be an issue (perhaps a tad bit of tinkering).

The program is built so far for the basic clash and swing sensors that act as switches and not pwm/analogue accelerometer. the counter states could be changed easily based on different forces on the accelerometer but I'm not particularly set on that as simplicity is better in some cases.

No worries, always glad to help!

wailer

#682
Feb 20, 2016, 08:16 pm Last Edit: Feb 20, 2016, 08:29 pm by wailer
Nonsense !

1. You don't have to understand mathematics behind quaternions tu use them. Just like you don't need to know how to read hexadecimal to code or know how an engine works to drive (would be best tho...)

You just need to know what they do (they determine your hilt orientation) and find a library that can calculate quaternions from your gyroscope data.
Of course you can still use only the gyroscope data, but you'll have to address "cadrant lockup" problems (and good luck with that)
As for using G force to finely detect swings... I still don't see how you're going to manage to do that.
But hey! If you find a better way to do this with your idea: be my guest !

2.Do you find this laggy ?

[EDIT]
Sorry I didn't get the ADXL335  was only an accelerometer and not an IMU. :P
So my solution is not applicable to your devices
But hey still good luck with that !
If you build yourself a car you do have to know how a engine works to if you want to be able to drive it at all (i know, another project of mine).
So my opinion is that if you are coding you have to know how things work, if things do not work correctly how will you fix them.
Swings on G's is not that hard just wait till your 335 output (as it only measures acceleration thats easy) exceeds a given threshold and play a sound...

I never implied your project was laggy... :smiley-confuse:

neskweek

Yeah, my bad :p

Sorry again, I did lose my temper.

Canobi

Hi guys

I felt my contributions have been a bit lacking recently and have permission from Jake to post pics and go through the fabrication process I'm using to make the saber PCBs.

I hope it will dispel some of myths and mystery about making PCBs at home and encourage others to have a go as its really not that difficult (as long as health and safety precautions are taken seriously, it's actually a fun and highly intersting process).



Part one is mostly descriptive, the exiting stuff will happen in part two so please bear with me.


----Part One----

I use a common home brew technique called toner transfer. It was discovered a few years ago that laser (and to a lesser degree ink jet) toner inks are resistant to many forms of etching mediums. Not all printers are made the same though so if you decide you might like to try your hand at etching after reading this, avoid Brother models as the ink for those have a higher melting point and results are very hit and miss. I use a 1200dpi Samsung mono tone laser jet printer and it's worked like a charm so far.


To make use of the ink as a resist, the circuit image is first checked to make sure it is true black and white (and corrected if not) then the image is mirrored in readiness for printing.

The next step is to make a test print with the toner levels set to minimum. To avoid miss printing the proper run, a mark is made somewhere on the top of the sheet for correct orientation later. The test print gives a print area "hot spot" and a piece of gloss photo paper is cut slightly larger than the print area and secured in place with sticky notes for easy removal.

Once secured, it's put back in the loading tray in the correct orientation and the toner levels are set to maximum. You need as much ink as you can get your printer to lay down as a resist layer, adjusting the printers altitude setting to high will also help to increase the ink density, though finding the settings for this can be elusive:



A piece of copper clad board is then roughly cut so it's slightly larger than the piece of gloss paper, this ensures none of the print is placed "off board" by accident. It's then buffed with 0000 grade wire wool along both axis (length, then width and back to length for a final pass) and cleaned with acetone and isopropyl alcahol to ensure there is no dirt, oils or residues left on the copper surface.

The easiest way to check how clean the copper is after wiping it down is the water test. The board should be able to hold water for a minimum of 10 seconds as enough oil residue to stop the toner bonding to the copper will part the water.

Once cleaned and checked, the board is heated in increments over a 20min period till it reaches about 30~40°C:





The print is then carefully aligned and placed face down (one end first) onto the heated copper surface and fed through the laminater about 4~5 times and the next part is to feed it through a Hot Roll laminator set to max temp (I use a GBC HotSeal H312). This allows for far fewer passes as the board is already warmed and doesn't draw heat away from the ink and rollers:

(I modified my laminator and cut a section out of the main housing to gain better access to the rollers)


Note: Externally heated rollers are not recommended for this type of work as they suffer from hot spots and can't the high temperatures where the pressure is applied due to the fact that the feed rate is so slow and the rollers start to cool down as they turn away from the heat source.
**


Normally the board and paper would then be cooled under cold running water. Once cold it would go in a receptical cintaining warm water to soften the paper for easy removal.

That bit is messy and more brands than not will also leave the gloss layer on the board as well. It does come off by rubbing, but this comes with a high risk of accidentally knocking some of the ink off while your at it and vias have a nasty habit of protecting the gloss layer inside them so need fingernails or a relatively pointy but blunt tool to get them out.

I count myself to be very lucky in this respect as I don't have to do any of that nonsense. I discovered by accident that the local supermarket brand of gloss paper I use peals off easily and cleanly while the board is still hot leaving the ink and a very fine layer of paper behind:



Ink that is still attached to the photo paper is an indication of possible oils still present on the copper, or can be a caused by using under temperaturesn as in this case as I only passed it through the laminator three times and it could have done with at least one more.

Your kind of committed once peeling has begun, so I use an etch resist pen to fill in any holes that do appear. If thin tracks are broken, I use the acetone to clean off all the ink and start again with a fresh print as etch resist pens don't come with fine tips, let alone one that can deal with the .3mm tracks used on the saber boards.


Well, that's it for the moment. I hope it was informative and if there are any questions regarding any part of the process, please feel free to ask.

billpealer

any new sabers to show off? 
Wailer? Katan?  Nesk?...

Bueller?

JakeSoft

any new sabers to show off? 
Wailer? Katan?  Nesk?...

Bueller?
I'm waiting on my Canobi board. I figure why not demo the Mk. IV software and his board at the same time?

neskweek

#687
Mar 01, 2016, 12:43 pm Last Edit: Mar 01, 2016, 12:48 pm by neskweek
any new sabers to show off? 
Wailer? Katan?  Nesk?...

Bueller?
I'm quite far from "show and tell" :P : I'm still working on the software.

Anyway I don't want to rush any build stages.
So when software will reach an acceptable state I'll switch to designing a good chassis.
Then I'll  make custom external part using a lathe.

So not for tomorow

Protonerd

I'm quite far from "show and tell" :P : I'm still working on the software.

Anyway I don't want to rush any build stages.
So when software will reach an acceptable state I'll switch to designing a good chassis.
Then I'll  make custom external part using a lathe.

So not for tomorow
OMG, you can work the lathe? That's crazy, with the skills you have we can already greet the next shooting star of the sabersmith community!

As for me, I also have a design waiting some work with the lathe. I cannot work with it, at least not without some serious support from friends, but I make some progress. It's gonna be a saber staff and I dream about having 2 DIYino boards inside communicating with each other, 2 speakers...OK, stop daydreaming.

I also wait for my ASP saber hilt (yeah, I actually helped crowfunding that guy) and then I decide it is going to be:
1. an LED string saber
2. an HP LED saber (most probably)
3. a neopixel saber

With this superb community started by JakeSoft, the possibilities are limitless.

neskweek

Yeah, my grandfather have a lathe. An old one. Not heavily precise but for what I plan to do it would be just enough.

After I'm not a pro of this tool, but my father is, so I'll ask for advices ;)

Go Up