Montreal
Offline
Edison Member
Karma: 16
Posts: 2209
Per aspera ad astra.
|
 |
« on: October 05, 2012, 07:33:49 pm » |
Arduino Leonardo, two servos, LM317, 9 resistors, a few capacitors and prototyping board. Just can't be less...
|
|
|
|
|
Logged
|
|
|
|
|
field road, jupiter creek
Offline
Sr. Member
Karma: 2
Posts: 342
Arduino rocks
|
 |
« Reply #1 on: October 05, 2012, 09:26:44 pm » |
That is really cool!
circuit?
code?
Details please!!!
|
|
|
|
|
Logged
|
|
|
|
|
Montreal
Offline
Edison Member
Karma: 16
Posts: 2209
Per aspera ad astra.
|
 |
« Reply #2 on: October 05, 2012, 09:44:38 pm » |
|
|
|
|
|
Logged
|
|
|
|
|
field road, jupiter creek
Offline
Sr. Member
Karma: 2
Posts: 342
Arduino rocks
|
 |
« Reply #3 on: October 06, 2012, 01:43:26 am » |
Yep! I found it after I posted!
Great blog man!
|
|
|
|
|
Logged
|
|
|
|
|
USA, FL
Offline
God Member
Karma: 12
Posts: 588
A life? Where can I download one of those?
|
 |
« Reply #4 on: October 06, 2012, 10:56:12 am » |
"The video has been blocked in your country on copyright grounds."
How I love the US
Please do not quote this post as it is mine and no one else can use it without paying me 100 million dollars.
|
|
|
|
|
Logged
|
//LiNK
|
|
|
|
Montreal
Offline
Edison Member
Karma: 16
Posts: 2209
Per aspera ad astra.
|
 |
« Reply #5 on: October 06, 2012, 11:15:33 am » |
Yeh, this is a problem of using nice sound track with a project. There is one more clip I posted earlier, which appears to be moderately restricted, only "matched third party content": I'll take another video outside, on big scale, whenever weather 'd change its mood. Its rainy in Montreal right now.
|
|
|
|
« Last Edit: October 06, 2012, 11:18:31 am by Magician »
|
Logged
|
|
|
|
|
USA, FL
Offline
God Member
Karma: 12
Posts: 588
A life? Where can I download one of those?
|
 |
« Reply #6 on: October 06, 2012, 12:20:10 pm » |
Nice setup. And thanks for throwing up another vid! Will be following your progress as I am looking for ways to localize sound with my project, but not quite at the stage for implementing it.
|
|
|
|
|
Logged
|
//LiNK
|
|
|
|
Montreal
Offline
Edison Member
Karma: 16
Posts: 2209
Per aspera ad astra.
|
 |
« Reply #7 on: October 07, 2012, 09:18:13 pm » |
|
|
|
|
« Last Edit: October 07, 2012, 09:19:58 pm by Magician »
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 5
|
 |
« Reply #8 on: October 08, 2012, 03:24:12 am » |
Very cool! thanks for sharing, and a nice blog! 
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 6
|
 |
« Reply #9 on: January 24, 2013, 05:58:39 am » |
Really nice and extremely interesting project. I am hoping to learn a great deal by studying your code. However I have a few questions that hopefully you won't mind answering. Why do you constrain the values for the Y servo to 1500, 2100 and the X to 800, 1900? So could i use the following to convert it to degrees? rot = map(srvoPosn[y], 1500, 2100, 0, 180); Also with regards to these lines, if(faza[ind][i + MIRROR/2]) Serial.print(faza[ind][i + MIRROR/2]); else Serial.print("n");
if the debug just prints "n" does it mean it is not correctly receiving audio? Sorry for the very basic questions im just trying to understand the reasons behind what your doing and hopefully get a greater knowledge of FFT Thank you John
|
|
|
|
« Last Edit: January 24, 2013, 07:30:01 am by johnfraiser »
|
Logged
|
|
|
|
|
Montreal
Offline
Edison Member
Karma: 16
Posts: 2209
Per aspera ad astra.
|
 |
« Reply #10 on: January 24, 2013, 10:47:20 am » |
Why do you constrain the values for the Y servo to 1500, 2100 and the X to 800, 1900? To keep wiring safe, power cable to board coming up from accumulators. It also good idea to put separate switch for servo motors, to prevent accidents during start up., or use a "delay switch" So could i use the following to convert it to degrees? Code: rot = map(srvoPosn[y], 1500, 2100, 0, 180); . Yes, srvoPosn will hold integrated value of the angle, if you keep same hardware set-up - motors moving with platform. Angle would depends on base positioning. May be not very accurate, depends on servo specification non-linearity etc. if the debug just prints "n" does it mean it is not correctly receiving audio? Mark "n" easy distinguish in digits column, compare to "0" , if "n" printed - there is no data.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 6
|
 |
« Reply #11 on: January 24, 2013, 11:04:17 am » |
Ok thats good I thought the mapping would work however was not sure. The setup I am using is slightly different to your in that I am not actually using any servos. I just wish to create a visualisation of the angle from the stationary base. Would this cause any issues with the data I am getting?
I shall have to try and understand then why I am not receiving any data as I seem to be receiving "n" .
|
|
|
|
« Last Edit: January 24, 2013, 11:08:30 am by johnfraiser »
|
Logged
|
|
|
|
|
Montreal
Offline
Edison Member
Karma: 16
Posts: 2209
Per aspera ad astra.
|
 |
« Reply #12 on: January 24, 2013, 11:29:13 am » |
I am not actually using any servos. No, it 'd not work, motors is part of "negative feedback" loop. You should calculate angle via arcsine(summa). I've mention this in section 3 of the blog, "Absolute direction to sound source, and must include stage #5 – angle calculation via known delay time. Math is pretty simple, acrsine function, and at this point in program only one calculation per several frames would be necessary, so floating point math wouldn’t be an issue at all. No LUT, scaling, rounding/truncation. Elementary school geometry knowledge – thats all you need."
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 6
|
 |
« Reply #13 on: January 24, 2013, 12:30:23 pm » |
So i am about to incredibly over simplify this process by the way i describe it however tell me if I am on the right lines.
If i take the time difference before you apply the negative feedback loop, or are they one in the same in terms of calculations? Then use the function you described in your last post, arcsine function I can determine the angle in which the sound has come from?
|
|
|
|
|
Logged
|
|
|
|
|
Montreal
Offline
Edison Member
Karma: 16
Posts: 2209
Per aspera ad astra.
|
 |
« Reply #14 on: January 24, 2013, 03:50:00 pm » |
There are 2 lines : if (count) summa /= count; srvoPosn[y] -= summa; If you are not going to use servo, than you need to change type of srvoPosn[] to "float", and remove code "if / else" statement that follows. Than srvoPosn[y] = asin ( koeff * summa / 2048.0) * 180.0 / PI; I'm not ready to give a coefficient "koeff" , sure it's would be proportional to distance between mic's - base, you have to find out from practice. asin defined in -1 : +1. http://www.cplusplus.com/reference/cmath/asin/
|
|
|
|
|
Logged
|
|
|
|
|
|