Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NodeMCU ESP32s #357

Open
lechfak opened this issue May 4, 2023 · 6 comments
Open

NodeMCU ESP32s #357

lechfak opened this issue May 4, 2023 · 6 comments
Labels
help wanted Extra attention is needed
Projects

Comments

@lechfak
Copy link

lechfak commented May 4, 2023

Hello.
I want to make DİY_ESP32 with NodeMCU ESP32s.
I used L298 as motor driver.

Where should I connect the CH_PWM_L1/ L2/R1/R2 and PIN_PWM_LF1/LB1... pins? I don't understand this.
When CH_PWM_L1 remains as is, all engines are running in NO_PHONE mode only. But none of them work in normal mode.

When I do the same with CH_PWM_... and PIN_PWM_.LF/LB.., only the motors on the left respond to commands.
//PWM properties
const int FREQ = 5000;
const int RES = 8;
const int CH_PWM_L1 =13;
const int CH_PWM_L2 = 12;
const int CH_PWM_R1 = 27;
const int CH_PWM_R2 = 33
const int PIN_PWM_LF1 = 13;
const int PIN_PWM_LF2 = 12;
const int PIN_PWM_LB1 = 13;
const int PIN_PWM_LB2 = 12;
const int PIN_PWM_RF1 = 27;
const int PIN_PWM_RF2 = 33;
const int PIN_PWM_RB1 = 27;
const int PIN_PWM_RB2 = 33;

What can I do?

l298-dc-step-motor-surucu-1-surucu-ve-kontrol-kartlari-glintdeer-36972-52-B
nodemcu_esp32-full

@lechfak lechfak added the help wanted Extra attention is needed label May 4, 2023
@thias15 thias15 added this to To do in OpenBot May 4, 2023
@thias15
Copy link
Collaborator

thias15 commented May 4, 2023

Please use the latest firmware. The CH_PWM can just have values 0,1,2,3. The physical GPIO pins are defined as PIN_PWM_LF1, PIN_PWM_LB1, etc. Note that LF (left front) and LB (left back) are defined as the same pin since we only have two outputs - one for the left side and the other for the right side. You should connect pins 13 and 12 to IN1 and IN2 to control the left side and pins 27 and 33 to IN3 and IN4 to control the right side.

@lechfak
Copy link
Author

lechfak commented May 4, 2023

thank you for the answer. In this case it only works in No_PHONE mode. When I do No_PHONE 0 it does not respond to commands.But the commands seem to work in the android app.

@thias15
Copy link
Collaborator

thias15 commented May 4, 2023

If it works in the No_PHONE mode, it means that the wiring is correct. It seems the issue you are facing is with the connection between robot and phone then. Did you try to send commands from the serial monitor in Arduino? Does the robot info screen work when the robot is connected?

@lechfak
Copy link
Author

lechfak commented May 5, 2023

Hi.

  1. yes. i try to send commands from the serial monitor in Arduino. wıth c255,255. but there is no change
  2. robot info screen dont work when the robot is connected
    ![WhatsApp Image 2023-05-05 at 14 41 33 (1)](https://user-images.githubuserconten
    WhatsApp Image 2023-05-05 at 14 41 33 (2)
    WhatsApp Image 2023-05-05 at 14 41 33 (3)
    WhatsApp Image 2023-05-05 at 14 41 33
    t.com/24843137/236449220-bd0543d9-e887-4c8c-8ffc-2f94f8914491.jpeg)
    capture_20230505143931292

@lechfak
Copy link
Author

lechfak commented May 9, 2023

Hi.
I was able to connect to the device using bluetooth connection.
It didn't happen with the USB cable at the same settings.
The robot info screen has seen the device.
but after working for a few seconds, the device turns itself off by giving this error:

Guru Meditation Error: Core 1 panic'ed (InstrFetchProhibited). Exception was unhandled.
Core 1 register dump:
PC : 0x00000000 PS : 0x00060130 A0 : 0x800d14e9 A1 : 0x3ffcafc0
A2 : 0x3ffc45f8 A3 : 0x00000000 A4 : 0x0000aeb4 A5 : 0x0000da80
A6 : 0x00000020 A7 : 0x3ffc90e0 A8 : 0x800d6caf A9 : 0x3ffcafa0
A10 : 0x3ffc45f8 A11 : 0x3ffba660 A12 : 0x00000005 A13 : 0x00000005
A14 : 0x00000003 A15 : 0x00060023 SAR : 0x0000000a EXCCAUSE: 0x00000014
EXCVADDR: 0x00000000 LBEG : 0x4000c28c LEND : 0x4000c296 LCOUNT : 0x00000000

ELF file SHA256: 0000000000000000

Backtrace: 0x00000000:0x3ffcafc0 0x400d14e6:0x3ffcafe0 0x400d1586:0x3ffcb000 0x400d860c:0x3ffcb020 0x400905de:0x3ffcb040

Rebooting...
ets Jun 8 2016 00:22:57

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0018,len:4
load:0x3fff001c,len:1216
ho 0 tail 12 room 4
load:0x40078000,len:10944
load:0x40080400,len:6388
entry 0x400806b4

@hardikgarg02
Copy link

hardikgarg02 commented Sep 15, 2023

Hey! @lechfak Which Android device have you used for connecting to the robot? If connecting via USB and the serial monitor is not sending commands to the robot, try using a different device for the connection.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
OpenBot
  
To do
Development

No branches or pull requests

3 participants