HobbyKing.com New Products Flash Sale
Reply
Thread Tools
Old Mar 04, 2013, 08:25 PM
---o-O-o---
blutoh's Avatar
United States, NJ, Livingston
Joined Mar 2012
1,603 Posts
Quote:
Originally Posted by Dutchraptor View Post
The raw value from the transmitter is for example 11645..................
And raw value is what you will be passing to the raspi for all events, whether they are servo or pin events, correct?
Here's is how I currently have the throttle mapped:
11500 full reverse <-> 11750 idle <-> 12000 full ahead

Pete
blutoh is offline Find More Posts by blutoh
Last edited by blutoh; Mar 04, 2013 at 09:02 PM.
Reply With Quote
Sign up now
to remove ads between posts
Old Mar 05, 2013, 02:26 AM
Registered User
Dutchraptor's Avatar
The Netherlands, ZH, Hoogvliet
Joined Jul 2008
302 Posts
No,I'll send the complete command to the rasppi. In the rasppi the splitting takes place. Or else the rasppi doesn't know which group/subgroup you want. A throttlerange is only from 0 to 255. A servo only has 256 steps (if your lucky). The arduino reads a pot in 1024 (10K), then I map that 0-255 so the arduino can use that for the servo PWM. I know there is a gap of 244 steps between the subgroups, but I left that for logical numbers each channel/group starting with either 0 or 500.

Danny
Dutchraptor is online now Find More Posts by Dutchraptor
Reply With Quote
Old Mar 05, 2013, 09:03 AM
---o-O-o---
blutoh's Avatar
United States, NJ, Livingston
Joined Mar 2012
1,603 Posts
OK, let me clarify I few things so I get it right:
Quote:
Originally Posted by Dutchraptor View Post
No,I'll send the complete command to the rasppi. In the rasppi the splitting takes place.
By complete command you are referring to strings like these: 21070 (pin example) or 115200 (servo example)? Or is there more data in the complete command that I missed?

Quote:
Originally Posted by Dutchraptor View Post
A throttlerange is only from 0 to 255. A servo only has 256 steps (if your lucky). ........ I know there is a gap of 244 steps between the subgroups, but I left that for logical numbers each channel/group starting with either 0 or 500.
WIll the throttle data consistently be in the lower half or upper half of the group range? As an example will it always be between 11500 and 11755, or between 11756 and 12000, but not span the two ranges, like 11700 and 11855?

Pete
blutoh is offline Find More Posts by blutoh
Reply With Quote
Old Mar 05, 2013, 12:57 PM
Registered User
Dutchraptor's Avatar
The Netherlands, ZH, Hoogvliet
Joined Jul 2008
302 Posts
Pete,
The complete raw command always consists of 5 numbers. The throttle range will always be between 0-255 (11000 to 11255 / 11500 to 11755 / 12000 to 12255 and so on). The arduino doesn't go beyond 255 in it's PWM range.

Danny
Dutchraptor is online now Find More Posts by Dutchraptor
Reply With Quote
Old Mar 05, 2013, 01:35 PM
---o-O-o---
blutoh's Avatar
United States, NJ, Livingston
Joined Mar 2012
1,603 Posts
OK, got it.

I have all the info I need to proceed now. It's going to take a few days to get all this coded in a full serial version for testing.

Pete
blutoh is offline Find More Posts by blutoh
Reply With Quote
Old Mar 05, 2013, 01:41 PM
Registered User
Dutchraptor's Avatar
The Netherlands, ZH, Hoogvliet
Joined Jul 2008
302 Posts
I'll make preparations for the communication to the raspberry on the receiver shield.

Danny.
Dutchraptor is online now Find More Posts by Dutchraptor
Reply With Quote
Old Mar 06, 2013, 03:01 PM
---o-O-o---
blutoh's Avatar
United States, NJ, Livingston
Joined Mar 2012
1,603 Posts
Toggling sounds

Danny and lurker(s),

We have addressed sounds that run for a finite length of time (e.g. horn, engine start, etc) and we have addressed some sounds that run infinitely until terminated (e.g. ambient and enginesounds). In order to toggle an infinite sound on or off, we can:
  • use 1 pin - when activated, if sound is off, turn it on or if it's on turn it off (like we are doing with the ambient sound effect)
  • use 2 pins- one pin turns it on, one pin turns it off
  • monitor the servo - control the sound with the servo movement (like we are doing with the engine sound effect)

I want to identify any additional sounds that need to be tied to a variable length of operation. Here are the ones we have identified so far:
  • winch - should run only while the feature is operating, on / off switch
  • crane - monitor the servo position, start when servo leaves neutral, stop when servo returns to neutral (??)

What other feature sounds would you like to add, and which activation method does it require?

Pete
blutoh is offline Find More Posts by blutoh
Last edited by blutoh; Mar 06, 2013 at 07:22 PM.
Reply With Quote
Old Mar 07, 2013, 08:35 AM
Registered User
Dutchraptor's Avatar
The Netherlands, ZH, Hoogvliet
Joined Jul 2008
302 Posts
Quote:
Originally Posted by blutoh View Post
Danny and lurker(s),
  • use 1 pin - when activated, if sound is off, turn it on or if it's on turn it off (like we are doing with the ambient sound effect)
  • use 2 pins- one pin turns it on, one pin turns it off
  • monitor the servo - control the sound with the servo movement (like we are doing with the engine sound effect)
Pete,
I think most of us, also the standard transmitters, use 1 button/command to activate a function/sound. When released the sound stops. Even the ambient and motor sound can each be controlled by 1 switch. Most transmitters have latching switches for functions like engine sounds and moment switches for short functions like horns or crane functions.
I haven't come across any systems that uses 2 seperate commands for on and off. Come to think of it, most cranes function with motors and wires, not with servo's.

Just my idea.

Danny
Dutchraptor is online now Find More Posts by Dutchraptor
Reply With Quote
Old Mar 07, 2013, 09:06 AM
---o-O-o---
blutoh's Avatar
United States, NJ, Livingston
Joined Mar 2012
1,603 Posts
OK,

I'll set the crane sound to run only while the crane is operating, on / off switch. If I am "using a 1 button/command to activate a sound, when released the sound stops". Will the receiver continually send that pin value until the user releases the button? Or will you toggle it,send once for on, send once again for off?

If anyone has any other equipment sounds that should be included, please post them here.

Pete
blutoh is offline Find More Posts by blutoh
Reply With Quote
Old Mar 07, 2013, 09:59 AM
Registered User
Dutchraptor's Avatar
The Netherlands, ZH, Hoogvliet
Joined Jul 2008
302 Posts
The system (serial based) sends the command once. After splitting it checks if a value has changed or not.

Other sounds:
welding and hammering by the deck crew
anchourchains
drunk singing
sirene (firefighting boats)
telegraph (sos)
(bridge) crew yelling commands (at random intervals random commands perhaps)

Just to name a few.

Danny
Dutchraptor is online now Find More Posts by Dutchraptor
Reply With Quote
Old Mar 07, 2013, 12:34 PM
---o-O-o---
blutoh's Avatar
United States, NJ, Livingston
Joined Mar 2012
1,603 Posts
Quote:
Originally Posted by Dutchraptor View Post
The system (serial based) sends the command once. After splitting it checks if a value has changed or not.
Danny,
You lost me on that one. If the value changes, isn't it a differrent pin? Or are you saying if the pin changes, stop the playing sound?

Good sound stuff. I am thinking that these:
welding and hammering by the deck crew
anchourchains
drunk singing
(bridge) crew yelling commands (at random intervals random commands perhaps)
Should be part of the ambient sound?

But these:
sirene (firefighting boats)
telegraph (sos)
Should be push button activated, to play at will.

And this one: drunk singing We should all get together and record

Here is an interim release (attached):

Download the file
Change name to install_soundfx.bin after downloading by renaming, do not unzip:
mv install_soundfx.bin.zip install_soundfx.bin
Change permissions if necessary:
chmod 755 install_soundfx.bin
Install the package:
./install_soundfx.bin
new versions: mnuSoundfx.py and serSoundfx.py.. mnuSoundfx.py is for testing
There is now a configuration file, soundfx.ini, to make it easy to assign the throttle servo. We will be adding more config settings to this file as necessary.


[EDIT: For a quick synopsis and the latest installation package, go directly to this post.
blutoh is offline Find More Posts by blutoh
Last edited by blutoh; Apr 10, 2013 at 02:18 PM. Reason: corrected file name
Reply With Quote
Old Mar 07, 2013, 03:30 PM
Registered User
Dutchraptor's Avatar
The Netherlands, ZH, Hoogvliet
Joined Jul 2008
302 Posts
1 pin has 2 states on/off, 1/0 and it adds or substracts (1/2/4/8/16/32/64/128 depending on the pinnumber) from the commandcode.

To bad we live on the other side of the globe together. A bottle of rum on a deadman's chest, yoohoo, yoohoo.

Danny
Dutchraptor is online now Find More Posts by Dutchraptor
Reply With Quote
Old Mar 07, 2013, 10:07 PM
---o-O-o---
blutoh's Avatar
United States, NJ, Livingston
Joined Mar 2012
1,603 Posts
Danny,

Here are the current serial command assignments, please reivew.

Pete
------------------------------------------------------------------------------------------

Functional Group 1
servo 2: 11500 - 11755 throttle range (soundfx.ini)

Functional Group 2
command: 21128; Group: 1; Pin: 22; Start Engine
command: 21064; Group: 1; Pin: 23; Shutdown Engine
command: 21032; Group: 1; Pin: 24; Toggle Ambient Sounds On / Off
command: 21016; Group: 1; Pin: 25; Foghorn
command: 21008; Group: 1; Pin: 26; Horn
command: 21004; Group: 1; Pin: 27; Whistle
command: 21002; Group: 1; Pin: 28; Small Winch
command: 21001; Group: 1; Pin: 29; Not assigned

command: 22128; Group: 2; Pin: 32; Not assigned
command: 22064; Group: 2; Pin: 33; Not assigned
command: 22032; Group: 2; Pin: 34; Not assigned
command: 22016; Group: 2; Pin: 35; Not assigned
command: 22008; Group: 2; Pin: 36; Not assigned
command: 22004; Group: 2; Pin: 37; Not assigned
command: 22002; Group: 2; Pin: 38; Large Winch
command: 22001; Group: 2; Pin: 39; Not assigned

command: 23128; Group: 3; Pin: 42; Not assigned
command: 23064; Group: 3; Pin: 43; Not assigned
command: 23032; Group: 3; Pin: 44; Not assigned
command: 23016; Group: 3; Pin: 45; Not assigned
command: 23008; Group: 3; Pin: 46; Not assigned
command: 23004; Group: 3; Pin: 47; Not assigned
command: 23002; Group: 3; Pin: 48; Not assigned
command: 23001; Group: 3; Pin: 49; Not assigned
blutoh is offline Find More Posts by blutoh
Last edited by blutoh; Mar 07, 2013 at 10:14 PM.
Reply With Quote
Old Mar 08, 2013, 09:36 AM
---o-O-o---
blutoh's Avatar
United States, NJ, Livingston
Joined Mar 2012
1,603 Posts
Quote:
Originally Posted by Dutchraptor View Post
1 pin has 2 states on/off, 1/0 and it adds or substracts (1/2/4/8/16/32/64/128 depending on the pinnumber) from the commandcode.
Danny, we need to clarify this, lets take an example:
  • The operator pushes and holds button #28 to start the small winch.
  • The transmitter sends command: 21002 (= Pin: 28; Small Winch)
  • The receiver relays 21002 to the sound system
  • The sound system begins playing the small winch sound effect
  • The operator now releases button #28 to stop the small winch
What command is sent by the transmitter, or what signals the sound system to stop playing the sound effect? If I am tracking pin state internally to the sound system, I need to know what event triggers the "stop" action for a loopng sound.
For example, with the ambient sound, I track the pin state internally , when the same command code is sent again, I toggle the sound on or off.

Pete
blutoh is offline Find More Posts by blutoh
Reply With Quote
Old Mar 08, 2013, 10:54 AM
Registered User
Dutchraptor's Avatar
The Netherlands, ZH, Hoogvliet
Joined Jul 2008
302 Posts
Pete,
Following your instructions (it's .zip instead of .txt btw), I get a Text file busy error after the ./install_soundfx.bin step.

What did I do wrong? I thought I'd take a look if I could change the code to explain.

EDIT: found it. Save as didn't asve the complete file. save did.

Danny
Dutchraptor is online now Find More Posts by Dutchraptor
Last edited by Dutchraptor; Mar 08, 2013 at 11:21 AM.
Reply With Quote
Reply


Thread Tools