Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
wheels spin in opposite directions
08-19-2019, 09:24 PM
Post: #1
wheels spin in opposite directions
I have assembled the BRobot 2 with the kit, instructions 3d parts printed by myself.

When starting it, it does the shaking after 10 seconds and I try to get it upright. While doing so, one wheel rotates in one direction, the other wheel in the opposite.

Rechecked all wires, IMU, motors, etc, all look ok. The angle measurement on the JJRobots app makes sense according to the movement of the robot.

I tried lifting it to see how wheels rotate and one of them makes sense, the other one doesn't (opposite). The inverse the rotation a little bit after passing the center point (not sure calibration is right here). If I keep rotating the robot past the center, it starts to make some serious noise in the stepper motors and keeps doing it till I turn it off.

I've got the project for my son, who done all the operations, I've mostly rechecked after him. I can go through the Arduino code as I know C++, try all the debug flags and check the serial responses, but it would be nicer or possibly quicker if somebody else encountered the same problem.

Thanks,
John
Find all posts by this user
Quote this message in a reply
08-20-2019, 02:11 PM
Post: #2
RE: wheels spin in opposite directions
I am 99% sure the motor spinning in the opposite direction has be cable connected backwards. It is the simplest explanation:
Because:
1) The stepper motor driver has been properly connected (it only can be placed with the right orientation or it will not work)
2) The cable seems to be fine as the motor is spinning
3) The only way to change the spinning rotation of the wheel is either modifying the Arduino code or connecting the motor cable to the Brain shield backwards

Even if the cable looks properly connected try this: unplug the B-robot from the battery holder and connect the cable backwards. That will fix the spinning rotation
Let me know if the problem persists!
Visit this user's website Find all posts by this user
Quote this message in a reply
08-28-2019, 08:20 PM (This post was last modified: 08-28-2019 08:46 PM by lsisoft.)
Post: #3
RE: wheels spin in opposite directions
I have changed the direction of the cables, such that both wheels start forward, thus pushing the robot up, from the lying down on the face position.

Now there is another issue, as soon as it reaches the middle position, wheels start moving in opposite directions, resulting in the robot very quickly ending up on its back.

Would a video help to debug the behaviour, or should I upload a certain debug level and try to capture the serial log?

I have tried to re-upload the code. First tried on the arduino with the shield on top, 2nd to the arduino with the shield removed. The upload fails. I can't find ways to upload here, but a part of the log is:

avrdude: Device signature = 0x1e9587 (probably m32u4)
avrdude: reading input file "/tmp/arduino_build_480435/BROBOT_EVO2.ino.hex"
avrdude: writing flash (21826 bytes):

Writing | #######################avrdude: error: programmer did not respond to command: set addr
###avrdude: error: programmer did not respond to command: set addr
avrdude: error: programmer did not respond to command: write block
***failed;
[many like this] ***failed;

***failed;
avrdude: Error: butterfly programmer uses avr_write_page() but does not
provide a cmd() method.
*** page 127 (addresses 0x0000 - 0x007f) failed to write

***failed;
[...]
avrdude: Error: butterfly programmer uses avr_write_page() but does not
provide a cmd() method.
*** page 127 (addresses 0x0080 - 0x00ff) failed to write
[...]

avrdude: Error: butterfly programmer uses avr_write_page() but does not
provide a cmd() method.
*** page 65 (addresses 0x54c2 - 0x5541) failed to write

# | 100% 1.39s

avrdude: 21826 bytes of flash written
avrdude: verifying flash memory against /tmp/arduino_build_480435/BROBOT_EVO2.ino.hex:
avrdude: load data flash data from input file /tmp/arduino_build_480435/BROBOT_EVO2.ino.hex:
avrdude: input file /tmp/arduino_build_480435/BROBOT_EVO2.ino.hex contains 21826 bytes
avrdude: reading on-chip flash data:

Reading | avrdude: error: programmer did not respond to command: set addr
avrdude: error: programmer did not respond to command: set addr[...]
avrdude: error: programmer did not respond to command: set addr
# | 100% 0.17s

avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x0000
0x0d != 0x0c
avrdude: verification error; content mismatch
avrdude: error: programmer did not respond to command: leave prog mode
avrdude: error: programmer did not respond to command: exit bootloader

avrdude done. Thank you.
Find all posts by this user
Quote this message in a reply
08-28-2019, 09:31 PM
Post: #4
RE: wheels spin in opposite directions
(08-28-2019 08:20 PM)lsisoft Wrote:  I have changed the direction of the cables, such that both wheels start forward, thus pushing the robot up, from the lying down on the face position.

Now there is another issue, as soon as it reaches the middle position, wheels start moving in opposite directions, resulting in the robot very quickly ending up on its back.

Would a video help to debug the behaviour, or should I upload a certain debug level and try to capture the serial log?

I have tried to re-upload the code. First tried on the arduino with the shield on top, 2nd to the arduino with the shield removed. The upload fails. I can't find ways to upload here, but a part of the log is:

avrdude: Device signature = 0x1e9587 (probably m32u4)
avrdude: reading input file "/tmp/arduino_build_480435/BROBOT_EVO2.ino.hex"
avrdude: writing flash (21826 bytes):

Writing | #######################avrdude: error: programmer did not respond to command: set addr
###avrdude: error: programmer did not respond to command: set addr
avrdude: error: programmer did not respond to command: write block
***failed;
[many like this] ***failed;

***failed;
avrdude: Error: butterfly programmer uses avr_write_page() but does not
provide a cmd() method.
*** page 127 (addresses 0x0000 - 0x007f) failed to write

***failed;
[...]
avrdude: Error: butterfly programmer uses avr_write_page() but does not
provide a cmd() method.
*** page 127 (addresses 0x0080 - 0x00ff) failed to write
[...]

avrdude: Error: butterfly programmer uses avr_write_page() but does not
provide a cmd() method.
*** page 65 (addresses 0x54c2 - 0x5541) failed to write

# | 100% 1.39s

avrdude: 21826 bytes of flash written
avrdude: verifying flash memory against /tmp/arduino_build_480435/BROBOT_EVO2.ino.hex:
avrdude: load data flash data from input file /tmp/arduino_build_480435/BROBOT_EVO2.ino.hex:
avrdude: input file /tmp/arduino_build_480435/BROBOT_EVO2.ino.hex contains 21826 bytes
avrdude: reading on-chip flash data:

Reading | avrdude: error: programmer did not respond to command: set addr
avrdude: error: programmer did not respond to command: set addr[...]
avrdude: error: programmer did not respond to command: set addr
# | 100% 0.17s

avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x0000
0x0d != 0x0c
avrdude: verification error; content mismatch
avrdude: error: programmer did not respond to command: leave prog mode
avrdude: error: programmer did not respond to command: exit bootloader

avrdude done. Thank you.

Please upload a video (youtube link?) And photos of your set-up please. That will help a lot to narrow down the problem
Visit this user's website Find all posts by this user
Quote this message in a reply
09-02-2019, 09:11 PM
Post: #5
RE: wheels spin in opposite directions
(08-28-2019 09:31 PM)JJrobots JP Wrote:  
(08-28-2019 08:20 PM)lsisoft Wrote:  I have changed the direction of the cables, such that both wheels start forward, thus pushing the robot up, from the lying down on the face position.

Now there is another issue, as soon as it reaches the middle position, wheels start moving in opposite directions, resulting in the robot very quickly ending up on its back.

Would a video help to debug the behaviour, or should I upload a certain debug level and try to capture the serial log?

I have tried to re-upload the code. First tried on the arduino with the shield on top, 2nd to the arduino with the shield removed. The upload fails. I can't find ways to upload here, but a part of the log is:

avrdude: Device signature = 0x1e9587 (probably m32u4)
avrdude: reading input file "/tmp/arduino_build_480435/BROBOT_EVO2.ino.hex"
avrdude: writing flash (21826 bytes):

Writing | #######################avrdude: error: programmer did not respond to command: set addr
###avrdude: error: programmer did not respond to command: set addr
avrdude: error: programmer did not respond to command: write block
***failed;
[many like this] ***failed;

***failed;
avrdude: Error: butterfly programmer uses avr_write_page() but does not
provide a cmd() method.
*** page 127 (addresses 0x0000 - 0x007f) failed to write

***failed;
[...]
avrdude: Error: butterfly programmer uses avr_write_page() but does not
provide a cmd() method.
*** page 127 (addresses 0x0080 - 0x00ff) failed to write
[...]

avrdude: Error: butterfly programmer uses avr_write_page() but does not
provide a cmd() method.
*** page 65 (addresses 0x54c2 - 0x5541) failed to write

# | 100% 1.39s

avrdude: 21826 bytes of flash written
avrdude: verifying flash memory against /tmp/arduino_build_480435/BROBOT_EVO2.ino.hex:
avrdude: load data flash data from input file /tmp/arduino_build_480435/BROBOT_EVO2.ino.hex:
avrdude: input file /tmp/arduino_build_480435/BROBOT_EVO2.ino.hex contains 21826 bytes
avrdude: reading on-chip flash data:

Reading | avrdude: error: programmer did not respond to command: set addr
avrdude: error: programmer did not respond to command: set addr[...]
avrdude: error: programmer did not respond to command: set addr
# | 100% 0.17s

avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x0000
0x0d != 0x0c
avrdude: verification error; content mismatch
avrdude: error: programmer did not respond to command: leave prog mode
avrdude: error: programmer did not respond to command: exit bootloader

avrdude done. Thank you.

Please upload a video (youtube link?) And photos of your set-up please. That will help a lot to narrow down the problem

https://www.dropbox.com/sh/l7qmkofrbsf10...FYGja?dl=0

Attached is a dropbox link which contains a number of photos and a video. There are are a few problems:
1. [less important] As per my post, it is not possible to upload anything from Arduino Studio on Ubuntu to the Arduino Leonardo board. Obviously I could try from Windows.
2. The 3d prints done on Creately CR-10S Pro are loose, the wheels and the wheel hubs are not stiff enough on the D shape of the stepper motors. Do you have a parametric model that I can modify to enlarge the outside diameter and reduce the inside diameter?
3. Test/movie:
- I have made the first set of photos with 1 stepper motor connector in reverse, but in the end the movie and the final test is with the stepper motor cable as in your assembly guide (last photos should show it like that).
- I have not printed the v2 bumpers yet, by mistake I've printed v1 bumpers
- I have tested to robot on sitting on the front and sitting on the back. I think your instructions show it working from sitting on the front, in my situation it stayed up better from sitting on the back first and lifting it by hand
- after a short period of sitting up does a pice piruette (wheels in oposite directions) and lands on the back
Find all posts by this user
Quote this message in a reply
09-02-2019, 09:42 PM
Post: #6
RE: wheels spin in opposite directions
The problem comes from the motor-cables connections. At the end of the video you can clearly see how the right and left motors are swapped and the robot, trying to keep its balance finally fall due to "positive feedback-loop" sent to the wheels. Try this:
I do not have a computer to check the photos properly but:
1) Swap motor cables (left - right) but keep the wire colors as indicated in the assembly guide! If the robot does not keep the balance swap them again.
2) If even so, the robot keeps falling, connect one of the motor connector to the Brain shield backwards and check again, proceed to swap the cable if the problem persists.
The problem is there, nowhere else. You have 4 possible "connection" combinations, so try them all
John
Find all posts by this user
Quote this message in a reply
09-03-2019, 01:31 PM (This post was last modified: 09-03-2019 01:31 PM by lsisoft.)
Post: #7
RE: wheels spin in opposite directions
(09-02-2019 09:42 PM)JohnQ Wrote:  The problem comes from the motor-cables connections. At the end of the video you can clearly see how the right and left motors are swapped and the robot, trying to keep its balance finally fall due to "positive feedback-loop" sent to the wheels. Try this:
I do not have a computer to check the photos properly but:
1) Swap motor cables (left - right) but keep the wire colors as indicated in the assembly guide! If the robot does not keep the balance swap them again.
2) If even so, the robot keeps falling, connect one of the motor connector to the Brain shield backwards and check again, proceed to swap the cable if the problem persists.
The problem is there, nowhere else. You have 4 possible "connection" combinations, so try them all
John

Have tried 4 combinations with the cables connected as in instructions and rotating them when they get int he board and 4 with the cables connected the opposite, left motor to farther connector.

Still after a while the wheels rotate in opposite directions and throw the robot on the back
Find all posts by this user
Quote this message in a reply
09-04-2019, 10:08 AM
Post: #8
RE: wheels spin in opposite directions
Hi Isisoft
Would you like us to take a look at it?
You can send the B-robot to our office in San Diego (CAL) and we will check what happened.
Is that an option?
Visit this user's website Find all posts by this user
Quote this message in a reply
09-04-2019, 10:34 AM
Post: #9
RE: wheels spin in opposite directions
(09-04-2019 10:08 AM)JJrobots JP Wrote:  Hi Isisoft
Would you like us to take a look at it?
You can send the B-robot to our office in San Diego (CAL) and we will check what happened.
Is that an option?

I am in UK, London. A bit expensive to send things to US, but I can do it.

I was also thinking, is there a logger for the status packets the robot sends that I can run on a computer? Maybe in the UDP I can figure what happens with the spinning wheels. Serial debugger with a cable won't work.
Find all posts by this user
Quote this message in a reply
09-09-2019, 03:01 PM
Post: #10
RE: wheels spin in opposite directions
(09-04-2019 10:34 AM)lsisoft Wrote:  
(09-04-2019 10:08 AM)JJrobots JP Wrote:  Hi Isisoft
Would you like us to take a look at it?
You can send the B-robot to our office in San Diego (CAL) and we will check what happened.
Is that an option?

I am in UK, London. A bit expensive to send things to US, but I can do it.

I was also thinking, is there a logger for the status packets the robot sends that I can run on a computer? Maybe in the UDP I can figure what happens with the spinning wheels. Serial debugger with a cable won't work.


There is a DEBUG MODE inside the B-robot CODE. This MODE will allow you the debug the behavior of the robot if you are having issues. Please, refer to the B-robot community if you have problems or questions.

Look at the sketch line “#define DEBUG 0″ and change the 0 to 1…8 depending on what info you want to get. Take a look to the CODE below:

#if DEBUG==8
Serial.print(throttle);
Serial.print(” “);
Serial.print(steering);
Serial.print(” “);
Serial.println(mode);
#endif

//angle_adjusted_radians = angle_adjusted*GRAD2RAD;

#if DEBUG==1
Serial.println(angle_adjusted);

#endif

//Serial.print(“\t”);
mpu.resetFIFO(); // We always reset FIFO

// We calculate the estimated robot speed:
// Estimated_Speed = angular_velocity_of_stepper_motors(combined) – angular_velocity_of_robot(angle measured by IMU)
actual_robot_speed_Old = actual_robot_speed;
actual_robot_speed = (speed_M1 + speed_M2)/2; // Positive: forward

int16_t angular_velocity = (angle_adjusted-angle_adjusted_Old)*90.0; // 90 is an empirical extracted factor to adjust for real units
int16_t estimated_speed = -actual_robot_speed_Old – angular_velocity; // We use robot_speed(t-1) or (t-2) to compensate the delay
estimated_speed_filtered = estimated_speed_filtered*0.95 + (float)estimated_speed*0.05;

#if DEBUG==2
Serial.print(” “);
Serial.println(estimated_speed_filtered);
#endif

// SPEED CONTROL: This is a PI controller.
// input:user throttle, variable: estimated robot speed, output: target robot angle to get the desired speed
//target_angle = (target_angle + speedPControl(estimated_speed_filtered,throttle,Kp_thr))/2.0; // Some filtering : Average with previous output
//target_angle = target_angle*0.3 + speedPIControl(dt,estimated_speed_filtered,throttle,Kp_thr,Ki_thr)*0.7; // Some filtering
target_angle = speedPIControl(dt,estimated_speed_filtered,throttle,Kp_thr,Ki_thr);
target_angle = constrain(target_angle,-max_target_angle,max_target_angle); // limited output

#if DEBUG==3
Serial.print(” “);
Serial.println(estimated_speed_filtered);
Serial.print(” “);
Serial.println(target_angle);
#endif

#if DEBUG==10
Serial.print(angle_adjusted);
Serial.print(” “);
Serial.println(debugVariable);
#endif

#if DEBUG==6 //BATTERY STATUS
Serial.print(“B”);
Serial.println(battery);
Serial.print(” “);
#endif
#if DEBUG==7
Serial.print(distance_sensor);
Serial.print(” A”);
Serial.println(autonomous_mode_status);
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


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