HobbyKing.com New Products Flash Sale
Reply
Thread Tools
Old Nov 11, 2014, 04:38 PM
ISCOLD
Joined Mar 2014
26 Posts
Blutoh
"Did you do the calibration sequence, as in Dutchraptor's video and instructions? If you are getting sound from the speaker when you first boor up the raspi, then I think that may be the problem."
Yes, I do.
Dutchraptor
When you hook up the arduino to a normal pc with the gui: do you see any commands in the serial monitor? Did you install the serial library on the raspberry (or is that not needed anymore Blutoh?)

No commands. When I hook up the arduino to pc with the gui, I get a blank window, without commands, only baude rate 9600 and COM10 . On RASP in serSoundfx.py I have the following line: Serial Communications
ARDUINO = (config Section Map ("Serial") ['port'])

Now I try only one connection between RC receiver and Arduino, as you can on attached photo.
But, until now, no sound. Sorry.

Iscold
Iscold is offline Find More Posts by Iscold
Reply With Quote
Sign up now
to remove ads between posts
Old Nov 11, 2014, 04:40 PM
ISCOLD
Joined Mar 2014
26 Posts
Attached photo
Iscold is offline Find More Posts by Iscold
Reply With Quote
Old Nov 11, 2014, 06:21 PM
Registered User
Dutchraptor's Avatar
The Netherlands, ZH, Hoogvliet
Joined Jul 2008
319 Posts
Iscold,
Do you have a GND wire connected between the receiver and Arduino? I can't see it in the picture. You need this because the system doesn't know what the puls is. I needs the common GND.

To test a single channel, you can try this little program I wrote. You can hook up the desired receiver channel. You can power the receiver with the arduino or use a seperate power supply for the receiver. When you use a seperate power unit, you also need a common GND (only gnd NOT 5volt +).

good luck,

keep us posted.

Danny

Code:
int PPMin = A0;  // connect the desired channel (PPM signal) from your RCreceiver to analog pin 0 
int RCval;  // store RC signal pulse length
int adj_val;  // map that value to be between 0-255
int minvalraw = 969; // adjust accordingly what you read from the receiver
int maxvalraw = 1965; // adjust accordingly what you read from the receiver
int minval = 0; // adjust accordingly what your minimum output value should be
int maxval = 255; // adjust accordingly what your minimum output value should be


void setup()
{
  Serial.begin(9600); //serial library start
  pinMode(PPMin, INPUT); //Pin 14 as input 
}


void loop()
{ 
  //-----------------------  Receiver readout ---------------------------//
  RCval = pulseIn(PPMin, HIGH, 20000);      
  adj_val = map(RCval, minvalraw, maxvalraw, minval, maxval);  

  //------------------------  Send to Serial ----------------------------//
  Serial.print ("rawvalue: ");
  Serial.print (RCval); 
  Serial.print (" / ");
  Serial.print ("adjusted:  ");
  Serial.println (adj_val);
}
Dutchraptor is online now Find More Posts by Dutchraptor
Reply With Quote
Old Nov 12, 2014, 05:58 PM
ISCOLD
Joined Mar 2014
26 Posts
Dutchraptor:

Do you have a GND wire connected between the receiver and Arduino? I can't see it in the picture. You need this because the system doesn't know what the puls is. I needs the common GND.

Yes, all the time I have both GND connected.

With your above Arduino code the results are:

Transmiter: on
Receiver: pulse on channel 3 = Throttle
Arduino: pulse entrance A0

When Throttle on maximum, serial window appear:
rawvalue 1694 until 1704/adjusted 185 until 188

When Throttle on minimum, serial window appear:
rawvalue 1283 until 1289/adjusted 80 or 81

This means the Arduino Serial is OK.

I tested all other three receiver channels and they are also OK.
I tested all other Arduino analog in (A1;A2;A3;A4;A5) and they are also OK.

Then, the next step will be the serial on RASP. For this I need help again.

Thanks a lot

Iscold
Iscold is offline Find More Posts by Iscold
Reply With Quote
Old Nov 13, 2014, 03:42 AM
Registered User
Dutchraptor's Avatar
The Netherlands, ZH, Hoogvliet
Joined Jul 2008
319 Posts
I think the best option should be to connect everything to tre Arduino the way it should and test it connected to the pc and see what commands you get in the serial monitor. Remove de slashes in front of DEBUG and place 2 slashes in front of RASPBERRY and the upload it. You should see stuff like switchstate, eeprom values and commands given to what will be the raspberry.

Goodluck,

Danny
Dutchraptor is online now Find More Posts by Dutchraptor
Reply With Quote
Old Nov 17, 2014, 07:52 PM
ISCOLD
Joined Mar 2014
26 Posts
Dutchraptor,

I make the test on Arduino. I get the following results on serial COM10.
When throttle is up position:

Reading high end of A0: 1658 Reading high end of A0: 0
Switch: 0 / 0 / motorstate1: 0 / motorstate2: 0
Reading high end of A0: 1660 Reading high end of A0: 0
Switch: 0 / 0 / motorstate1: 0 / motorstate2: 0
Reading high end of A0: 1666 Reading high end of A0: 0
Switch: 0 / 0 / motorstate1: 0 / motorstate2: 0

When throttle is down position:

eading high end of A0: 1254 Reading high end of A0: 0
Switch: 0 / 0 / motorstate1: 0 / motorstate2: 0
Reading high end of A0: 1254 Reading high end of A0: 0
Switch: 0 / 0 / motorstate1: 0 / motorstate2: 0
Reading high end of A0: 1254 Reading high end of A0: 0
Switch: 0 / 0 / motorstate1: 0 / motorstate2: 0
Reading high end of A0: 1254 Reading high end of A0: 0
Switch: 0 / 0 / motorstate1: 0 / motorstate2: 0
Reading high end of A0: 1233 Reading high end of A0: 0

When I use Channel 4 I get two values:

22504
Switch: 0 / 0 / motorstate1: 0 / motorstate2: 0
22002

When I use Channel 2 I get two values:

21508
Switch: 0 / 0 / motorstate1: 0 / motorstate2: 0
Switch: 0 / 1 / motorstate1: 0 / motorstate2: 0
21004

Iscold
Iscold is offline Find More Posts by Iscold
Reply With Quote
Old Nov 18, 2014, 02:43 AM
Registered User
Dutchraptor's Avatar
The Netherlands, ZH, Hoogvliet
Joined Jul 2008
319 Posts
Reading high end of A0: 1658 Reading high end of A0: 0
Switch: 0 / 0 / motorstate1: 0 / motorstate2: 0

Reading part is only when you're in calibration mode. So I guess the Pin2 (cal.pin) is connected to gnd.

Switch: 0/0 means that the switches for ambient and crew sound (pin 5+6) are not active (connected to gnd)

motorstate1: 0 / motorstate2: 0 means that both the switches for the engine sounds are not active (not connected to gnd)

The other 2 channels seem to work fine accept that you get commands that don't make sense. Do you use a 2 way switch or sticks? But it can be fixed (easy). I can see you're using a 9x, needs some settings to assign channels to sticks (you can use 2 switches on 1 channel). Does it have the normal firmware? The middlevalue is read at startup, from that point on it calculated the commands for the rc switched functions/sounds.

Danny

PS: the second A0 supposed to be a A1 (copy/paste error in the program) for reading the second motor input. It's reading nothing (I guess it's not connected or commented out)
Dutchraptor is online now Find More Posts by Dutchraptor
Reply With Quote
Old Nov 18, 2014, 07:31 PM
ISCOLD
Joined Mar 2014
26 Posts
Dutchraptor,

I will use switch for:
Start motor number one (digital pin 3 and GND)
Start ambient and crew sound (digital pins 5,6 and GND)

I will use push button for:
Motor calibration (digital pin 2 and GND)

Throttle command receiver channel 3 to Arduino A0 and GND
Siren command receiver channel 2 to Arduino A2
Horn/Foghorn command receiver channel 3 to Arduino A3

My radio system have the ER9X firmware

The middlevalue is read at startup, from that point on it calculated the commands for the rc switched functions/sounds.
I can not understand this statement.

PS: the second A0 supposed to be a A1 (copy/paste error in the program) for reading the second motor input. It's reading nothing (I guess it's not connected or commented out)
In which line of program I must change A0 to A1? I am not using the motor number 2.

Iscold
Iscold is offline Find More Posts by Iscold
Reply With Quote
Old Nov 26, 2014, 05:02 AM
ISCOLD
Joined Mar 2014
26 Posts
Dutchraptor, Blutoh:

Many tanks for your help me in order to make operational my Soundfx. Now my boats will make sounds.
My main problem, I think, was the communication address between Arduino UNO and RASP.

Iscold
Iscold is offline Find More Posts by Iscold
Reply With Quote
Old Nov 26, 2014, 06:29 AM
Registered User
Dutchraptor's Avatar
The Netherlands, ZH, Hoogvliet
Joined Jul 2008
319 Posts
congratulations, now have some. You earned it.

Danny
Dutchraptor is online now Find More Posts by Dutchraptor
Reply With Quote
Reply


Thread Tools