Sign up at ELECTRONOOBS.io: electronoobs.io/ Follow me on FACEBOOK for more: facebook.com/Electronoobs help me on Patreon: www.patreon.com/ELECTRONOOBS
@aaronramly17055 жыл бұрын
more of this type of project please
@jamesbrown999914 жыл бұрын
Hey man, your code looks like the I and D terms are 0, because you're converting/truncating a double to integer. From your site: int kp = 2, ki = 0.01, kd = 0.02;
3 жыл бұрын
MUY BUEN VIDEO AMIGO... PUEDEN VER LA MIA kzbin.info/www/bejne/jILEnq1seZV_rbs ///// kzbin.info/www/bejne/ZoCoi5yAg66JrNk
@laharl2k5 жыл бұрын
A better solution for controling brushed motors with PID is using PD + minimum value. DC motors tend to stall at low pwm values because of the friction and cogging of the motor. You set your pwm frecuency and measure the minimum pwm value you need for the motor to just start moving. Take note of the value you need so that its just before that. Then just set the P and D values accordingly and that will give you a much more responsive and linear system as you dont have I lag and will even easily do really low speeds without stalling (if it stalls, raise your minimum value) your final values shoud me [0, - 255] and the corresponding negative values. Be sure to add the case for 0 so that if wont keep it at when 0
@electronicscaos5 жыл бұрын
Old industrial drives used tacho with encoders, so the tacho allowed precise control of speed and the encoder allowed the position precision. There is old school machines with incredible precision, with DC servo motors with permanent magnets as field.
@nrdesign19914 жыл бұрын
Oooh, will definitely try that. I just finished my implementation of a PID control software, and hacked an RC servo tro try it out with. PI works wonderfully with a PC fan, but PID gave me a heck of a lot of trouble with the servo. Especially a D over 1.0 ist making everything just shake and rattle, by generally amplifying the sensor noise
@laharl2k4 жыл бұрын
@@nrdesign1991 PID doesnt work for everything, first you need to understand the system you are working with, in other words its response curve. PID assumes a linear system but friction and other physics things cause things not to be linear at all. I dont think this would apply to an rc servo as it has its own pid inside, this is mainly for motors being controled with pwn with a mosfet. As motors are inductive loads, the higher the frequency the more exponential the response so that why the minimum value, to ofset the pid to the point where the friction, cogging and exponential response stop stalling the motor. PC fans are capasitive most of the times, they usually have a capasitor at the input to filter the noise generated by the switching. You should try either making a linear aproximation or an exponential curve (pass the output of the pid to a exponential function and use the function to set the pwm) Also as with with inductive loads, lowering the frequency reduces the reactance, so the lower the frequency the more lineal the response will be, for both inductive or capasitive loads. The only downside of lowering the frequency is coil whine or vibrations, but that depends on the motor or whatever you are powering so give it a try.
@nrdesign19914 жыл бұрын
@@laharl2k 1) I hacked the servo so I'm left with the H bridge, motor and potentiometer for my own control (also the gears, naturally). I've already implemented the minimum PWM, but havent had good results yet (either too shaky control, or creep). Some of it is to blame on mechanical play of the gears, too. 2) the PC fan is a model with tach output and PWM input, so the only "capacity" is the kinetic energy of the spinning fan. It runs extremely well and comes up to the desired speed when tuned properly, even under load.
@laharl2k4 жыл бұрын
@@nrdesign1991 1) i would check the original controller's frequency and duty cycle as a reference and also check whether it had hysteresis or not. I guess they should to avoid oscilation. My guess if your fequency is too high, try something like 50-500hz 2) yeah but i bet you cant go below 20% duty cycle. I thought you were doing pwm to the power line. PWM pc fans usually follow the intel standard which says that fans should turn off below 20%. Not that it would matter a lot for a fan but if you want anything below you will have to switch the power directly, i dont think the circuitry has any problem with that, mostly for compatibility with older motherboards.
@vidyadharjogi5 жыл бұрын
I think there may be competition between electronoobs and great Scott 😂😂😂😂
@nrdesign19914 жыл бұрын
Give Homofaciens a try. He made an extensive series about servos, positional encoding and closed-loop control
@saqibsanadi56484 жыл бұрын
Or may b collaboration
@superabbasalmani60793 жыл бұрын
@@nrdesign1991 Also DroneBot Workshop He is realy the largest Teacher in such Branches since the birth of the Arduino board !
@Adi-Xplains2 жыл бұрын
There is no competition. Electronoobs is far far better than Great Scott!
@ofsanjay5 жыл бұрын
you always make quality content. Thanks for all deep detail of the project. You do proper study before making a single video. Thanks keep it up
@FernandoBS.4 жыл бұрын
Este foi o único código para arduino que funcionou perfeitamente no meu motor com encoder, parabéns!
@almosh32714 жыл бұрын
absolutely a great educational video. I've built some thing similar to this board but I use it to raise and lower my radio control plane's flaps. I did that just because I enjoy using micro controllers such as audrino. Please keep up the good work.
@MCsCreations5 жыл бұрын
Pretty interesting project, dude! Really well done! 😃
@PauloSergioDiasCarmo5 жыл бұрын
Esse é um dos vídeos mais esperados por mim pena não ter em espanhol, espero muito ver logo a CNC pronta com todos os eixos e uma versão em espanhol, patreon e like, like sempre, ótimo vídeo, like.
@PankajSharma-ch3bp4 жыл бұрын
I Can't ignore your video...so interesting nd knowledgeable 👍
@rklauco5 жыл бұрын
Btw - homing. You can measure the encoder output correlation to amount of PID output. I've made a routine which is activated if PID output is full (e.g. +127 or -127) and measures time since last encoder change. If it does not change for the specified time, the motor hit a "wall" (virtual endstop). Then I would move the axes into the opposing side and measure the number of steps taken - again employing the routine to verify if I've hit the wall. Like that you can get: a) sensorless homing b) information about the full axes range (real data, not calculated) c) verify, if the expected length is really available or your carriage has some problems Needs just a few lines of code and works like a charm ;)
@ELECTRONOOBS5 жыл бұрын
Thanks for the tips. Do you share your code somewhere? Have a good day!
@rklauco5 жыл бұрын
@@ELECTRONOOBS I think it's still available on misan's github, let me check...
@rklauco5 жыл бұрын
@@ELECTRONOOBS It's part of the attiny85 part in github.com/sanchosk/dcservo, derived from github.com/misan/dcservo
@zeffofx5 жыл бұрын
oh man, I hope to see that CNC from you a long time ago. Any chances that you might finish it?
@theshavypirate52305 жыл бұрын
Your videos are so fascinating to watch 😊 everytime i learn something interesting! Thank you for that and keep up the good work man! Love your videos
@PowerScissor5 жыл бұрын
such a great project. If only there were more hours in the day it would be so much fun to do something similar. I have so many ½ finished projects laying around just waiting for the time to get to them...I need to stop watching your videos as they are always so creative I want to add another one to list of things to try.
@BrianBoniMakes5 жыл бұрын
Nice control. It's sort of a power steering circuit. Could this be made to use "STEP" and "DIRECTION" like a commercial controller instead of the pot?
@franhdez4711 Жыл бұрын
Nice video. Animations are just awsome. Just one question. How could you design an H-brigde using high-power MOSFETs for a huge current-consuming motor?
@FCADurgeshKumar5 жыл бұрын
Awesome, amazing... Well explained Your tutorials are easily understandable.
@weirdsciencetv4999 Жыл бұрын
If your interpolator has rotational velocity output, you could use some feed forward to eliminate some of the lag.
@x87alpha14 жыл бұрын
what about using a proximity sensor on the CNC head for example, any idea if that has drawbacks/advantages?
@TheRainHarvester4 жыл бұрын
How do fast machines step 1 step at a time when their encoders define the step size? Do they just go full on, then wait for an encoder pulse, then turn off? What about inertia? (I'm currently making a 3d printer and looking for ideas.)
@electronic79795 жыл бұрын
Excellent project 👍
@themanyone4 жыл бұрын
In theory, it should be possible to (very roughly) count the rotations of a brushed DC motor by monitoring the current going through it. Granularity would depend on the number of magnetic poles, but a computer could interpolate values in between to get a fairly-accurate position. Three points define a curve...
@romualdaskuzborskis5 жыл бұрын
My question, would it not be possible to caunt steps and direction simply by reading what direction H bridge is switched to, and how many steps are taken?
@NeedToDIY4 жыл бұрын
very complex but well explained video, nice job
@relaxinglofichillmusic73822 жыл бұрын
Do you by chance have a tutorial for 3 motors?
@MichaelRHead-zv2zf3 жыл бұрын
can you please help me figure out how to change the steps in the code so it doesn't go as far when turning the pot? thank you for any help you can give
@peterciurea77714 жыл бұрын
Is there an off the shelf equivalent to the stepper controller for using a large DC or AC motor with an encoder, and if necessary a electromagnetic brake? I mean a complete boxed controller, like the ones available for Steppers in CNC kits. Connect motor, power supply and and connect dir pulse enable to the breakout. I have several large 1 to 3hp motors that come with pre attached encoders and gear box, in either DC or 3 phase.AC . I'm thinking about making a large format cnc table, and to use one of these guys for a 12 foot long Y axis. I have all the rail and timing belt stuff needed to go with this, from a automation project a friend built years ago with ISA card automation hardware. It seems someone ought to make a modern controller that could drop in next to the typical stepper controllers that all talk to a breakout board and standard software and save the trouble of doing special circuits and coding
@sammflynn67515 жыл бұрын
awesome ,thanks for the awesome video,maybe in the future we can see some more of that code and acceleration and precise control of pid?
@vidhyasagar19904 жыл бұрын
You are my GOD! Thanks for the effort and teaching!
@rahilsheikh36535 жыл бұрын
Sir can you please make a complete tutorial on controlling 3axis using g -code and pid system please You are doing great work
@padmalayarawal30915 жыл бұрын
Thanks for your awesome content. If you don't mind can u please tell which software do you use to make the animated video?😊
@ELECTRONOOBS5 жыл бұрын
After effects
@padmalayarawal30915 жыл бұрын
@@ELECTRONOOBS thank you so much once again MR. electronoobs
@ZuNunchaku2 ай бұрын
if the reason not using stepper because of "prices". ive been through this dc motor need gear for hold torque, need separate mcu to monitor the encoder in high speed, surely wearout in long use. short answer is, if the reason is price there is lot of used/second hand stepper that way cheaper than brushed with encoder and gearbox
@rahilsheikh36535 жыл бұрын
Sir but how we are going to send the g-code to the machine
@minchoivanov19614 жыл бұрын
Hello! That's great video. May I give you idea for next video? It will be nice to see PWM DC motor speed control with PID regulator. WIth soft start, stuck rotor protection, current protection function and etc.
@orange_tweleve10 ай бұрын
Printers use brushed dc motors with some sort of a long strip inside to know the precise location
@antnhebayu27464 жыл бұрын
can i use mouse mechanical scroll as encoder ??
@nomecognome97105 жыл бұрын
Actually, with trinamic stepper controllers you can detect lost steps and home the cnc and keep working, it’s not the best but it does the job. The prusa i3 has this feature
@manusholm35363 жыл бұрын
hi. i love your projects. and the way you do your code. make good explanations so that in experienced like me can follow. my question. how do i change from dc motor to stepper to make it closed loop drive. and how do i use encoder for position rather than a pot. i want to use this to drive the lead screw on my metal lathe. will be very great full if you can help and explain how the code change.
@wahidshirdel11193 жыл бұрын
Hi whats up? i was woundering about how microcontroler(arduino ) undrestand g-code which sent to it from pc . For example when i press the top arrow of my keybord in computer it goes one step toward and vice versa.
@mohamedayman32884 жыл бұрын
can you modify this to keep constant rpm ?
@vibhutigoyal7694 жыл бұрын
Is PID controller used in this project??
@noureddinebenakrim54585 жыл бұрын
Very nice as always
@shreyaskumar53665 жыл бұрын
Sir is this precise enough for a 3d printer? I dont have enough money to buy those stepper motors
@jaishankarm59205 жыл бұрын
What is meter in the right side at the time of 9:16 ? Waiting for Ur replay
@ELECTRONOOBS5 жыл бұрын
Is a power supply
@jaishankarm59205 жыл бұрын
@@ELECTRONOOBS send me the buying link of power supply
@ScienceLab7605 жыл бұрын
hi nice video, maybe later you can milling with your CNC prototype and this motor system the problem is the G code interface for vectors of images, thanks for share
@tiagotiagot5 жыл бұрын
Don't brushed motors tend to deteriorate fast if you spin them in the wrong direction too much?
@PowerScissor5 жыл бұрын
Depends on how they are manufactured. Cheap ones sometimes have directional brushes that will permanently damage the motor if reversed. Some brushes just wear in one direction, so don't like reversals after that. Some have well designed brushes that work well in either direction and don't wear abnormally from a dominant direction.
@chanelndeso1142 жыл бұрын
Req injection molding micro sir tanks
@luizbueno56613 жыл бұрын
Hi Electronoob, we are just starting now a Clay 3D printer project, I run the FabLab TU and I want the students to have access to diy printers and we’ll build them ourselves. Ideally I would like to use these encoded dc motors but i’m struggling to understand how to integrate them with Marlin and with the signals sent by , Let’s say, Ramps 1.4 (or a Treetech 32bits board) This project is going to be open source. Could you help us?
@elektrikelektronik54044 жыл бұрын
hi do you have a drawing of proteus?
@kurtnelle5 жыл бұрын
Wouldn't replacing the pot in a hobby servo with a linear potentiometer achieve more or less the same thing, but with greater accuracy? Or perhaps an LVDT?
@artbyrobot15 жыл бұрын
you'd have to not only change the potentiometer to a rotary encoder but also make the drive circuit changed to be continuous rotation modded and you'd have to remove the cog that prevents continuous rotation. You also are forced to use PWM so lose control of the switching speed of the individual mosfets so you lost speed control fine tuning and power control fine tuning.
@hardikmonga5 жыл бұрын
When is your podcast?
@cs_99x145 жыл бұрын
How did you program the arduino, so that it can read the optical sensor and watching at the same time the endstop? Would be interest cause multitasking is, i think, not possible with the arduino.
@jedandecko55855 жыл бұрын
Use interupts...
@XTronical5 жыл бұрын
As usual, excellent. A question : when reversing direction is backlash (the slack in the gears) an issue for accuracy on this? It could be allowed for in coding though.
@giovannibianchessi15785 жыл бұрын
Since he uses encoders, If he placed encodes on the screw instead of the motor, the backlash would be automatically avoided backlash.
@XTronical5 жыл бұрын
@@giovannibianchessi1578 wouldn't that reduce the resolution a lot?
@giovannibianchessi15785 жыл бұрын
@@XTronical Yes, if there is a gearbox, you are right. And those encoders, seems to me, they have few pulses per revolution. However, mine was and is only a theorical speech. But let's suppose the screw pitch is 4 mm and the encoder has 32 sectors. If we consider both fronts, rising and falling, pulses become 64. 4/64=0,0625 mm if I am not wrong. (And if the encoder has a qudrature output, giving two signals, it is possible to multiply pulses by four.) For that kind of machine and if we consider torsions, low rigidity etc. in my opinion, is not bad.
@prasadkirkire63115 жыл бұрын
Great video as always 😘😍😘
@tricksandtechs88305 жыл бұрын
Super amazing video bro 😀👍👍
@badouriaymane55485 жыл бұрын
Geart job as usual 👍👍
@boudchichemohammed90665 жыл бұрын
nice job your friend from morocco
@siddharthmali58415 жыл бұрын
Another great video✌️
@klave85115 жыл бұрын
A source of optical encoders is (was) the old roller ball mouse. Not that common anymore but you may have one left over.
@tiagotiagot5 жыл бұрын
What about the wheels on modern mice?
@rahilsheikh36535 жыл бұрын
Sir could you make a complete tutorial on how can we make a close loop cnc like this one because. I've tried using 3 different Arduino for 3 axis but if one axis is stopped the other 2 continue to make which completely distroy the design
@artbyrobot15 жыл бұрын
that's just a code issue. If one axis stops, the arduino main loop should stop all operations and send you an email or something
@luukvandenbent94535 жыл бұрын
Couldnt you use a servo motor for this? Has build in rotational encoder?
@artbyrobot15 жыл бұрын
they have a built in potentiometer that can only turn a few times which is different from a rotational encoder which can turn infinite times. So you would have to change things
@luukvandenbent94535 жыл бұрын
@@artbyrobot1 ah fair enough thanks
@mouizimran10325 жыл бұрын
Hi Andrei, I have learnt a lot from your videos. I need your suggestion. As I am an Instrumentation Engineer I was able to make one IoT product which I want to put in Market as a product and star selling it. So, I want to know can can I rely on Wemos Esp8266 boards or there any high quality and high performance esp8266 boards that I need to use for making that IoT products and selling to customers. Kindly reply in this regard. My best wishes for you always.
@prkreddy59125 жыл бұрын
How to use potentiometer as distance controller....
@BharatMohanty5 жыл бұрын
I was waiting for your video... :)
@certified-forklifter5 жыл бұрын
cool editing
@docstrench9485 жыл бұрын
Hola Electronoobs, porfa, haz este tutorial en español, ya que me interesa mucho saber del tema. Gracias
@hunkbol61545 жыл бұрын
Can we use servo motor 😇😇😇😇😇😇😇
@FixDaily5 жыл бұрын
Great video once again :)
@arvindh134 жыл бұрын
it's not working, i tried this...when i rotate the pot it starts rotating and when i rotate it a bit more it stops and if it starts again after rotating further, when i press the limit switch the motor still runs
@ayoubghallab5 жыл бұрын
great job thanks for sharing
@Amir-kz6yq5 жыл бұрын
thanks for sharing your knowledge
@thenovicesretroreview78415 жыл бұрын
Great channel
@bilalhussain40215 жыл бұрын
Bro please start making tutorials on stm8 and stm32
@MicheleHjorleifsson5 жыл бұрын
link for 3d files is broken
@maheshjawahar4 жыл бұрын
You are amazing!!
@DimitarManovski5 жыл бұрын
Great video, thanks :)
@christopherj33675 жыл бұрын
very informative. thank you.
@ThinkAny2 жыл бұрын
hi bro i want help for my project please help me
@jaishankarm59205 жыл бұрын
Super 👍
@dodman09071535005 жыл бұрын
homemade toys use stepper motors. cnc machines very rarely use stepper motors and and if, exclusively as closed loops...
@artbyrobot15 жыл бұрын
not true. all desktop cnc 3d printers us stepper motors
@dodman09071535005 жыл бұрын
@@artbyrobot1 yes. which are all toys... professional cnc equipment NEVER use open loop...
@basilstadnik13425 жыл бұрын
а как насчет удержания
@gb614erg5 жыл бұрын
Удержания позиции? Я как раз сейчас строю ЧПУ станок с DC моторами: когда мотор в уже заданной позиции, то он в режиме "торможения", если он вдруг сдвинется, то мы это увидим и вернём в ранее заданную позицию. Но это маловероятно из-за использования редукторов в таких моторах.
@basilstadnik13425 жыл бұрын
@@gb614erg спасибо
@eziosoft4 жыл бұрын
int kp = 2, ki = 0.01, kd = 0.02;
@haddad89565 жыл бұрын
❤❤
@nowheremanjk86245 жыл бұрын
used in printers
@motilalsuthar40485 жыл бұрын
How to make useless box.
@motilalsuthar40485 жыл бұрын
I am very happy that, sir you reacted on my comment. Please make a video on that topic.
@nfcradio4622 Жыл бұрын
QEI is best
@gerleimarci5 жыл бұрын
Next video: Odrive odriverobotics.com/
@sri201413 жыл бұрын
Why I see banana in some of your videos
@erick28alfaro4 жыл бұрын
good idea, but it is a toy
@tvishmaychoudhary695 жыл бұрын
First
@davey2k125 жыл бұрын
Do it with brushless lol
@jayytee80625 жыл бұрын
Your up and down tones in your voice and speech pattern is enough to give me an epileptic seizure. I learned nothing.