fiduciary

Author Topic: LSOS v1.4 - how to make a high-end saber with only a single switch?  (Read 17348 times)

0 Members and 1 Guest are viewing this topic.

Offline Obi_1

  • Mining Colony Members
  • Experienced Force User
  • *
  • Posts: 476
  • Creator of DIYino - first open source FX-board

It all started out with cram-fu, the ancient art of defying physics by putting more stuff into a small tube than physically possible. Well, people tried a lot, even though about putting a few parts into hyperspace to save more for other stuff, but at the end the realization dawned, that with certain builds the only way to manage the complexity is to reduce it.

But reducing complexity means reducing features...or not?

One of the parts eating up a lot of space is a 2nd switch (also known as aux switch). I like it and try to accommodate one, but the question I kept asking myself was whether I really had to say bye to features I love if I cannot include an aux switch?

A guy named DJWing proved this wrong by implementing a SINGLEBUTTON code for LSOS which only uses a single button (also known as main switch) but still keeps all FX a high-end saber must have.
Credit goes to him, this also proves how powerful an open source software can become if people pool their ideas and skills.

There is also one additional feature born out of necessity, which so far I did not see in any other saber implementation: lockup-on-clash. By using only one button a new idea had to replace the lockup triggering by keeping the aux button depressed. The genuine idea was to initiate a lockup by a single click of the button and start the actual FX (light+sound) with the next clash. This in turn simulates the sequence leading to a lockup even better, because a lockup is always preceeded by a clash (the two blades have to clash), so timing the start of the lockup even relieves the user to combine a hack with trying to press a button at the same time. It results in a precise timing for the lockup.

I took the upgrade, consolidated the code and put a new branch to LSOS:
GitHub - neskweek/LightSaberOS at LSOS-1.4_singlebutton

I made a video demo showing how a single button can be used to accomplish everything a mid- to high-end saber must be able to do:

Offline Greywolf

  • Force User
  • ***
  • Posts: 167
Re: LSOS v1.4 - how to make a high-end saber with only a single switch?
« Reply #1 on: December 02, 2016, 06:14:33 AM »
Awesome :azn: !

I'm currently pondering: Is the button press really necessary?
I mean, would a lock-up detection be possible by saying 'as long as motion after clash is nearly zero, use lock-up'?
Or would that be too sloppy?

I'm also playing with the thought of a 'button-less' saber:
- If kill-key is removed, saber shall switch into motion detection mode.
- Ignition: Perhaps (if possible) via 'be in guard-position (pointing straight up) for 1 second' or via 'move saber extremely fast, like for a block or surprise attack'.
- Turning off: Via 'saber is held in idle position (pointing down at an angle) for 2 seconds' or via 'saber was dropped (hilt is lying motionless)'.

Darn, I have to find the time to setup an IDE and start 'playing' with LSOS source code :wink: 
(And I have to get your board into a hilt!)
Life is but a series of missed opportunities.

Offline jbkuma

  • Mining Colony Members
  • Master Force User
  • *
  • Posts: 980
  • Pixels, everywhere.
    • Mad Science Workshoppe
Re: LSOS v1.4 - how to make a high-end saber with only a single switch?
« Reply #2 on: December 02, 2016, 07:12:02 PM »
I saw this branch show up on git and look forward to giving it a whirl!  The single button code will match nicely with my freshly made custom NeoPixel AV switch. :D

In somewhat related news, I'm just waiting for my aviation plugs to show up to finish my NeoPixel blade put prototype (and also my strips to make the blade).

Offline TheSaberCore

  • Force User
  • ***
  • Posts: 135
  • Every saber has a core.
Re: LSOS v1.4 - how to make a high-end saber with only a single switch?
« Reply #3 on: December 02, 2016, 09:25:14 PM »
I know Spark 2 lets you have a single activation button and has that "Lockup on Clash" that you described, and you switch fonts by rotating the saber. Don't know if I2 has it or not, it might.
"Luke."

"The Belonging you seek is not behind you, it is ahead."


Offline Obi_1

  • Mining Colony Members
  • Experienced Force User
  • *
  • Posts: 476
  • Creator of DIYino - first open source FX-board
Re: LSOS v1.4 - how to make a high-end saber with only a single switch?
« Reply #4 on: December 05, 2016, 01:02:21 PM »
I know Spark 2 lets you have a single activation button and has that "Lockup on Clash" that you described, and you switch fonts by rotating the saber. Don't know if I2 has it or not, it might.

As a huge Star Wars fan I love rumors and mysteries.

But I have to ask - out of pure curiosity - if you know it for a fact or heard somewhere? I looked at the Spark 2.0 Manual (thanks anyway, I did not know it existed) and I did not find a real clear description of either a single button more (it has 2 buttons clearly) or the lockup-on-clash.

Anyway, since it's open source, I will defer from placing a trademark on lockup-on-clash. Not my stile.

Offline Obi_1

  • Mining Colony Members
  • Experienced Force User
  • *
  • Posts: 476
  • Creator of DIYino - first open source FX-board
Re: LSOS v1.4 - how to make a high-end saber with only a single switch?
« Reply #5 on: December 05, 2016, 01:08:54 PM »
Awesome :azn: !

I'm currently pondering: Is the button press really necessary?
I mean, would a lock-up detection be possible by saying 'as long as motion after clash is nearly zero, use lock-up'?
Or would that be too sloppy?

Thanks Greywolf! This is something to consider, but I'm afraid it would be quite difficult, since a lockup is a fight of muscles and the blades of both opponents move quite a bit, partially violently. Therefore staying put is not a good way to identify a lockup IMHO.

Quote
I'm also playing with the thought of a 'button-less' saber:
- If kill-key is removed, saber shall switch into motion detection mode.
- Ignition: Perhaps (if possible) via 'be in guard-position (pointing straight up) for 1 second' or via 'move saber extremely fast, like for a block or surprise attack'.
- Turning off: Via 'saber is held in idle position (pointing down at an angle) for 2 seconds' or via 'saber was dropped (hilt is lying motionless)'.

I recall there was for a short time a hype about a saber board from Italy, it was claimed to be the main saber core for Ludosport members, and according to the description it worked entirely wothout a button.
My opinion: hmm, I do not like the idea. I need a button, it feels like the right thing to active a saber. But 1 button suffices. Actually with the same MPU in as on a CF, more gesture triggered interaction could be easily accomplished with DIYino. Feel free to Experiment. I will do the same, I have now an idea how to real-time smootly mix Colors with a single button saber :)

Offline naigon

  • Mining Colony Members
  • Experienced Force User
  • *
  • Posts: 448
  • Naigon's Electronic Creations
    • SaberIgniter.com
Re: LSOS v1.4 - how to make a high-end saber with only a single switch?
« Reply #6 on: December 05, 2016, 04:33:55 PM »
I know Spark 2 lets you have a single activation button and has that "Lockup on Clash" that you described, and you switch fonts by rotating the saber. Don't know if I2 has it or not, it might.

As a huge Star Wars fan I love rumors and mysteries.

But I have to ask - out of pure curiosity - if you know it for a fact or heard somewhere? I looked at the Spark 2.0 Manual (thanks anyway, I did not know it existed) and I did not find a real clear description of either a single button more (it has 2 buttons clearly) or the lockup-on-clash.

I can confirm that Spark 2 does operate with one button. If you use the config editor to set in the master that there is one button, the main button tap is blaster block and main button press after doing a clash is lockup. You can also set one button with motion so that twisting at the menu will allow switching to the other fonts and music tracks.
« Last Edit: December 05, 2016, 06:39:48 PM by QUI-GON JINN »
Naigon
Igniter developer/creater - my site is in my profile!
http://www.fx-sabers.com/forum/index.php?topic=29490.0

Offline jbkuma

  • Mining Colony Members
  • Master Force User
  • *
  • Posts: 980
  • Pixels, everywhere.
    • Mad Science Workshoppe
Re: LSOS v1.4 - how to make a high-end saber with only a single switch?
« Reply #7 on: December 06, 2016, 10:01:40 AM »
What if we use a swing detection as an option to deactivate the lockup. I don't have anything setup to test this right now, but if the lock up activates on the clash, then the swing detection could deactivate it when pulling away or following through after the contact.  In this way, other than the mode activation, the whole process could be smooth and synced more closely with the actual physical lockup event.

Offline Obi_1

  • Mining Colony Members
  • Experienced Force User
  • *
  • Posts: 476
  • Creator of DIYino - first open source FX-board
Re: LSOS v1.4 - how to make a high-end saber with only a single switch?
« Reply #8 on: December 07, 2016, 02:59:32 AM »
What if we use a swing detection as an option to deactivate the lockup. I don't have anything setup to test this right now, but if the lock up activates on the clash, then the swing detection could deactivate it when pulling away or following through after the contact.  In this way, other than the mode activation, the whole process could be smooth and synced more closely with the actual physical lockup event.

 :evil: It was me! Actually I got the code from DJWing doing exactly what you've described and he even asked me to confirm it working, since he did not happen to have a test saber at hand. I took the liberty to change his code to end lockup with a button interaction. But in fact to tweak the code to have a swing end the lockup would be easy. The only concern I have is that during the (imitated) struggle of a lockup the movement of the blade could be interpreted rightly as a swing, ending the lockup prematurely. But that it turn could be fixed with a proper selection of swing threshold, a lockup blade movement should not have the same dynamics as a real swing.

Offline Don

  • Force User
  • ***
  • Posts: 117
    • Ludosport Lightsaber Combat Academy
Re: LSOS v1.4 - how to make a high-end saber with only a single switch?
« Reply #9 on: December 07, 2016, 05:08:56 AM »
Awesome :azn: !

I'm currently pondering: Is the button press really necessary?
I mean, would a lock-up detection be possible by saying 'as long as motion after clash is nearly zero, use lock-up'?
Or would that be too sloppy?

Thanks Greywolf! This is something to consider, but I'm afraid it would be quite difficult, since a lockup is a fight of muscles and the blades of both opponents move quite a bit, partially violently. Therefore staying put is not a good way to identify a lockup IMHO.

Quote
I'm also playing with the thought of a 'button-less' saber:
- If kill-key is removed, saber shall switch into motion detection mode.
- Ignition: Perhaps (if possible) via 'be in guard-position (pointing straight up) for 1 second' or via 'move saber extremely fast, like for a block or surprise attack'.
- Turning off: Via 'saber is held in idle position (pointing down at an angle) for 2 seconds' or via 'saber was dropped (hilt is lying motionless)'.

I recall there was for a short time a hype about a saber board from Italy, it was claimed to be the main saber core for Ludosport members, and according to the description it worked entirely wothout a button.
My opinion: hmm, I do not like the idea. I need a button, it feels like the right thing to active a saber. But 1 button suffices. Actually with the same MPU in as on a CF, more gesture triggered interaction could be easily accomplished with DIYino. Feel free to Experiment. I will do the same, I have now an idea how to real-time smootly mix Colors with a single button saber :)

I can confirm the standard sabers used in the Ludosport academies are buttonless.
This gives a mixed feeling to the people using it, some are liking the feature, some others don't.
Without going into much details because I'm not here to advertise this board, the activation is achieved with a certain sequence of movements, deactivations comes when the saber is kept for a while in idle position.
I can say the method is reliable only when one owns a personal saber and learns how to properly activate it.
Otherwise, each saber is slighlty different and this is affecting the activation sequence in terms of angle and movement detection, sometimes causing a lot of struggle and frustration trying to trigger it.
After saying this I can only add that I still prefer the good old buttons for all my personal sabers   :cheesy:
Master Sabersmith at the Ludosport Lightsaber Combat Academy Italy

Offline Obi_1

  • Mining Colony Members
  • Experienced Force User
  • *
  • Posts: 476
  • Creator of DIYino - first open source FX-board
Re: LSOS v1.4 - how to make a high-end saber with only a single switch?
« Reply #10 on: December 08, 2016, 03:43:06 AM »
Buongiorno Don!

I had been secretly hoping you would chime in and was not disappointed :) Could you link in the manual of the saber board used by Ludosport? I would like ot have a look! I had it in the past but already lost the link.

That said I have to agree, I also like the button. Screen accurate (for those it counts) and easy to master. With all the process variation of MEMs in terms of sensitivity, reaction, need for calibration they are amazing for gesture detection, but it should not be exaggerated. Also the impact on code size for more sophisticated MPUs is not neglectable.

Offline Don

  • Force User
  • ***
  • Posts: 117
    • Ludosport Lightsaber Combat Academy
Re: LSOS v1.4 - how to make a high-end saber with only a single switch?
« Reply #11 on: December 09, 2016, 01:21:11 AM »
Hi Obi_1

You can find the manual at this link https://www.lamadiluce.it/gb/25-software-and-manuals
Sorry for posting a link to the shop, but I think it cannot be found anywhere else.
It does not go into deep details about the board, but it describes how the saber reacts to gestures.

As I said before one of the problems of this board is gesture recognition.
I'm pretty sure it can be improved if one has time and will to do it on his own, but for now we have to deal with it.
It also has other limitations, like the very poor quality sound font support caused by the fact that the designers decided not to suppport a microSD card.

I was actually considering the possibility of porting LSOS to this platform.
It is based on a different ATMega chipset so I think it should be feasible, but I definitely don't have the skills to attempt such a project.

Beside, I'm starting to be contacted by owners that are considering to swap the board with something more reliable.
Master Sabersmith at the Ludosport Lightsaber Combat Academy Italy

Offline Obi_1

  • Mining Colony Members
  • Experienced Force User
  • *
  • Posts: 476
  • Creator of DIYino - first open source FX-board
Re: LSOS v1.4 - how to make a high-end saber with only a single switch?
« Reply #12 on: December 31, 2016, 02:21:58 PM »
It also has other limitations, like the very poor quality sound font support caused by the fact that the designers decided not to suppport a microSD card.

I was actually considering the possibility of porting LSOS to this platform.
It is based on a different ATMega chipset so I think it should be feasible, but I definitely don't have the skills to attempt such a project.

Beside, I'm starting to be contacted by owners that are considering to swap the board with something more reliable.

Thanks Don for the link! What do you mean by poor quality sound font? Does the board come with pre-installed fonts which are rather poor or do you refer to the sound quality which might be an issue with the audio amp used? I ask these questions because I also consider swapping the SD-card with an SPI-flash chip, which would have a rather limited storage capacity compared to an SD-card, but I guess one with 8-16Mbytes could still hold 2 full fonts. Advantage is the smaller size on the board and no mechanical part. OK, maybe one cannot have 8 different swing, clash and whatsnot sounds, but to be honest I do not think so many are really necessary for a simpler build...

If the board uses an AVR, I guess it could be made to work with LSOS, but to be able to judge I would need to know what MPU it's using. There are not so many around, but some board manufacturers scrape off the chip markings before shipment so it's diffucult to re-engineer their boards (which perfectly make sense if not an open source).

:) if looking for something reliable and reprogrammable/flexible, they are welcome to experiment with DIYino. Feedbacks for future development is also warmly welcome!

Offline Don

  • Force User
  • ***
  • Posts: 117
    • Ludosport Lightsaber Combat Academy
Re: LSOS v1.4 - how to make a high-end saber with only a single switch?
« Reply #13 on: January 02, 2017, 01:14:30 AM »
Hi Obi_1

As far as I know the board is using only the internal memory of the MCU, which by the way it's an ATXMEGA128A4U.

The sound font can be actually modified with the dedicated software.
A sound font set contains power on, power off, 10 clashes and 8 swings, but all of them stands around 40-45 Kbit/s each, so that's the reason why I say the audio quality is poor. Importing a sound font created for other boards is nearly impossible.
As far as I remember their code has room for 3 sound sets, but not sure at all.
Perhaps a possible improvement could be to bring down the number if sound set to only one to permit using bigger files, improving sound quality.

Additionally, there is no actual sound volume management and looks like the speaker is always driven to the maximum possible level. I don't know if this is due limitations to the actual components or if it might be a s/w related issue.

I will pass on word about experimenting with LSOS to them, not sure they will actually do it but it's worth to try.
Many thanks for suggesting it.
Master Sabersmith at the Ludosport Lightsaber Combat Academy Italy

Offline jbkuma

  • Mining Colony Members
  • Master Force User
  • *
  • Posts: 980
  • Pixels, everywhere.
    • Mad Science Workshoppe
Re: LSOS v1.4 - how to make a high-end saber with only a single switch?
« Reply #14 on: January 03, 2017, 11:52:25 AM »
I'm waiting for some parts that should be here this week, then I'll record a video sharing the results of my efforts in tweaking the pixel blade code.  I'll have pixel illuminated main switch, shimmer on lockup, flicker in ignition, hum, extinguish, sound font defined ignition and extinguish timing with matching fade timing (fade is important for my single pixel blade). 

The ignition timing code is only a few small changes and anyone can try it pretty easily (already posted in the DIYino thread).  Some of the other code is pretty specific to my build, or needs to be sanitized a bit before sharing.

I ran into an interesting issue.  When using a RGB Cree with a WS2811 driver chip as a "1 pixel" blade, throwing DATA_PIN to high ends up powering the LED enough to give the blade a faint green glow.  I've tried several timing tricks to see if it would change anything, but the only thing that prevented it was commenting out the line.

To fix this, instead of using the DATA_PIN high, I'm going to try to use a TIP42C wired with the LS pads to the base, hilt (+) to the emitter, and the collector connected (+) line on the string.

 

retrousse