Post Reply 
 
Thread Rating:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Code errors and balance issues
08-02-2016, 12:50 AM
Post: #1
Code errors and balance issues
Hello

When I compile the code I get a list of error messages (see below);

The compile does however complete and the upload is successful. However the robot does not balance. The wheels spin in different directions as I angle the robot and stop when it is vertical. However the thing wont stay upright. Is this related to the code error? If not is interference from the motors a factor and is there a way to check this using the debug options?

CODE ERRORS

Arduino: 1.6.6 (Windows 7), Board: "Arduino Leonardo"

In file included from C:\Users\Home\Documents\Arduino\BROBOT\BROBOT.ino:51:0:

C:\Users\Home\Documents\Arduino\libraries\MPU6050/JJ_MPU6050_DMP_6Axis.h: In member function 'uint8_t MPU6050::dmpGetAccel(int32_t*, const uint8_t*)':

C:\Users\Home\Documents\Arduino\libraries\MPU6050/JJ_MPU6050_DMP_6Axis.h:576:31: warning: left shift count >= width of type [enabled by default]

data[0] = ((packet[28] << 24) + (packet[29] << 16) + (packet[30] << 8) + packet[31]);

^

C:\Users\Home\Documents\Arduino\libraries\MPU6050/JJ_MPU6050_DMP_6Axis.h:576:52: warning: left shift count >= width of type [enabled by default]

data[0] = ((packet[28] << 24) + (packet[29] << 16) + (packet[30] << 8) + packet[31]);

^

C:\Users\Home\Documents\Arduino\libraries\MPU6050/JJ_MPU6050_DMP_6Axis.h:577:31: warning: left shift count >= width of type [enabled by default]

data[1] = ((packet[32] << 24) + (packet[33] << 16) + (packet[34] << 8) + packet[35]);

^

C:\Users\Home\Documents\Arduino\libraries\MPU6050/JJ_MPU6050_DMP_6Axis.h:577:52: warning: left shift count >= width of type [enabled by default]

data[1] = ((packet[32] << 24) + (packet[33] << 16) + (packet[34] << 8) + packet[35]);

^

C:\Users\Home\Documents\Arduino\libraries\MPU6050/JJ_MPU6050_DMP_6Axis.h:578:31: warning: left shift count >= width of type [enabled by default]

data[2] = ((packet[36] << 24) + (packet[37] << 16) + (packet[38] << 8) + packet[39]);

^

C:\Users\Home\Documents\Arduino\libraries\MPU6050/JJ_MPU6050_DMP_6Axis.h:578:52: warning: left shift count >= width of type [enabled by default]

data[2] = ((packet[36] << 24) + (packet[37] << 16) + (packet[38] << 8) + packet[39]);

^

C:\Users\Home\Documents\Arduino\libraries\MPU6050/JJ_MPU6050_DMP_6Axis.h: In member function 'uint8_t MPU6050::dmpGetQuaternion(int32_t*, const uint8_t*)':

C:\Users\Home\Documents\Arduino\libraries\MPU6050/JJ_MPU6050_DMP_6Axis.h:600:30: warning: left shift count >= width of type [enabled by default]

data[0] = ((packet[0] << 24) + (packet[1] << 16) + (packet[2] << 8) + packet[3]);

^

C:\Users\Home\Documents\Arduino\libraries\MPU6050/JJ_MPU6050_DMP_6Axis.h:600:50: warning: left shift count >= width of type [enabled by default]

data[0] = ((packet[0] << 24) + (packet[1] << 16) + (packet[2] << 8) + packet[3]);

^

C:\Users\Home\Documents\Arduino\libraries\MPU6050/JJ_MPU6050_DMP_6Axis.h:601:30: warning: left shift count >= width of type [enabled by default]

data[1] = ((packet[4] << 24) + (packet[5] << 16) + (packet[6] << 8) + packet[7]);

^

C:\Users\Home\Documents\Arduino\libraries\MPU6050/JJ_MPU6050_DMP_6Axis.h:601:50: warning: left shift count >= width of type [enabled by default]

data[1] = ((packet[4] << 24) + (packet[5] << 16) + (packet[6] << 8) + packet[7]);

^

C:\Users\Home\Documents\Arduino\libraries\MPU6050/JJ_MPU6050_DMP_6Axis.h:602:30: warning: left shift count >= width of type [enabled by default]

data[2] = ((packet[8] << 24) + (packet[9] << 16) + (packet[10] << 8) + packet[11]);

^

C:\Users\Home\Documents\Arduino\libraries\MPU6050/JJ_MPU6050_DMP_6Axis.h:602:50: warning: left shift count >= width of type [enabled by default]

data[2] = ((packet[8] << 24) + (packet[9] << 16) + (packet[10] << 8) + packet[11]);

^

C:\Users\Home\Documents\Arduino\libraries\MPU6050/JJ_MPU6050_DMP_6Axis.h:603:31: warning: left shift count >= width of type [enabled by default]

data[3] = ((packet[12] << 24) + (packet[13] << 16) + (packet[14] << 8) + packet[15]);

^

C:\Users\Home\Documents\Arduino\libraries\MPU6050/JJ_MPU6050_DMP_6Axis.h:603:52: warning: left shift count >= width of type [enabled by default]

data[3] = ((packet[12] << 24) + (packet[13] << 16) + (packet[14] << 8) + packet[15]);

^

C:\Users\Home\Documents\Arduino\libraries\MPU6050/JJ_MPU6050_DMP_6Axis.h: In member function 'uint8_t MPU6050::dmpGetGyro(int32_t*, const uint8_t*)':

C:\Users\Home\Documents\Arduino\libraries\MPU6050/JJ_MPU6050_DMP_6Axis.h:633:31: warning: left shift count >= width of type [enabled by default]

data[0] = ((packet[16] << 24) + (packet[17] << 16) + (packet[18] << 8) + packet[19]);

^

C:\Users\Home\Documents\Arduino\libraries\MPU6050/JJ_MPU6050_DMP_6Axis.h:633:52: warning: left shift count >= width of type [enabled by default]

data[0] = ((packet[16] << 24) + (packet[17] << 16) + (packet[18] << 8) + packet[19]);

^

C:\Users\Home\Documents\Arduino\libraries\MPU6050/JJ_MPU6050_DMP_6Axis.h:634:31: warning: left shift count >= width of type [enabled by default]

data[1] = ((packet[20] << 24) + (packet[21] << 16) + (packet[22] << 8) + packet[23]);

^

C:\Users\Home\Documents\Arduino\libraries\MPU6050/JJ_MPU6050_DMP_6Axis.h:634:52: warning: left shift count >= width of type [enabled by default]

data[1] = ((packet[20] << 24) + (packet[21] << 16) + (packet[22] << 8) + packet[23]);

^

C:\Users\Home\Documents\Arduino\libraries\MPU6050/JJ_MPU6050_DMP_6Axis.h:635:31: warning: left shift count >= width of type [enabled by default]

data[2] = ((packet[24] << 24) + (packet[25] << 16) + (packet[26] << 8) + packet[27]);

^

C:\Users\Home\Documents\Arduino\libraries\MPU6050/JJ_MPU6050_DMP_6Axis.h:635:52: warning: left shift count >= width of type [enabled by default]

data[2] = ((packet[24] << 24) + (packet[25] << 16) + (packet[26] << 8) + packet[27]);

^

C:\Users\Home\Documents\Arduino\BROBOT\BROBOT.ino: In function 'void setup()':

C:\Users\Home\Documents\Arduino\BROBOT\BROBOT.ino:594:29: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

ESPsendCommand("AT","OK",1);

^

C:\Users\Home\Documents\Arduino\BROBOT\BROBOT.ino:595:35: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

ESPsendCommand("AT+RST", "OK", 2); // ESP Wifi module RESET

^

C:\Users\Home\Documents\Arduino\BROBOT\BROBOT.ino:597:35: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

ESPsendCommand("AT+GMR", "OK", 5);

^

C:\Users\Home\Documents\Arduino\BROBOT\BROBOT.ino:603:37: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

ESPsendCommand("AT+CWQAP", "OK", 3);

^

C:\Users\Home\Documents\Arduino\BROBOT\BROBOT.ino:604:40: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

ESPsendCommand("AT+CWMODE=2", "OK", 3); // Soft AP mode

^

C:\Users\Home\Documents\Arduino\BROBOT\BROBOT.ino:606:16: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

char *cmd = "AT+CWSAP=\"JJROBOTS_XX\",\"87654321\",5,3";

^

C:\Users\Home\Documents\Arduino\BROBOT\BROBOT.ino:614:40: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

ESPsendCommand("AT+CIPMUX=0", "OK", 3); // Single connection mode

^

C:\Users\Home\Documents\Arduino\BROBOT\BROBOT.ino:615:41: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

ESPsendCommand("AT+CIPMODE=1", "OK", 3); // Transparent mode

^

C:\Users\Home\Documents\Arduino\BROBOT\BROBOT.ino:617:76: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

ESPsendCommand("AT+CIPSTART=\"UDP\",\"192.168.4.2\",2223,2222,0", "OK", 3);

^

C:\Users\Home\Documents\Arduino\BROBOT\BROBOT.ino:619:36: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

ESPsendCommand("AT+CIPSEND",">",2); // Start transmission (transparent mode)

^

C:\Users\Home\Documents\Arduino\BROBOT\BROBOT.ino: In function 'void loop()':

C:\Users\Home\Documents\Arduino\BROBOT\BROBOT.ino:918:58: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

OSC.MsgSend("/1/rotary1\0\0,f\0\0\0\0\0\0",20,value);Huh
Find all posts by this user
Quote this message in a reply
08-02-2016, 03:05 AM (This post was last modified: 08-02-2016 03:06 AM by jimmy.)
Post: #2
RE: Code errors and balance issues
@Alanog, have you tried an older Arduino IDE like 1.6.5 or older? and maybe your motors are connected reverse.
Find all posts by this user
Quote this message in a reply
08-02-2016, 02:55 PM
Post: #3
RE: Code errors and balance issues
Thanks Jimmy

I tried using I.D.E. 1.6.5 and the compile and there were no compile errors. However, the robot still wont balance so I'll try shielding the cables.
Find all posts by this user
Quote this message in a reply
08-02-2016, 05:13 PM
Post: #4
RE: Code errors and balance issues
Analog, Have you installed the libraries properly? Can you attach photos of your set up? or even better, a video of the starting up?
Find all posts by this user
Quote this message in a reply
08-02-2016, 08:13 PM
Post: #5
RE: Code errors and balance issues
(08-02-2016 05:13 PM)JohnQ Wrote:  Analog, Have you installed the libraries properly? Can you attach photos of your set up? or even better, a video of the starting up?

Libraries are in the right places but I don't know how to verify if they are installed properly. I could send a video but that may not help because things are different every time I start it up! Sometimes just one wheel spins when I angle the robot but other times both wheels spin and both stop when the robot is vertical.

As a bit of a Newbie I don't know how to read the debug reports. With Debug=3 the readings do change as I angle the Robot. Do you know what I should be looking for?

Darn .. I now have another problem! The arduino seems to be acting up!

Lots of fun eh!
Find all posts by this user
Quote this message in a reply
08-02-2016, 08:59 PM (This post was last modified: 08-02-2016 08:59 PM by jimmy.)
Post: #6
RE: Code errors and balance issues
Maybe a photo of your setup?
There's always a problem when starting a new project but it's part of the fun right?
Find all posts by this user
Quote this message in a reply
08-03-2016, 02:51 PM
Post: #7
RE: Code errors and balance issues
[attachment=136][attachment=136]
(08-02-2016 08:59 PM)jimmy Wrote:  Maybe a photo of your setup?
There's always a problem when starting a new project but it's part of the fun right?

Thanks. Here Is a picture. I tried uploading a video but it did not work.

When I turn the robot on the arm moves but not the wheels. However both wheels turn at high speed when I raise the robot to about 45 degrees then then stop momentarily and then reversej at about 90 degrees and stop again at about 135 degrees. However when I tilt the robot back again the wheels do not stop or reverse until the angle is about 70 degrees. It does not balance at 90 degrees l

Is motor interference a factor? I made my own cable to connect the m6050. Perhaps it's too long?


Attached File(s) Thumbnail(s)
   
Find all posts by this user
Quote this message in a reply
08-03-2016, 03:15 PM
Post: #8
RE: Code errors and balance issues
Could be several things, but... can you get some grip for the wheels? looks like they could be skidding! Try with rubber
Find all posts by this user
Quote this message in a reply
08-03-2016, 03:42 PM
Post: #9
RE: Code errors and balance issues
why there's no rubber ring on the wheels? try move the MPU6050 to somewhere else, mine has problem if I place the mpu6050 in that area. Here's the video of my BRobot with mpu6050 mounted on the top.

https://youtu.be/PYi9HeBcd48
Find all posts by this user
Quote this message in a reply
08-03-2016, 05:06 PM
Post: #10
RE: Code errors and balance issues
(08-03-2016 03:42 PM)jimmy Wrote:  why there's no rubber ring on the wheels? try move the MPU6050 to somewhere else, mine has problem if I place the mpu6050 in that area. Here's the video of my BRobot with mpu6050 mounted on the top.

https://youtu.be/PYi9HeBcd48

Thanks Jimmy - looks great.

Can you send a still photo so I can see exactly how you mounted your electronics?

Also please can you tell me where you got your wheels. I'm having a problem finding rubber rings for the ones I printed.
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)