Go Down

Topic: Android Bluetooth joystick (Read 331561 times) previous topic - next topic

thornlv

Hey, brilliant feed back - will check gnds etc - just undergoing testing with various power pack options - and remembered I have a 6000mAh power pack I use for emergency mobile phone/tablet, but it needs a full charge.

At moment its all a bit moot as my Nikon USB port has failed and needs a repair so wont be using the bt control tripod head until then   ---   :~ =( :( :smiley-sad-blue:

woodygb

I'm surprised that you couldn't give an immediate answer .... Oh well .

On the assumption that you have neglected to COMMON your GND's  ...do it ....and I suspect that your problem will go away.

http://electronics.stackexchange.com/questions/73503/multiple-voltage-sources-using-a-single-ground

thornlv

hi woody, this is just a quick look for me.

Quote
I'm surprised that you couldn't give an immediate answer .... Oh well


some clues. Wife, new washing machine, 3 days of washing needs to be done, out door window ledges need stripping, painted. big trip out tomorrow - get cameras charged, sandwiches made, hats coats boots ready, work out route to destination - dog needs walking etc etc - a husbands work is never done, no time for play. oh, and didn't really understand the question about grounds but your link is today's invaluable addition to my understanding on basic electronics so ta very much so when I get round to playing again will update - unless something else breaks. :P

Cheers
Vic

woodygb

#318
Aug 28, 2014, 11:55 pm Last Edit: Aug 29, 2014, 11:40 am by woodygb Reason: 1
Ah! .... OK... Vic.

The signal that you sent from the Arduino to the servo's needs to complete a return journey ...... it's return point of the loop is the  GND of the Arduino.

The normal return point of the signal entering the servo is the GND of the servo's battery pack.

So COMMON ( join ) the two battery pack GND's and the signal your sending to the servo's will not be forced to try and find an alternate  path.

If the signal couldn't find any route back ...E.G ...without the GND's being COMMONED ...something like a single servo would not work ... you however have two signal wires and I suspect that one of these ( probably the servo that goes hard over ) is being  used as a less than ideal route back to the Arduino's GND causing much wierdness.

Cheers Woody

thornlv

#319
Aug 30, 2014, 01:21 pm Last Edit: Aug 30, 2014, 01:41 pm by thornlv Reason: 1
just had some time to play.

The issue was down to wiring, have tried a breadboard version of my circuit and then added a common ground back to the arduino for the servos (should I wire up as a 'starpointing' schematic ?).

as for power source for servos, I can now use 2700mAh NiMH batteries, when I used to use a RC transmitter, I knew I could get about 12+ hours. The servos will not be constantly moving, in fact repositioning would be very infrequent.

as for when I was testing the circuit for power I was using a PC usb port - about .5A

Balancing the camera/lens is quite easy. The gimbal head I am using takes very little effort in positioning - only needing a slight push with a finger whilst still remaining stable and without shake (can vary the amount of friction on both axis). The lens plate which attaches the camera/lens to the tripod head is marked for alignment, I have marked demarcation points for each lens combination so that whichever lens I use, i can quickly mount them and they will be balanced.

The heaviest setup I use needs a bigger servo for tilt than the pan. I could experiment to find what torque I need but this would mean buying more servos (even though some are cheap) but I already know that if the voltage drops below 5v the tilt servo may struggle. If use a lighter lens I would have plenty of torque (My current heaviest setup is 4kg, 9lbs)

I may in the future add a third servo for controlling zoom (my working lens is a fixed focal length prime). Now i have a stable circuit I will now play with angles and speeds.

I have also found a sketch to set the HC-05 - http://www.instructables.com/id/Modify-The-HC-05-Bluetooth-Module-Defaults-Using-A/?ALLSTEPS

Other thoughts I had, could there be a WiFi version, would/could I also need a version of the app that includes video feedback ?, battery charge indication.

Many thanks for the help, education.

woodygb

Happy to help.

Ignore the star pointing diagram.

kas

#321
Aug 31, 2014, 07:57 am Last Edit: Aug 31, 2014, 08:23 am by kas Reason: 1
Quote
... display battery charge indication ...

easy  ;)
- enable Arduino >> Android communication (see AndroTest V2.0 demo sketch)
- bring a 4 Volts image of your battery level to Analog Input 0 using a resistive voltage divider
- monitor A0 value every 1000ms
- send value to datafield#1
- if value < voltMin,  send  "** LOW Bat **"  message to datafield#3

Code: [Select]
void checkLowBat()  {                                            // check Low battery condition
 static long previousMillis = 0;                            
 long currentMillis = millis();
 if(currentMillis - previousMillis > checkLowBatInterval) {     // check every checkLowBatInterval milliseconds
   previousMillis = currentMillis;
   voltage = analogRead(Vpin) * K;                              // K: calculated according resistors values
   if(voltage < voltLimit)    displayStatus = "** LOW Bat **";  // send message to Android device
 }  
}

You can monitor both batteries, using A0 & A1



Quote
Other thoughts I had, could there be a WiFi version, would/could I also need a version of the app that includes video feedback ?

Should be possible
Total RC Commander is a sister App that includes Video features through WiFi

See the video in the Exhibition Section

Let me have more info about the video stream you want to display



Quote
I have also found a sketch to set the HC-05 - http://www.instructables.com/id/Modify-The-HC-05-Bluetooth-Module-Defaults-Using-A/?ALLSTEPS

Did you succeed in changing your BT card bps ??
The command line should be "at+uart=57600,0,0\r\n"


Olivier8604

#322
Aug 31, 2014, 08:10 am Last Edit: Sep 03, 2014, 11:16 am by Olivier8604 Reason: 1

kas

#323
Aug 31, 2014, 09:04 am Last Edit: Aug 31, 2014, 12:33 pm by kas Reason: 1
Quote
i just want to say this is a good forum  :) :)


Thanks  8)
Welcome to the Arduino Forum

thornlv

Just wanted to say this is NOT a good forum, much better than that - good is average.

With the HC05 configure sketch I was able to change its name, passcode and any baud rate I chose - however ending in ,0,0 did not work - AT+UART=57600 did.

Many thanks, now to walk the dog, pack clothes ready for a short break in Wales - will tinker more when I am back.

Cheers.

Vic

woodygb

#325
Sep 04, 2014, 10:47 am Last Edit: Sep 04, 2014, 11:43 am by woodygb Reason: 1


I'd suggest that you use a logic like this....to operate the motor switches from the X Y inputs and let the "autonomous" routine take care of itself.

NOTE:- I haven't bothered to check if the < >  are matched correctly to the motor directions

if JoyY  > 10 .... forward  .............( 10 used as an arbitrary  "deadband")
if JoyY  < -10 ..... backward

if JoyX  > 10 ..... turnright
if JoyX  < -10 ..... turnleft

else  ...  motorwiper()     ("autonomous" routine ?)

add in button press logic to suit yourself.... ON/OFF  ...Joystick input only ..  etc

http://arduino.cc/en/Reference/Return ...you seem to be using them without need.

tolisn63

Hi Kas
I'm struggling to find information regarding the signals required but this is very slow. Other forums are not near as active as this one.
Anyway, this is what I found out so far.
In order to switch between the modes, the apm requires a signal that has one of the three values.
with a signal of 1200 it will go to Auto, 1500 it will go to LEARNING and 1800 it will go to Manual. This is one PWM output.

Another PWM output controls the add and delete waypoint (yet to determine the values)

Two more PWM channels are used for throttle and direction control (probably normal R/C PWM control values) .





Quote
Switching between modes is accomplished by changing pwm values on one channel. Thus when the pwm
value is "A" the apm mode is "manual", when it is "B" the mode goes to "Auto" and so on.

What are the specific values for A & B ??
Can you point me to the wiki part where this is described in details

The objective is to create a third PWM output
If Button#1 == not pushed   then PWM = A  (manual mode, default)
If Button#1 == pushed           then PWM = B  (autopilot mode)
Korrect ??


woodygb

#327
Sep 05, 2014, 05:15 pm Last Edit: Sep 05, 2014, 05:21 pm by woodygb Reason: 1


I'm struggling to find information regarding the signals required but this is very slow. Other forums are not near as active as this one.
Anyway, this is what I found out so far.
In order to switch between the modes, the apm requires a signal that has one of the three values.
with a signal of 1200 it will go to Auto, 1500 it will go to LEARNING and 1800 it will go to Manual. This is one PWM output.

Another PWM output controls the add and delete waypoint (yet to determine the values)

Two more PWM channels are used for throttle and direction control (probably normal R/C PWM control values) .


I assume that you are aware of the std PWM signal range for R/C ?

tolisn63

Yes, I do know the std R/C operation range and that is why I assume the throttle and steering use this.
I'm not sure though of the values required for the waypoint manipulation. That is what I'm trying to find out.







I'm struggling to find information regarding the signals required but this is very slow. Other forums are not near as active as this one.
Anyway, this is what I found out so far.
In order to switch between the modes, the apm requires a signal that has one of the three values.
with a signal of 1200 it will go to Auto, 1500 it will go to LEARNING and 1800 it will go to Manual. This is one PWM output.

Another PWM output controls the add and delete waypoint (yet to determine the values)

Two more PWM channels are used for throttle and direction control (probably normal R/C PWM control values) .


I assume that you are aware of the std PWM signal range for R/C ?

woodygb

#329
Sep 05, 2014, 05:56 pm Last Edit: Sep 05, 2014, 06:01 pm by woodygb Reason: 1
You could presume that the pulse used for the add/delete waypoint would be the normal signal output by the movement of a R/C transmitters toggle switch ...thus Low and High... 1200 - 1800.


Go Up