Search found 9 matches
- Thu Jun 25, 2020 11:17 am
- Forum: ESP32 boards
- Topic: problem with controlling servo motor, ESP32
- Replies: 1
- Views: 1527
problem with controlling servo motor, ESP32
Hello, I have a robot moving on 2 servo motors which I converted to run continuously. Now I have a problem that at the same pwm duty cycle, both motors do not run at the same speed. and the robot drifts. for example pwm_freq = 50 #Hz Motor_Stop_pwm = 76 #both motors stop at this duty cycle Motor_for...
- Mon Jun 15, 2020 11:30 am
- Forum: Programs, Libraries and Tools
- Topic: Control dc motor speed - PID controller
- Replies: 4
- Views: 7049
- Sun Jun 14, 2020 6:45 pm
- Forum: Programs, Libraries and Tools
- Topic: Control dc motor speed - PID controller
- Replies: 4
- Views: 7049
Control dc motor speed - PID controller
Hello, I am working in a robot that has 2 motors and the speed of each is not the same. So, I use fork barrier sensors to get the number of rotations of each motor, control the speed and then use it to make the robot move for specific distance. I tried PI controller (P =8, I=0.2); the error compensa...
- Sun Jun 14, 2020 3:49 pm
- Forum: Hardware Projects
- Topic: Control DC Motor-ESP32
- Replies: 3
- Views: 5354
Re: Control DC Motor-ESP32
Thank you so much for your reply! It works for me but for init of pwm pin, I had to remove Pin.OUT
Like this
Now it works fine.
Thanks again
Like this
Code: Select all
self.p_en = PWM(Pin(en), freq=self.freq, duty=self.speed)
Thanks again
- Sat Jun 13, 2020 5:38 pm
- Forum: Hardware Projects
- Topic: Control DC Motor-ESP32
- Replies: 3
- Views: 5354
Control DC Motor-ESP32
Hello, I have an esp32, 2 dc motor and L298N driver. when I run this code The motor doesn't move. from machine import Pin,PWM from time import sleep class Movement: def __init__(self,en,IN1,IN2): self.RM_ENA = Pin(en,Pin.OUT) self.RM_IN1 = Pin(IN1,Pin.OUT) self.RM_IN2 = Pin(IN2,Pin.OUT) self.RM_Spee...
- Fri Jun 12, 2020 3:54 pm
- Forum: Programs, Libraries and Tools
- Topic: Problem with interrupt handling
- Replies: 5
- Views: 3334
Re: Problem with interrupt handling
I have already got shmitt trigger. I tried it and it work very well. I don't even have to detect double trigger. I would like to deeply thank you for your help. My next step, - Since I will use these 2 fork light barrier sensors for measuring the travelled distance by the robot, I found out from oth...
- Fri Jun 12, 2020 10:46 am
- Forum: Programs, Libraries and Tools
- Topic: Problem with interrupt handling
- Replies: 5
- Views: 3334
Re: Problem with interrupt handling
well, I detected a double trigger, and lowered the esp frequency to 20MHz and get the right count. the more the frequency is, the higher the counted interrupts are. In the real program I can't use this frequency. so any suggestions? I tried to connect 5Kohm resistor to the input but nothing interest...
- Thu Jun 11, 2020 8:31 pm
- Forum: Programs, Libraries and Tools
- Topic: Problem with interrupt handling
- Replies: 5
- Views: 3334
Re: Problem with interrupt handling
Roberthh, thank you for your reply. I use 10kohm resistor on the input. I will try your suggestions and give a feedback.
- Thu Jun 11, 2020 7:01 pm
- Forum: Programs, Libraries and Tools
- Topic: Problem with interrupt handling
- Replies: 5
- Views: 3334
Problem with interrupt handling
Hello, I use fork light barrier sensor TCXT2103, 20 slots disk and ESP32 to measure the speed of the motor. When I run my code, I get a huge number of counts for 1 revolution (about 90) . I test tested the sensor with Arduino and got the right count (20) could you tell me how to solve this problem p...