DC Motors: A Practical Guide  | INTRO
1:45
Пікірлер
@krishnakt1
@krishnakt1 4 күн бұрын
I am trying to control dc motor with an inbuilt hall senor. I have only 2 wires for power and ground of the motor and 2 more for hall sensor. I am bit confused how to connect and read hall pulses. For now I have conncected white to 5V and green to digital pin2. In simulink, I only get 1 as on output even when the motor is rotating. Can someone guide me?
@kenjifugimoto
@kenjifugimoto 6 күн бұрын
What software did you use for this?
@q-69sumukhms34
@q-69sumukhms34 7 күн бұрын
Can you explain why you took sampling time as 0.5ms?
@MauricioHirano-f6r
@MauricioHirano-f6r 10 күн бұрын
Magnolia Cove
@thePavuk
@thePavuk Ай бұрын
Real Ultrasonics sensors has few additional parameters 1) typical sampling frequency is 50Hz so they won't update in real time. If robot moves with speed 1m/s toward wall, it moves 2cm before update. It's even more significant during rotation. 2) ultasonic sensors has high noise. Usually +/- 2cm for cheap one with 250cm range. 3) They can have issue... Same model of US usually works on same frequency = you has to trigger sensors one by one because they interfere with each other.
@stefano8936
@stefano8936 Ай бұрын
7:20 F-Bomb dropped
@BELABEDAbdelkader-k7c
@BELABEDAbdelkader-k7c Ай бұрын
Will we see future videos of ROS and Gazebo using deep reinforcement learning?
@KhánhNguyễn-b5c3p
@KhánhNguyễn-b5c3p Ай бұрын
hi i really want to know how to i can create model 'h5'
@ChesterLotter-ik8mq
@ChesterLotter-ik8mq Ай бұрын
Is there a place to play these
@hobby_coding
@hobby_coding Ай бұрын
not yet, it's just an ai training using Deep Reinforcement Learning.
@hobby_coding
@hobby_coding Ай бұрын
Enjoyed this content ?
@buseo5936
@buseo5936 2 ай бұрын
Hello. I implemented a state feedback control using the state-space model with the provided A, B, C, and D matrices in Simulink, but I noticed that the state variables are diverging. When I checked the poles using the eig function, I found that there is a positive real number included. Why does the regulator work correctly in the Simscape model, but when I create a separate state feedback model, it produces diverging values? Also, when designing a state feedback model in Simulink, should the initial value of the integrator be set to the same value as the step input in Simscape?
@raginigupta4857
@raginigupta4857 2 ай бұрын
ROBOT.py----> import pygame import math import numpy as np def distance(point1,point2): point1 = np.array(point1) point2 = np.array(point2) return np.linalg.norm(point1- point2) class Robot: def __init__(self, startpos,width): self.m2p= 3779.52 #from meters to pixels #robot dims self.w = width self.x= startpos[0] self.y = startpos[1] self.heading =0 self.vl = 0.01*self.m2p #meters/s self.vr = 0.01*self.m2p self.maxspeed = 0.02*self.m2p self.minspeed = 0.01*self.m2p self.min_obs_dist = 100 self.count_down = 5 #seconds def avoid_obstacle(self,point_cloud,dt): closest_obs = None dist = np.inf if len(point_cloud) > 1: for point in point_cloud: if dist > distance([self.x, self.y], point): dist = distance([self.x,self.y], point) closest_obs = (point,dist) if closest_obs[1] < self.min_obs_dist and self.count_down > 0: self.count_down -= dt self.move_backward() else: #reset count down self.count_down = 5 #move forward self.move_forward() def move_backward(self): self.vr = - self.minspeed self.vl = - self.minspeed/2 def move_forward(self): self.vr = self.minspeed self.vl = self.minspeed def kinematics(self, dt): self.x += ((self.vl+self.vr)/2) * math.cos(self.heading) * dt self.y -= ((self.vl+self.vr)/2) * math.sin(self.heading) * dt self.heading += (self.vr - self.vl) / self.w * dt if self.heading>2*math.pi or self.heading<-2*math.pi: self.heading = 0 self.vr = max(min(self.maxspeed, self.vr), self.minspeed) self.vl = max(min(self.maxspeed, self.vr), self.minspeed) class Graphics: def __init__(self, dimentions, robot_img_path, map_img_path): pygame.init() #COLORS self.black = (0, 0, 0) self.white =(255, 255, 255) self.green =(0, 255, 0) self.blue =(0, 0, 255) self.red = (255, 0, 0) self.yel = (255, 255, 0) #----MAP---- #load imgs self.robot = pygame.image.load(robot_img_path) self.map_img = pygame.image.load(map_img_path) #dimentions self.height, self.width = dimentions #window settings pygame.display.set_caption("Obstacle Avoidance") self.map = pygame.display.set_mode((self.width, self.height)) self.map.blit(self.map_img, (0,0)) def draw_robot(self,x,y, heading): rotated = pygame.transform.rotozoom(self.robot, math.degrees(heading), 1) rect = rotated.get_rect(center=(x, y)) self.map.blit(rotated, rect) def draw_sensor_data(self, point_cloud): for point in point_cloud: pygame.draw.circle(self.map, self.red, point, 3, 0) class Ultrasonic: def __init__(self, sensor_range, map): self.sensor_range = sensor_range self.map_width, self.map_height = pygame.display.get_surface().get_size() self.map = map def sense_obstacles(self, x, y, heading): obstacles = [] x1, y1 = x, y start_angle = heading - self.sensor_range[1] finish_angle = heading + self.sensor_range[1] for angle in np.linspace(start_angle, finish_angle , 10, False): x2 = x1 + self.sensor_range[0] * math.cos(angle) y2 = y1 - self.sensor_range[0] * math.sin(angle) for i in range(0, 100): u = i / 100 x= int(x2 * u + x1 * (1-u )) y= int(y2 * u + y1 * (1-u )) if 0 < x < self.map_width and 0 < y < self.map_height: color = self.map.get_at((x,y)) self.map.set_at((x,y), (0, 208,255)) if (color[0], color[1], color[2]) == (0,0,0): obstacles.append([x,y]) break return obstacles main.py --> import math import pygame from ROBOT import Graphics, Robot, Ultrasonic MAP_DIMENSIONS = (600, 1200) #the environment graphics gfx = Graphics(MAP_DIMENSIONS, 'D:\college\internship\INTERNSHIP TASK\obstacle detection\images\DDR.png', 'D:\college\internship\INTERNSHIP TASK\obstacle detection\images\Obstacle.png') #the robot start = (200, 200) robot = Robot(start, 0.01*3779.52) #the sensor sensor_range = 250, math.radians(40) ultra_sonic = Ultrasonic(sensor_range, gfx.map) dt=0 last_time = pygame.time.get_ticks() running = True #simulation loop while running: for event in pygame.event.get(): if event.type == pygame.QUIT: running = False dt= (pygame.time.get_ticks()-last_time)/1000 last_time = pygame.time.get_ticks() gfx.map.blit(gfx.map_img, (0,0)) robot.kinematics(dt) gfx.draw_robot(robot.x, robot.y, robot.heading) point_cloud = ultra_sonic.sense_obstacles(robot.x, robot.y, robot.heading) robot.avoid_obstacles(point_cloud, dt) gfx.draw_sensor_data(point_cloud) pygame.display.update THANK ME LATER😌
@munadarweesh6511
@munadarweesh6511 2 ай бұрын
Thank you Sir for the video. I tried to run the code in the video install scipy version does not work
@antonwezels9403
@antonwezels9403 2 ай бұрын
Hello, are your services still available on fiverr?
@hobby_coding
@hobby_coding 2 ай бұрын
Unfortunately not, i did Fiverr to support myself during my PhD years. but now i have too much work on my hands. All i can do now is to answer your questions in the comments section.
@antonwezels9403
@antonwezels9403 2 ай бұрын
@hobby_coding But thank you very much for your valuable content, it helps me a lot. Do you have any tip on how I can apply your simulation approach in a real environment by using RP Lidar and Rasphberry Pi as a device for mapping a space?
@hobby_coding
@hobby_coding 2 ай бұрын
🔗Source Code: Rubik's Cube simulation: ko-fi.com/s/8558c6b0a0 Rubik's Cube simulation (machine learning solver) : Coming soon
@ossamadraoui9845
@ossamadraoui9845 2 ай бұрын
That's cool bro but you mispositioned the colors of the Rubik cube
@hobby_coding
@hobby_coding 2 ай бұрын
which faces ? i believe everything is correct.
@EdRlld98
@EdRlld98 2 ай бұрын
@@hobby_coding Yes they are! Impressive Mouad! Happy to see that you're finally working on that project :)
@hobby_coding
@hobby_coding 2 ай бұрын
@@EdRlld98 Thanks Edouard for introducing me to RayLib. It's really powerful and user-friendly.
@Astro_Jaw
@Astro_Jaw 2 ай бұрын
That's a really nice project and your explanation was easy to follow keep up the good work 👍
@hobby_coding
@hobby_coding 2 ай бұрын
Glad you liked it!
@syedsajjadali4220
@syedsajjadali4220 2 ай бұрын
That's cool❤
@hobby_coding
@hobby_coding 2 ай бұрын
Thanks !
@hobby_coding
@hobby_coding 2 ай бұрын
How did you like this second part Rubik's Cube simulation: ko-fi.com/s/8558c6b0a0 Rubik's Cube simulation (machine learning solver) : Coming soon
@Noone-lw6ge
@Noone-lw6ge 2 ай бұрын
I really liked this tutorial, I’m looking forward for part 2
@hobby_coding
@hobby_coding 2 ай бұрын
Glad you liked it, i'm making part 2 right now.
@dnmsgogo
@dnmsgogo 2 ай бұрын
que genio
@hobby_coding
@hobby_coding 2 ай бұрын
very much apreciated. I'm glad you enjoyed it.
@Sebastian-y4z
@Sebastian-y4z 2 ай бұрын
I just took a look into your older videos - you do have a good narrating voice, please use it instead of this annoying TTS/AI voice
@hobby_coding
@hobby_coding 2 ай бұрын
Thanks for the suggestion, i'll surely consider doing that for the rest of the series.
@mohamedfarrag3869
@mohamedfarrag3869 2 ай бұрын
Impressive as usual Thank you for sharing your work with us
@hobby_coding
@hobby_coding 2 ай бұрын
My pleasure!
@hobby_coding
@hobby_coding 2 ай бұрын
Hello i'm back 🔗Source Code: Rubik's Cube simulation: ko-fi.com/s/8558c6b0a0 Rubik's Cube simulation (machine learning solver) : Coming soon
@ankita5470
@ankita5470 3 ай бұрын
the code executed fine and the output video file was generated. but when i played the video the lanes weren't marked with green color, or highlighted in anyway. It looked same as the input video. where could i be missed something ? i followed your code line by line . please help
@renzsuarez4027
@renzsuarez4027 3 ай бұрын
can this be use in Lightbulbs?
@hobby_coding
@hobby_coding 3 ай бұрын
you need a couple more components but, yes this will work on a light bulb.
@wfpnknw32
@wfpnknw32 3 ай бұрын
interesting video although just doing a standard screen cast even if it's longer would be much more useful. I feel like i have to debug this tutorial. You add in blocks and components offscreen and use keyboard short cuts without explaining how to search for components. Also things like at 12:12 where you say it's really crucial to set a value and then cover the actual screen with a blown up screen shot of a properties window (but is it the one you're talking about, is it a bug and which one is it for), below the screenshot you can see the bottom of the actual window you're editing.. Great topic but honestly just a screen share of the whole process (sped up for bits if needed) would be much more useful. Nothing fancy just what you did is best.
@hobby_coding
@hobby_coding 3 ай бұрын
thanks for the valuable remark.
@hassansakeef5838
@hassansakeef5838 3 ай бұрын
Hello great video sir, i was wondering how do you suppose is it possible using the same model for the robot to make turns to reach a certain target rather than just move forward and backward? An idea or resource would be highly appreciated. Thank you.
@hobby_coding
@hobby_coding 3 ай бұрын
you can use another 3D robotics simulation environment like gazebo + ros.
@renzsuarez4027
@renzsuarez4027 3 ай бұрын
can i ask is this work in light bulb?
@hobby_coding
@hobby_coding 3 ай бұрын
you can use a relay to easily turn the light bulb on and off using the project presented in this video. however if you wanted to dimm the light than you'll need an AC dimmer module and a dimmable light bulb.
@khemisakram
@khemisakram 3 ай бұрын
i have a drim to be a youtuber like you keep going bro
@hobby_coding
@hobby_coding 3 ай бұрын
Thanks for encouragement. my goal was not to be a youtube, it was always to be a scientists and an educator, and youtube provided a platform for me to deliver my content to people. just make a youtube channel and share the projects that create even if they are simple, there is always people who can find your ideas useful.
@muhammadmubashir4682
@muhammadmubashir4682 4 ай бұрын
in this simulation you are just calculation vertical angle?
@hobby_coding
@hobby_coding 3 ай бұрын
i'm calculating the tilt angle with respect to the vertical axis.
@haihuynh8337
@haihuynh8337 5 ай бұрын
Is it more performant to find the intersection between (x1,y1),(x2,y2) and the four sides of the rectangle instead of splitting it to 100 points?
@hobby_coding
@hobby_coding 3 ай бұрын
yes, it could be . but you are assuming that the obstacle is a rectangle. it might not be .
@maurya_1
@maurya_1 5 ай бұрын
Great videos loving it please keep making these videos
@hobby_coding
@hobby_coding 3 ай бұрын
Thank you! Will do!
@kadaliakshay6770
@kadaliakshay6770 5 ай бұрын
hey is there any way of doing this with camera but without a LIDAR? because I've done some research and it kinda looks like it's possible...
@hobby_coding
@hobby_coding 3 ай бұрын
Yes, autonomous driving can be done with a camera. Tesla for example uses cameras, radar and ultrasonic sensors.
@kadaliakshay6770
@kadaliakshay6770 Ай бұрын
@@hobby_coding thx
@hobby_coding
@hobby_coding 5 ай бұрын
📁 source code: ko-fi.com/s/b0f376134e
@amr.a-m8350
@amr.a-m8350 5 ай бұрын
Good video .How to convert signal position of revolute to voltage to be inserted to the pid to get a force acting on prismatic
@terrybates8407
@terrybates8407 5 ай бұрын
So one good collie 👍
@hobby_coding
@hobby_coding 5 ай бұрын
Thank you
@hobby_coding
@hobby_coding 5 ай бұрын
Python Sheep Herding Simulation 🗃️ source code: ko-fi.com/s/f5c64c0476
@ShaikMohinuddin
@ShaikMohinuddin 5 ай бұрын
Hello, can you upload a video of adding a PID controller to the robot you imported from onshape. Like a walking robot.. thank you
@hobby_coding
@hobby_coding 3 ай бұрын
could be done, thanks for the idea.
@hamedshamsikhani3345
@hamedshamsikhani3345 5 ай бұрын
Thank you very much dear sir. You teach excellent but please describe more about something like 100 signals or sample time! I exactly make your model . My motor turns about 3200 rpm but the result is not acceptable.
@hobby_coding
@hobby_coding 5 ай бұрын
🗃️ source code : ko-fi.com/s/1a38e1563b
@Hanan-qz8ms
@Hanan-qz8ms 5 ай бұрын
I use rplidar c1.. when i run it apper a black window and the lidar doesn't connect or even work!😢 please help me
@hobby_coding
@hobby_coding 5 ай бұрын
🏷️ Download the files: ko-fi.com/s/716bba8384
@hobby_coding
@hobby_coding 6 ай бұрын
code: ko-fi.com/s/86d7053723
@alanperez7551
@alanperez7551 6 ай бұрын
If you did all right and still having and error try this: "File" -> "Invalidate Caches / Restart" -> "Invalidate and Restart". This restart the old cache and validates the added modules like: import pygame etc...
@ДжайгоДжай
@ДжайгоДжай 6 ай бұрын
Hello! I wrote all the code like yours, but it doesn't display, scan, or display an image.
@outer1269
@outer1269 6 ай бұрын
most part of the main.py code didnt show in the later part of the video
@antonwezels9403
@antonwezels9403 6 ай бұрын
Hey are you still on fiverr available?