Go Down

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

fullspool

Thank you KAS, I test it with the LEDS and you can see they are changing pulse widths with stick movement however I am out of the pwn range on my ESC as you can see it just flashes (green LED on ESC should be solid) .

Maybe it should see throttle set to zero for 3 seconds, then send signal ? I am not sure if this ESC has a throttle protection built in ?

Excuse the wiring mess as it's in prototype stage.

https://youtu.be/DNMxmfj8cco

Thank you

kas

#556
Feb 04, 2016, 06:02 pm Last Edit: Feb 04, 2016, 06:15 pm by kas
Quote
Thank you KAS, I test it with the LEDS and you can see they are changing pulse widths with stick movement however I am out of the pwn range on my ESC as you can see it just flashes (green LED on ESC should be solid) .
According to Scorpion XL documentation:
Quote
These should be attached to your R/C receiver or signal
source just like a normal R/C servo.
Forget the bot for the moment
Please connect two servos and see if they are actuated
Also let me have a screenshot showing debug info's on Serial Monitor

BTW, this documentation is less than adequate :-\


EDIT: also google for robot "differential steering"


fullspool

The ESC Is connected I just have the LEDs connected also so you could see the pulses .

Let me grab some servos :)

fullspool

I just tested with servos and it works. It has to be something with esc then?
Is it safe to power my bread board with battery and also connect to Usb computer source for
serial monitor? I don't want to burn up anything.

Here is more info on the esc, however this is the 2.0 board though. I am still searching for more info.
http://www.robotpower.com/products/scorpion_XL_info.html

Here is the youtube video with servos.

https://youtu.be/IFoRBFMhhFw


kas

Quote
Is it safe to power my bread board with battery and also connect to Usb computer source for
serial monitor? I don't want to burn up anything.
Yes, grounds should be connected


Quote
I just tested with servos and it works. It has to be something with esc then?
According to doc: "Microcontrollers such as PIC, AVR, ARM, Arduino etc. can drive the Scorpion XL by using servo command outputs"
So, yes it has to be something with this specific ESC
Please get support from manufacturer

We will then address remaining aspects (differential steering, real time voltage and milli amps monitoring)


fullspool

KAS the ESC works perfect when you use traditional radio control , I am thinking it may need to see throttle position at 0 for x seconds before it will power the motors?

Here is me controlling the rover programmed to my radio

https://www.youtube.com/watch?v=RBomaEX9W1E

fullspool

Here is serial pic request, I am still researching on my ESC

fullspool

Kas , I owe you a beer for the help thus far . :)

It appears we need to cut the signal for 3-5 seconds or put throttle to 0 . If it see signal then the esc won't engage .

I hooked everything up and moved joy stick to back position on your app and it engaged.  Therefore I was able to drive rover forward and back for this video . When I tried to do same procedure and test again it would not engaged the esc ???

Here is video

https://youtu.be/ix-E1TvCHXY

kas

#563
Feb 05, 2016, 07:40 am Last Edit: Feb 05, 2016, 07:49 am by kas
Quote
Here is me controlling the rover programmed to my radio
https://www.youtube.com/watch?v=RBomaEX9W1E
Nice and powerful bot
At which level is differential steering implemented ??


Quote
Here is serial pic request, I am still researching on my ESC
Perfect  ;)


Quote
It appears we need to cut the signal for 3-5 seconds or put throttle to 0 . If it see signal then the esc won't engage .
I hooked everything up and moved joy stick to back position on your app and it engaged.  Therefore I was able to drive rover forward and back for this video . When I tried to do same procedure and test again it would not engaged the esc
Sorry, can't help you for this specific ESC


I suggest you dedicate one App button for LOW speed mode  ;)




fullspool

On my RC radio differential steering in activated on initial start up, there is no delay as it reacts exactly to my stick movements.

Is there a way to write a section of code to send signal inputs to -100 or low position for X seconds ? I don't mind to use the button just to test this. I think it's very close but the pwm signal seems to be out of range
for the ESC, I will keep test further as I really want this to work.

Here is a PDF of more information that I am reading now.

http://www.robotpower.com/downloads/RobotPower_Scorpion_XL_quickstart.pdf

Thanks KAS   

kas

#565
Feb 05, 2016, 04:28 pm Last Edit: Feb 05, 2016, 05:28 pm by kas
Quote
Is there a way to write a section of code to send signal inputs to -100 or low position for X seconds ? I don't mind to use the button just to test this.
Change your setServoPosition function for this one:

Code: [Select]
void setServoPosition(byte data[8])    {   // differential steering version
  int servo_L, servo_R;
  int joyX = (data[1]-48)*100 + (data[2]-48)*10 + (data[3]-48);       // obtain the Int from the ASCII representation
  int joyY = (data[4]-48)*100 + (data[5]-48)*10 + (data[6]-48);
  joyX = joyX - 200;                                                  // Offset to avoid
  joyY = joyY - 200;                                                  // transmitting negative numbers

  if(joyX<-100 || joyX>100 || joyY<-100 || joyY>100)     return;      // communication error

  if(joyY >-10)  {                                                    // differential steering
    servo_L = (joyY - (3*joyX)/4);
    servo_R = (joyY + (3*joyX)/4);
  }  else  {
    servo_L = (joyY + (3*joyX)/4);
    servo_R = (joyY - (3*joyX)/4);
  }
 
  servo_L = map(servo_L, -100, 100, 180, 0);   //  << adjust to change motor direction XXX
  servo_R = map(servo_R, -100, 100, 0, 180);   //  <<
  servo_L = constrain(servo_L, 0, 180);
  servo_R = constrain(servo_R, 0, 180);

  myservoX.write(servo_L);
  myservoY.write(servo_R);
  if(DEBUG)    {Serial.print(joyX); Serial.print(", "); Serial.println(joyY);}
}


This version implements differential steering
By moving joystick "full south", you will send 'low' to both motors
Should you post a new video, please move joystick slowly  ;)


fullspool

I really wish I understood the code that you give me, thanks for your patience. I will try it asap and slow my stick movements on next video :)


fullspool

kas, I have good news I got rover working. I calibrated ESC and now it's working fine.
I do have a video but its not very good. Rover is very difficult to control as Left and Right Stick movements
cause the rover to go forward or backwards and up/down movements cause it to turn.

I tried to capture this on video but it was difficult by myself. I also need to dial in some expo as it's very sensitive before it gets full power.

Thank you sir.

Video

https://youtu.be/50HhGHvt52E

kas

#568
Feb 06, 2016, 07:41 am Last Edit: Feb 06, 2016, 07:42 am by kas
Quote
I do have a video but its not very good. Rover is very difficult to control as Left and Right Stick movements cause the rover to go forward or backwards and up/down movements cause it to turn.
As mentioned in the code, adjust motors direction

Depending on your motor connections, you probably have to change
  servo_L = map(servo_L, -100, 100, 180, 0);       //  << adjust to change motor direction XXX
  servo_R = map(servo_R, -100, 100, 0, 180);

to
  servo_L = map(servo_L, -100, 100, 0, 180);       //  << adjust to change motor direction XXX
  servo_R = map(servo_R, -100, 100, 0, 180);



During testing, you may change
  myservoX.write(servo_L);
  myservoY.write(servo_R);

to
  myservoX.write(servo_L /2);
  myservoY.write(servo_R /2);



fullspool

#569
Feb 07, 2016, 12:26 am Last Edit: Feb 07, 2016, 12:47 am by fullspool
I found out I have to calibrate the esc every time  I make changes to the pwn signal.  After a couple more hours of messing it I now have a drivable unit . I can't thank you enough Kas . :)

Here is a video , it's not very good as it's hard to drive and video . I will have my wife help me tomorrow .

How can I display mAh and voltage ? The other things I'm curious about as if signal is weak or missing then it will act as dead man switch to motors .

Also can I insert code from example ino file for the button commands to actual a servo ?


Video
https://youtu.be/MdcPS_c69Is


Thanks ,
FullSpool

Go Up