Android Bluetooth joystick

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 ??

Problems start when I want separate power for Arduino/BT and servos, cant use USB power in the field.
I will be using batteries, 4xAA 1.5v (6v) for Arduino/BT power and 5x 1.2V AA NiMH (6v, 2700 mAh) for the servos

In that setup, one of the servos locks at full 180, the other will be fine.

If I power the Ard/BT and servos with just the 4xAAs, no lock up, pan is fine, tilt is not locked but not enough power to move the camera/lens (see above, its ok with mock setup - no camera)

This sounds like it might be just a simple wiring problem ... have you got both the battery pack GNDs linked?

Hi Vic,

Not sure what is happening here, does seem a power issue

Yes, highly probable
Check your ground connections as suggested by woodygb

When testing the setup using USB power, everything is fine

What is your actual USB 5V source ?? mAh available ??

So this led me to measure the voltages at each point and discovered the voltage drops to 4.03v

No drop when iddle ??
Is your battery pack brand new or used ??

According to Goteck GS-5515MG datasheet (4.8 & 6V):

2200mA at free run, means 5+ Amps at full load
This may be too much for a 2700mAh NiMH battery set
Try a 4000mAh+ battery pack

Any possibility to reduce required torque through better camera balance ??

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 --- :~ =( :frowning: :disappointed_relieved:

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.

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

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. :stuck_out_tongue:

Cheers
Vic

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

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.

Happy to help.

Ignore the star pointing diagram.

... display battery charge indication ...

easy :wink:

  • 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
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

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

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"

i just want to say this is a good forum.etui galaxy tab 4 10.1 housse galaxy tab 4 10.1 etui samsung galaxy tab 4 10.1

i just want to say this is a good forum :slight_smile: :slight_smile:

Thanks 8)
Welcome to the Arduino Forum

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

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.

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) .

kas:

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 ??

tolisn63:
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 ?

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.

woodygb:

tolisn63:
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 ?

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.

woodygb:
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.

Well, the waypoint channel is controlled by one channel of the R/C receiver. This R/C receiver channel is controller by a two position switch on the R/C transmitter. What is the signal value for one position of the switch and what is the value for the other position, 1200 and 1800 ?.

I'd need to actually read the values .... I can do this later if you wish ... but I'd say that it is a pretty safe bet that the signal is 1200 - 1800 ish .

The Ele , Aile , Rud & Throttle channels ( joystick ) are certainly 1200 - 1500 - 1800 ish ..the ish is to denote that there is always a slight variation from std.

Note that I have read the stick channel signals.... but never needed to read the Toggle switches