Go to Post Show me the mentor who has never built a bad robot and I'll show you either a new mentor, a liar, or Andy Baker. - Andrew Schreiber [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 18-08-2009, 21:20
byteit101's Avatar
byteit101 byteit101 is offline
WPILib maintainer (WPI)
AKA: Patrick Plenefisch
no team (The Cat Attack (Formerly))
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Worcester
Posts: 699
byteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of light
Sound!

We have a burnout Robot that does burnouts (smokebombs!) and we wanted to add sound (simple fixed pitch, squealing sound) to our robot (IFI system). I did a tad of research, and it appears that all I would need is a 5v speaker and hook it up to a relay and every loop send it forward and next loop send reverse. Am I correct or would i have to use the pwm? I would have to use the fast loop, and execute it with a counter to change the pitch and like.
__________________
Bubble Wrap: programmers rewards
Watchdog.Kill();
printf("Watchdog is Dead, Celebrate!");
How to make a self aware robot: while (∞) cout<<(sqrt(-∞)/-0);
Previously FRC 451 (The Cat Attack)
Now part of the class of 2016 at WPI & helping on WPILib
  #2   Spotlight this post!  
Unread 18-08-2009, 21:51
nathanww nathanww is offline
Hacker
FRC #1678 (Citrus Circuits)
Team Role: Programmer
 
Join Date: Dec 2008
Rookie Year: 2007
Location: Davis, CA
Posts: 224
nathanww is just really nicenathanww is just really nicenathanww is just really nicenathanww is just really nice
Re: Sound!

Are you referring to hooking the speaker directly into the relay output, or hooking the relay output to a relay hooked to the speaker?
__________________
Get yer robot source code here!
  #3   Spotlight this post!  
Unread 18-08-2009, 22:17
DonRotolo's Avatar
DonRotolo DonRotolo is offline
Back to humble
FRC #0832
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Atlanta GA
Posts: 6,998
DonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond repute
Re: Sound!

An alternative: Record a burnout sound on one of those Radio Shack 20-second solid-state record/playback thingies (under $20), use an amplifier for the speaker to make it as loud as you want (e.g., a boom box using external audio input), and use the relay (momentary closure) to trigger playback.

A very realistic sound for little $ and effort.


Plus, you can swap out sounds. Like "moo" - now that would be funny.
__________________

I am N2IRZ - What's your callsign?
  #4   Spotlight this post!  
Unread 19-08-2009, 09:31
byteit101's Avatar
byteit101 byteit101 is offline
WPILib maintainer (WPI)
AKA: Patrick Plenefisch
no team (The Cat Attack (Formerly))
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Worcester
Posts: 699
byteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of light
Re: Sound!

Quote:
Originally Posted by nathanww View Post
Are you referring to hooking the speaker directly into the relay output, or hooking the relay output to a relay hooked to the speaker?
Relay to speaker
__________________
Bubble Wrap: programmers rewards
Watchdog.Kill();
printf("Watchdog is Dead, Celebrate!");
How to make a self aware robot: while (∞) cout<<(sqrt(-∞)/-0);
Previously FRC 451 (The Cat Attack)
Now part of the class of 2016 at WPI & helping on WPILib
  #5   Spotlight this post!  
Unread 19-08-2009, 10:11
EricVanWyk EricVanWyk is offline
Registered User
no team
 
Join Date: Jan 2007
Rookie Year: 2000
Location: Boston
Posts: 1,597
EricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond repute
Send a message via AIM to EricVanWyk
Re: Sound!

Quote:
Originally Posted by byteit101 View Post
Relay to speaker
I would revisit this design before implementing it. As I understand it, you are toggling it on or off each time the main loop executes, which is quite slow in the sound world. Remember, you can only generate tones that are at most half of your update frequency. A "squeal" noise would be several kHz (thousands of cycles per second), but the IFI update rate is only several tens of herz (tens of cycles per second). Even if you sent the signal fast enough, the relay would be unable to respond.

It may be theoretically possible to do it with a CAN enabled Jaguar - after all, the Segway makes its vooOOOIIIIIP start up noise this way. However, I can't guarantee it is possible, and even if it is it will be hard.

I really like Don Rotolo's suggestion. I used one of those for a project in college - very quick and simple to get it working. It handles all the quick stuff, so you can ignore everything I said in the first paragraph.
  #6   Spotlight this post!  
Unread 19-08-2009, 11:23
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Sound!

Quote:
Originally Posted by byteit101 View Post
...(simple fixed pitch, squealing sound)...
A simple fixed pitch is a beep. It won't sound like a squeal.

If you wish to pursue this idea, I suggest you use a digital output rather than a relay output. The update rate on the relay pins is way too slow for the kind of sound you're aiming for.
  #7   Spotlight this post!  
Unread 19-08-2009, 13:29
Jared Russell's Avatar
Jared Russell Jared Russell is offline
Taking a year (mostly) off
FRC #0254 (The Cheesy Poofs), FRC #0341 (Miss Daisy)
Team Role: Engineer
 
Join Date: Nov 2002
Rookie Year: 2001
Location: San Francisco, CA
Posts: 3,078
Jared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond repute
Re: Sound!

I have done this before as a project on another microcontroller (an HCS12 to be exact). I hooked up a speaker and amplifier to a PWM output and modulated the PWM period to generate different tones (granted, the square PWM wave sounds a little strange, but with a simple RC filter you can get a roughly sinusoidal, single pitch sound).

I suspect that if you were to look at some of Kevin Watson's code on how to use PWM ports 13-16 with custom frequencies, you could probably do something very similar.
  #8   Spotlight this post!  
Unread 19-08-2009, 23:12
byteit101's Avatar
byteit101 byteit101 is offline
WPILib maintainer (WPI)
AKA: Patrick Plenefisch
no team (The Cat Attack (Formerly))
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Worcester
Posts: 699
byteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of light
Re: Sound!

Quote:
Originally Posted by Jared341 View Post
I have done this before as a project on another microcontroller (an HCS12 to be exact). I hooked up a speaker and amplifier to a PWM output and modulated the PWM period to generate different tones (granted, the square PWM wave sounds a little strange, but with a simple RC filter you can get a roughly sinusoidal, single pitch sound).

I suspect that if you were to look at some of Kevin Watson's code on how to use PWM ports 13-16 with custom frequencies, you could probably do something very similar.
I think I will do it like this, could you give me some wiring diagrams?
__________________
Bubble Wrap: programmers rewards
Watchdog.Kill();
printf("Watchdog is Dead, Celebrate!");
How to make a self aware robot: while (∞) cout<<(sqrt(-∞)/-0);
Previously FRC 451 (The Cat Attack)
Now part of the class of 2016 at WPI & helping on WPILib
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sound in animation BobWiley General Forum 2 17-12-2008 17:52
Sound Systems Pneumaticsman General Forum 6 16-01-2008 00:15
No Sound Jeremiah Johnson Chit-Chat 27 05-06-2007 14:16
sound? kyo11103 3D Animation and Competition 0 17-01-2003 17:57
Sound Systems Andrew Rudolph Chit-Chat 25 09-11-2002 00:05


All times are GMT -5. The time now is 01:08.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi