Go Down

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

john_lenfr

#270
Jun 22, 2014, 03:23 pm Last Edit: Jun 22, 2014, 03:32 pm by john_lenfr Reason: 1
Hello Kas,

I made a first test with a turet of servos. I have a problem and servos are "ticking" even if there is no command.
The problem is more visible when I am in "FAST" mode (compare to the "SLOW" mode)

Because my english is very poor I made a video:
http://www.youtube.com/watch?v=bSABrto4lxg

Do you understand the problem? How can I do to solve it?

Thanks!

Par ailleurs tu m'avais demandé un imprim écran de l'appli, la voici en PJ.


kas

#271
Jun 22, 2014, 05:58 pm Last Edit: Jun 29, 2014, 05:03 pm by kas Reason: 1
Quote
Hi All,
Ive been using this app (v5) for my remote controlled filling cabinet project. https://vimeo.com/98759560
Kas has been helping intensively both with customizing the app and the Arduino code.
Attached is the final code I used, incl distance sensor feedback & Battery level and lots more.

Hardware: Arduino mega, DC Motor Driver 2x 15A - Lite,  BT2S Bluetooth to Serial Slave, HC-SR04 Distance Sensors, Pride electric wheel chair, blood sweat and tears. You can find more making of videos on: https://vimeo.com/jaapdemaat/videos.



For info
Jaap is a senior graphic designer, based in Rotterdam and London
The Cabinet ("I Know What You Did Last Summer") is currently exhibited at the Royal College of Art, in London, up to June 27th


@Jaap,
Thanks again for your hospitality in London, I really enjoyed entering your universe for a while



kas

#272
Jun 22, 2014, 06:08 pm Last Edit: Jun 24, 2014, 06:34 pm by kas Reason: 1
Quote
Je n'ai pas encore testé en détail (j'ai remarqué qu'il y a pleins d'options)mais je voulais te féliciter pour ton travail qui a l'air énorme!

Les seuls points négatifs que j'aurais à redire sont sur la communication de ton programme, mais je te rassure ce sont des points de détails comparé au reste de ton travail:
- Tu devrais éditer ton premier post pour mettre ton versionning en sens inverse: le plus récent en haut de la liste (on a plus l'habitude que ce soit dans ce sens et ça perturbe pour trouver la bonne info)
- Pour les renvois vers les posts des version etc fais juste un lien hypertext sur le post en question par exemple si tu parles de la réponse #256 tu la transforme en #256 c'est de suite plus pratique.
- Pour le coté GooglePlay met un lien direct vers le programme exemple (fichier .ino) car sinon il faut venir sur ce post, chercher la dernière version, et ensuiite se rendre à la réponse #256 pour enfin faire un copier/coller du code: le nombre de manip est rebuttant et cela peut causer problème pour une personne qui s'y connait pas trop mais qui voudrait utiliser ton appli.

Thanks  john_lenfr for the comments, feedback is always welcome
I will definitely add more links to reply #1  ;)


Quote
I have a problem and servos are "ticking" even if there is no command.

not normal behavior  :smiley-roll-blue: :smiley-roll-blue:
Possibly electric noise or MCU internal timers interaction
please post your full code, I will try it on my side

What happens if you comment
Code: [Select]
 sendBlueToothData();


Let me know

EDIT: which Arduino model are you using ??

john_lenfr


not normal behavior  :smiley-roll-blue: :smiley-roll-blue:
Possibly electric noise or MCU internal timers interaction
please post your full code, I will try it on my side

You wrote here that Softserial doen'nt work with servo lib. It is always true?


Quote
What happens if you comment
Code: [Select]
 sendBlueToothData();

The problem is less visible but ticking  is always here :( (and data 3 is not updated on Android screen of course)
Quote

Let me know

Here is my starting skech I use attached.

kas

Quote
You wrote here that Softserial doen'nt work with servo lib. It is always true?

Try
https://www.google.com/search?hl=en&as_q=%22SoftwareSerial%22+%22servo%22+%22library%22+arduino&as_epq=&as_oq=&as_eq=&as_nlo=&as_nhi=&lr=&cr=&as_qdr=all&as_sitesearch=&as_occt=any&safe=images&tbs=&as_filetype=&as_rights=&gws_rd=ssl
and see for yourself  ;)

I tried your sketch, removing Wire and snootor references; serial monitor readings are 100% stable
Please upload Pan & Tilt demo sketch at reply #242

//  Arduino pin #0 to TX BlueTooth module
// BT TX to be disconnected from D0 during sketch upload
// pinServo_X=9        pinServo_Y=10

Do not use SoftwareSerial for the moment, let me know how it works
Which Arduino board are you using ??


john_lenfr

Quote
Try
https://www.google.com/search?hl=en&as_q=%22SoftwareSerial%22+%22servo%22+%22library%22+arduino&as_epq=&as_oq=&as_eq=&as_nlo=&as_nhi=&lr=&cr=&as_qdr=all&as_sitesearch=&as_occt=any&safe=images&tbs=&as_filetype=&as_rights=&gws_rd=ssl
and see for yourself  ;)

What is the lib that I have to choose because the link is your google search?

Quote
I tried your sketch, removing Wire and snootor references; serial monitor readings are 100% stable
Please upload Pan & Tilt demo sketch at reply #242

Yes, I saw that values are OK and 100% stable.

Quote
//  Arduino pin #0 to TX BlueTooth module
// BT TX to be disconnected from D0 during sketch upload
// pinServo_X=9        pinServo_Y=10
Do not use SoftwareSerial for the moment, let me know how it works
Which Arduino board are you using ??

Tested your Pan&Tilt V3.6 there is no ticking, but when I test it servos are not staying in position (but I think it is because of the code):
http://www.youtube.com/watch?v=DBu2DoXk3hA

So, what is the last Softserial I have to choose to do the last test?

My board is an Uno, you can't see it on vids?  :smiley-mr-green:

john_lenfr

#276
Jun 22, 2014, 09:25 pm Last Edit: Jun 22, 2014, 09:44 pm by john_lenfr Reason: 1
So now I will test the first program, but with 0 and 1 serial

EDIT: Ok I tested with Demo code AndroTest V2.0 and no ticking but same problem as the video on post above

kas

#277
Jun 23, 2014, 09:05 am Last Edit: Jun 23, 2014, 09:21 am by kas Reason: 1
For the servo's test, please go to "settings/joystick properties" and uncheck "Auto return to center"

So, the servo's are jerking, but the values are stable in the serial monitor ??
Are the servo's jerking only near joystick limit positions (-100 or +100) ??

I remember having problems with digital servo's, some years ago  :smiley-roll:
some wouldn't accept the total 0 to 180° rotation range

Just to make sure, please modify code to limit range to 45 to 135°
Code: [Select]

 joyX = map(joyX, -100, 100, 135, 45);
 joyY = map(joyY, -100, 100, 45, 135);  



if it works, you may try
Code: [Select]

 joyX = map(joyX, -100, 100, 170, 10);  
 joyY = map(joyY, -100, 100, 10, 170);


john_lenfr

Ok I will test it soon as possible.

Many thanks for quick replies ;)

kas

#279
Jun 23, 2014, 02:14 pm Last Edit: Jul 08, 2014, 07:02 am by kas Reason: 1
I just tried running two servo's using SoftwareSerial on pins #2 & #3, and also got the "Tick-Tick syndrom"
SoftwareSerial disables interrupts while sending a byte.
This interferes with the Servo library, which relies on timer interrupts

The hardware Serial port should always be used, if possible, before considering SoftwareSerial.
Additional readings

Possible options
- drop SoftwareSerial and use pins #0 and #1 (disconnect pins before uploading sketch)
- try using ServoTimer2 or AltSoftSerial libraries that use a different timer (not tested)
- get an Arduino Mega which has additional hardware serial ports



kas

#280
Jun 23, 2014, 04:57 pm Last Edit: Jun 23, 2014, 10:15 pm by kas Reason: 1
Jaap, this is FilingCab V1.6
PWM frequency was boosted from 490Hz to 20KHz to get rid of hissing noise at low speed
Also the infamous SoftwareSerial library was dropped  ]:)

Serial:
- move pin #11  to  RX1 (pin #19)
- move pin #12  to  TX1 (pin #18)

PWM:
- move pin #5   to  pin #11
- move pin #6   to  pin #12

Smoother and quieter control

Happy driving, mind the stair  ;)



kas

@tolisn63
Quote
Quote
Any idea when Total RC commander will be available with the new protocol and a test sketch ?

Will wait for Joystick BT commander V5.0 feedback
Would say two or three weeks


The video App is now ready for test
Same demo sketch as Joystick BT commander V5.0

Check your mail and let me have your feedback  ;)

magicjackho

#282
Jul 08, 2014, 05:29 am Last Edit: Jul 16, 2014, 12:56 pm by magicjackho Reason: 1
I can't really get onto google play and download the app from China
can anybody send me the app to my email
or send me another link to download
thankyou very much!

kas

#283
Jul 08, 2014, 10:05 am Last Edit: Jul 30, 2014, 04:59 pm by kas Reason: 1
Quote
I can't really get onto google play and download the app from China
can anybody send me the app to my email (xxx-xxx@qq.com)
or send me another link to download
thank you very much!


Hi magicjackho, welcome to the Forum
Check your mail ;)

I sent you V5.2 to be published on Google Play within a few weeks
Should you need support, this is the place

Let me have a screenshot of the Application

@All     ** I NEED screenshots **
this my only way to optimize display layout for your specific device  :)

Personal advice:
To avoid spamming, I suggest you edit your message and remove your email info   ]:)


twm47099

I've downloaded version 5 to my Samsung tablet 4.  I cannot find a way to get to a settings screen.  I have BT turned on, but I have not yet paired it to a device.  Does that make a difference?  How do I find a settings screen.

Thanks
Tom

Go Up