Post Reply 
 
Thread Rating:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ESP32 Port of B-Robot_EVO2 Code
06-24-2018, 12:01 PM (This post was last modified: 06-24-2018 01:49 PM by dasMopo.)
Post: #31
RE: ESP32 Port of B-Robot_EVO2 Code
Another interesting find:

(02-09-2018 11:58 AM)Jinhak Kim Wrote:  When the robot is powered on, it operates normally. However, when the WiFi is connected, the motor is not powered and may fall. esp32 uses Goouuu-esp32. Thank you!

This is something also happening to me.
After revising all the solder joints and before uploading a different firmware, i noticed the behaviour as already described by jinhak kim. I didn't wait too long before connecting the app, but it ran flawlessly before and didn't after -- read: without motors connected, the displayed tilt angles were okay (I turned the board around a couple of times), after connecting to the AP and starting the app, tilt instantly changed to some other value and imu died (no change if board was tilted).

- - - - -

[addendum] So I also tried using another firmware based on the commit jhmartin mentioned to have an okay i2c implementation. While this builds, it immediately crashes on the esp32, giving a cpu panic:

Code:
ets Jun  8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0x00
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0008,len:8
load:0x3fff0010,len:2036
load:0x40078000,len:9988
load:0x40080000,len:252
entry 0x40080034
E (693) wifi: misc_nvs_load 208 ret=4364
E (694) wifi: wifi_init 1299 ret=4364
/Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/freertos/./queue.c:715 (xQueueGenericSend)- assert failed!
abort() was called at PC 0x4008396b
Guru Meditation Error: Core  1 panic'ed (abort)

Backtrace: 0x40008155:0x3ffcd080 0x40007d16:0x3ffcd0a0 0x4009348c:0x3ffcd0e0 0x400f8b4c:0x3ffcd130 0x400f20bc:0x3ffcd150 0x400d2410:0x3ffcd180 0x400d241e:0x3ffcd1d0 0x400d2436:0x3ffcd200 0x400d24d2:0x3ffcd220 0x400d21cc:0x3ffcd240 0x400d1125:0x3ffcd340 0x400d11fa:0x3ffcd380 0x4010f912:0x3ffcd3a0

CPU halted.

Doesn't look as if I easily could go that way ... Sad

[addendum2:]
Another observation. I wanted to test something, so I ran the board (currently without motors connected, just to check IMU communication) for a couple of minutes while logging the serial output (so I could see it freeze or reset). It ran for about 15 minutes without any freeze nor reset.
I will now conduct further testing, successively adding more and more components and observe system's response.

[addendum3:]
With motors connected, system running from 3S LiPo battery, IMU readings look reasonable and stable (tested for a couple of minutes).
As already mentioned before, motors don't stop turning and neither slow down when the system is held up straight, but they do reverse direction if the robot is tilted (by around 15 deg from center) ... something definitively is fishy, but I doubt it's the IMU. Didn't connect the app, as I suppose that's where the IMU goes off.
[edit: I found the place in code that does this 15 degrees condition. Beyond that condition, e.g., for delta greater than 15 degrees the wheels also slow down before changing direction, just as expected. But within this approx. 30 degrees they behave strange. Investigating further.]
Find all posts by this user
Quote this message in a reply
06-24-2018, 03:53 PM (This post was last modified: 06-24-2018 04:27 PM by beowulf573.)
Post: #32
RE: ESP32 Port of B-Robot_EVO2 Code
Another data point, I just finished printing the body parts and started with just the ESP32 dev board and the imu on a breadboard. Using commit 32c028a and the corresponding libraries I see the same abort as above. When I try the master branch the code runs and Wifi connects to the app but I cannot talk to the IMU, as expected.

As I get time I'll dig in more. Thanks!


And I pulled a rookie mistake, my wiring was wrong. Currently on master it's running for about 5 minutes reading fine. I'll let it run for quite a while.
Find all posts by this user
Quote this message in a reply
06-24-2018, 05:26 PM (This post was last modified: 06-24-2018 05:26 PM by beowulf573.)
Post: #33
RE: ESP32 Port of B-Robot_EVO2 Code
I let the IMU run for about 30 minutes and all seemed well, but as soon as I connected to the WiFi host the i2c bus stopped working, so I'm seeing the exact same issue. After disconnecting the i2c reads continued to fail. With the older commit id I also see the crash at boot.

That's all the time I have for today, I'll look into again later.
Find all posts by this user
Quote this message in a reply
06-24-2018, 05:45 PM
Post: #34
RE: ESP32 Port of B-Robot_EVO2 Code
Time for me to give another update as well.
I somehow managed to finally get everything together, even put some old gt2 toothed belts around the wheels for better gip.
In this state, while not connected to the wifi / app, the robot ran fine -- I was able to play with it for approx. 30 min, pushing it around and having it response as expected.

But as soon as I connected wifi, the bot started to go mayhem, as also reported by others, most recently by beowulf573 above.
Mostly, it would instantaneously fall over on connect, sometimes I was able to control it for a couple of seconds (up to maybe 2 min), but it would always die eventually.
In this state, the tilt readings wouldn't update anymore, but from the corresponding motor sounds I have had the assumption that it still tries to react to steering inputs, i.e., imu is dead / frozen but control loop still responding.

It's a pity I'm currently not able to get a more comprehensive debug output. Maybe I'll try to run it while connected with a usb cable for serial debug.
Find all posts by this user
Quote this message in a reply
06-24-2018, 06:36 PM
Post: #35
RE: ESP32 Port of B-Robot_EVO2 Code
I was able to grab a few minutes and tried the stickbreaker-i2c branch of the Arduino code, for this it does not even connect to the IMU so not much better.
Find all posts by this user
Quote this message in a reply
06-24-2018, 07:02 PM
Post: #36
RE: ESP32 Port of B-Robot_EVO2 Code
I was actually planning to do the same (using stickbreaker's) -- did you take caution of his merge notes ? He's not providing a drop-in replacement, but rather replaces the original, polling-based i2c implementation with a queue based one. But, as for such, one would have to adapt one's own code, e.g., see stickbreaker's comment on this topic:
https://github.com/espressif/arduino-esp...-345093507
Find all posts by this user
Quote this message in a reply
06-24-2018, 07:31 PM
Post: #37
RE: ESP32 Port of B-Robot_EVO2 Code
Ah, no I didn't see that. I was rushing to test it in the 10 minutes I had free. I'll review that thread to better understand his changes later. Thanks.
Find all posts by this user
Quote this message in a reply
06-24-2018, 07:40 PM
Post: #38
RE: ESP32 Port of B-Robot_EVO2 Code
(06-24-2018 12:01 PM)dasMopo Wrote:  [addendum] So I also tried using another firmware based on the commit jhmartin mentioned to have an okay i2c implementation. While this builds, it immediately crashes on the esp32, giving a cpu panic:

Code:
ets Jun  8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0x00
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0008,len:8
load:0x3fff0010,len:2036
load:0x40078000,len:9988
load:0x40080000,len:252
entry 0x40080034
E (693) wifi: misc_nvs_load 208 ret=4364
E (694) wifi: wifi_init 1299 ret=4364
/Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/freertos/./queue.c:715 (xQueueGenericSend)- assert failed!
abort() was called at PC 0x4008396b
Guru Meditation Error: Core  1 panic'ed (abort)

Backtrace: 0x40008155:0x3ffcd080 0x40007d16:0x3ffcd0a0 0x4009348c:0x3ffcd0e0 0x400f8b4c:0x3ffcd130 0x400f20bc:0x3ffcd150 0x400d2410:0x3ffcd180 0x400d241e:0x3ffcd1d0 0x400d2436:0x3ffcd200 0x400d24d2:0x3ffcd220 0x400d21cc:0x3ffcd240 0x400d1125:0x3ffcd340 0x400d11fa:0x3ffcd380 0x4010f912:0x3ffcd3a0

CPU halted.

Did you try this one before flashing the old esp32-arduino version (sounds similar, but not exactly the same): https://github.com/espressif/arduino-esp32/issues/207

Maybe the solution mentioned, i.e.
Code:
esptool --port <YOUR_COM_PORT> erase_flash
before flashing the code binary could help in your case as well.
Please also check this out: https://github.com/espressif/arduino-esp32/issues/260

Good luck guys,
ghmartin77
Find all posts by this user
Quote this message in a reply
06-24-2018, 10:00 PM
Post: #39
RE: ESP32 Port of B-Robot_EVO2 Code
And ... tata -- it's working. Flawlessly, for roughly half an hour now, including control from the app.

Steps that eventually did the trick were:

- switching the arduino esp32 master branch to the stickbreaker-i2c staging tree (and merging it with master)

- adjusting bbot code in MPU6050.cpp, lines 226 and following:
Code:
Wire.beginTransmission(MPU6050_I2C_ADDRESS);
  n = Wire.write(start);
  if (n != 1)
    return (-10);

  n = Wire.endTransmission(true);    //! do *not* hold the I2C-bus, as in stickbreaker's this would not provide a response and fail
  if (n != 0)
    return (n);

  // Third parameter is true: relase I2C-bus after data is read.
  //! adjusted types to match stickbreaker types
  Wire.requestFrom((uint16_t) MPU6050_I2C_ADDRESS, (uint8_t) size, (bool) true);
  i = 0;
Find all posts by this user
Quote this message in a reply
06-24-2018, 11:48 PM (This post was last modified: 06-25-2018 12:02 AM by beowulf573.)
Post: #40
RE: ESP32 Port of B-Robot_EVO2 Code
Awesome, that's working for me also. Mind you, I just have the ESP32 and 6050 on a breadboard. I need to add the stepper controllers and try it out for real.

Thanks, you fixed it before I got back from running my errands.
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


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