electrical-pro / ESP32_Robot

ESP32 Balancing Robot
22 stars 10 forks source link

DRV8825 Solder and Motor Torque #1

Open elciomsantana opened 3 years ago

elciomsantana commented 3 years ago

I was building a robot inspired by what you were inspired by, but with your code I managed to balance it, but I couldn't control it via WIFI, as it always falls, do you think the DAC soldier on the DRV8825 could be the problem?

Currently the DAC is only on the negative, as shown in the attached photo ... image

Another point, when removing the potentiometer and soldering it to the DAC, do I also need to solder this tiny wire to the CHIP SMD? How did you do it? image

Thanks for the help, I developed a head with 1 ultrasonic sensor and 1 laser that turns 180 degrees horizontally and 120 degrees vertically, so it can move around alone.

I have esp32cam also that I intend to attach to that head in the future.

PS: The stepper motor is a NEMA17, I noticed that it is not with much torque, I use 12v, in the test I did with other libraries to control it, it was much stronger ...

electrical-pro commented 3 years ago

@elciomsantana Hi, what do you mean by "Currently the DAC is only on the negative" ? Did you connect everything according to the circuit? you need to remove the trimmer potentiometers on DVR8825 modules and connect a wire to the resistors (as shown on my circuit), without it the robot is not very stable. No, you don't need to solder a tiny wire to the CHIP SMD, I did not see any difference with it or without it. Next time add a photo, I would love to see your robot.

elciomsantana commented 3 years ago

https://user-images.githubusercontent.com/76231121/102816179-55ed8f00-43ac-11eb-9a8a-4f636d67fb22.mp4

ae3622db-5803-4893-b64a-5bfcf54684bc (1)

elciomsantana commented 3 years ago

I removed the potentiometer and connected the DAC. Thanks!

Is there a problem connecting the DRV8825 drivers to the 5.5V current instead of the 3.3V ESP32 DEV kit itself? I say in relation to the current calculation of the DAC because I am currently connecting everything in 5.5V.

Robot is standing still, I can rotate him very slowly by remote control, but if I put him to move forward or turn fast he falls. If I push it, it gets out of control and falls, you know what it could be?

The diameter of the wheel is approximately 12cm, and the height of the MPU is 50cm, I do not know if that influence.

electrical-pro commented 3 years ago

@elciomsantana On the video it seems like the only one stepper motor is working. Check the second motor, make sure it works. Is there a problem connecting the DRV8825 drivers to the 5.5V current instead of the 3.3V ESP32 DEV kit itself? Well, I did not test it with 5V. Why do you even use 5.5V for DRV8825 logic? I just don't understand it. Use 3.3V like in the original circuit, DRV8825 works fine with 3.3V.

elciomsantana commented 3 years ago

Yes, in this video I was operating with 1 stepper motor only, but this has already been solved, I had burnt a DRV8825.

I turned on 5.5v because it was simpler to connect, and the MPU works better with voltage above 3.3v with longer wires.

I will do this modification, another thing that is different in my project, is the FAULT wire that I did not connect at all, and the SLP + RST jumper are connected on the 5v as shown in the image below

image

Two StepMotors Working now:

https://user-images.githubusercontent.com/76231121/102999021-0cfe1d80-4507-11eb-9238-99e63c5bd593.mp4

No potentiometer : image

electrical-pro commented 3 years ago

@elciomsantana I think it should work with all your modification. Did you tune PID controller values for your robot?

elciomsantana commented 3 years ago

I change this values but not success image

I did all the modifications but it is still unstable when I try to use the remote control or push it ... The whole system is running with the ESP32 3.3v

image

image

electrical-pro commented 3 years ago

@elciomsantana I change this values but not success Don't change that, set it as it was before.

  1. Go to http://192.168.4.1/ Annotation 2020-12-23 194625 Change PID tuning sliders: Angle and Pos and make the robot stable. Just experiment and try to make the robot stable. (Changes here will be lost after restart).
  2. After you found good PID values save them in the sketch, to do so find these lines of code and change values accordingly:
    pidAngle.setParameters(1.2,0.57,0.19,5.8);
    pidPos.setParameters(1.1,1.85,0.72,20);
    pidSpeed.setParameters(1.8,3.6,0.65,0.6);
  3. Flash the robot to make these new values permanent