Sensor for a swing

Need a new type of sensor? Interfaced a sensor that you want to tell everyone about?
david_r
Phidgetsian
Posts: 9
Joined: Wed Jan 14, 2015 10:06 am
Contact:

Sensor for a swing

Postby david_r » Mon Jul 27, 2015 1:16 pm

Hello everyone!

I would like to hear your advice on which sensor (or which value) I should use for the following art project:

I have a normal swing like those ones at children playgrounds. I would like to capture the movement of the swing as precise as possible to translate it to sound with max/msp. I tried a distance sensor facing the floor to see how high it is by measuring the distance from the swing to the floor. But that doesn't tell me in which direction it is moving. So I tried a spatial 3/3/3 sensor. I'm not a good technician but a composer so I'm not sure if I completely understand the complexity of the sensor. I manage to measure the tilt of the board of the swing which gives quite precise data of the movement. My only problem with that is that you have the same result if you only move the board without swinging back and forth. This makes my sound design a bit imprecise which I would like to avoid. Maybe I need to combine some values of the spatial sensor or use other sensors or combine different sensors?
What I want to measure is the back and forth movement and the intensity (=height) of it. The aim is that a sound can be the lounder the higher someone is going for example. Or that a sound is triggered at a certain height in the front.

Any advice or information is welcome.

Thanks!

David

User avatar
mparadis
Site Admin
Posts: 690
Joined: Fri Oct 28, 2011 12:17 pm
Contact:

Re: Sensor for a swing

Postby mparadis » Mon Jul 27, 2015 2:47 pm

How are the supports of the swing connected to the top? If you could connect them to a solid bar which was allowed to swivel in place, then you could put an encoder on the end of that bar. Since the supports of a swing are usually straight when in use, the rotation of the bar would provide a good indication for where the swing is. A quadrature encoder would be able to tell you the position and the direction of the swing.

This solution may be mechanically more difficult to set up, but I suspect it will be much easier on the programming/math side of things.

david_r
Phidgetsian
Posts: 9
Joined: Wed Jan 14, 2015 10:06 am
Contact:

Re: Sensor for a swing

Postby david_r » Tue Jul 28, 2015 1:55 am

Thanks! The swings are fixed to a steel grider with rigging slings. I can't change the connection to the top because it is made by a professional technician to make sure there is no accident with the audience. So I guess unfortunately this is no solution for me.

frodegill
Phidget Mastermind
Posts: 114
Joined: Thu Mar 04, 2010 2:51 am
Contact:

Re: Sensor for a swing

Postby frodegill » Tue Jul 28, 2015 5:06 am

david_r wrote:I tried a distance sensor facing the floor to see how high it is by measuring the distance from the swing to the floor. But that doesn't tell me in which direction it is moving. So I tried a spatial 3/3/3 sensor.

I manage to measure the tilt of the board of the swing which gives quite precise data of the movement. My only problem with that is that you have the same result if you only move the board without swinging back and forth.

Not quite sure if I understand your setups, but if the distance sensor gives you what you want sans direction, the spatial 3/3/3 will give you direction. Sounds like a good combination to me...

david_r
Phidgetsian
Posts: 9
Joined: Wed Jan 14, 2015 10:06 am
Contact:

Re: Sensor for a swing

Postby david_r » Wed Jul 29, 2015 1:34 am

Thabks everyone! Great to get support and ideas in that. frodegill you're right this setup gives quite good and precise results. There is one disadvantage and I was hoping to find a solution to get rid of it. My issue is that you can trigger the sounds by just seesawing a bit on the board of the swing because that changes the tilt already and gives the distance sensor another angle which changes the distance values already. This happens quite often because my swings have wiggling boards.But I guess I have to deal with that and try to program in max/msp as good as possible (by example to tell max to ignore too sudden value changes). Last thing I was thinking of was a bend sensor which is fixed at the steel grider above and to the swings rope. But I can't find a bend sensor that is long enough (at least 20-30cm)...

frodegill
Phidget Mastermind
Posts: 114
Joined: Thu Mar 04, 2010 2:51 am
Contact:

Re: Sensor for a swing

Postby frodegill » Wed Jul 29, 2015 3:03 am

david_r wrote:My issue is that you can trigger the sounds by just seesawing a bit on the board of the swing because that changes the tilt already and gives the distance sensor another angle which changes the distance values already.

There are formulas for swing period - you should be able to identify "cheating" quite easily.

david_r
Phidgetsian
Posts: 9
Joined: Wed Jan 14, 2015 10:06 am
Contact:

Re: Sensor for a swing

Postby david_r » Sat Sep 05, 2015 4:06 pm

Sorry I'm a musician and not very good in maths. So I don't know how to calculate that and how to use it in my setup.

david_r
Phidgetsian
Posts: 9
Joined: Wed Jan 14, 2015 10:06 am
Contact:

Re: Sensor for a swing

Postby david_r » Fri Sep 18, 2015 2:33 am

Thanks for all your replies. Unfortunately I don't have a solution until now. If anyone can give me a hint concerning the formula for swing calculation and how to deal with it would be great. Thanks!

frodegill
Phidget Mastermind
Posts: 114
Joined: Thu Mar 04, 2010 2:51 am
Contact:

Re: Sensor for a swing

Postby frodegill » Fri Sep 18, 2015 5:14 am

david_r wrote:If anyone can give me a hint concerning the formula for swing calculation and how to deal with it would be great.

If https://en.wikipedia.org/wiki/Pendulum overwhelms you, http://hyperphysics.phy-astr.gsu.edu/hbase/pend.html gives you a quick way of calculating the pendulum period given length of swing rope. If the spatial sensor readings differ a lot from this, someone is probably cheating :wink:

david_r
Phidgetsian
Posts: 9
Joined: Wed Jan 14, 2015 10:06 am
Contact:

Re: Sensor for a swing

Postby david_r » Thu Oct 29, 2015 11:20 am

Thanks a lot for helping! Great to get advice here! I continued the project and unfortunatley I still have problems. I calculated the pendulum period in max/msp using the rope length and feeding the formula with the acceleration data of the spatial sensor. the values seem to be realistic and the changing time represents the movement of the swing. But the spatial sensor mounted to the swing is now feeding this formula. if you "cheat" you're still manipulating the values (now the pendulum period) through the unwanted change of acceleration data of the spatial sensor. of cource I can see the cheating within the list of values but I'm still failing to filter out these changes. But I guess this is more a question of max/msp programming?!

what I tried within max/msp is to calculate the difference between the peak and the current minimum of the swing period (helped to smooth for some reason)and additionally I filtered the outcome by looking for sudden value changes and blocking them. But the result is not smooth and sometimes the cheating still affects the output value.

How would you use the calculated pendulum period? Any further hints are welcome. Thanks.


Return to “Sensors”

Who is online

Users browsing this forum: No registered users and 1 guest