Check out my favorite 3D printers, the K1 Max: amzn.to/3txQUC6 or if you are on a budget, the Ender-3 V3 SE: amzn.to/3FkCPus I hope you enjoyed this video and learned something new! If you'd like to support me making more content like this, please consider supporting me on Patreon: www.patreon.com/howtomechatronics
I have done a lot of soldering of small components and if you don't want to go the whole paste mask route I suggest you get some 0.35mm solder instead of the 0.56 or 0.71 which you are using, it dramatically reduces blobs and bridging. Also for soldering QFN's and SOIC's it's advisable to use a no clean gel Flux, I use Multi-core BGA flux but there are others. I also like to use a low temperature solder (~180C). as it flows much nicer and reduces risk of thermal damage if you have to do rework.
I have a hall effect encoder, IBT_2 motor driver, Arduino Uno and flysky transmitter receiver. I want to run brushed dc power window motor as servo type. how to get arduino code for this
I recommend using a switching power regulator instead of a linear one. Reason is that the voltage doesn’t have to be super precise and switching regulators don’t waste the power from converting 12 V to 5 V.
I tried using one of those small voltage changing switching pwr supply, loses notable current. Perhaps a larger pwr. supply located elsewhere would provide enough amps if you go that route.
I don't see that as a big problem here. The only notable devices using 5 V are the atmega, as5600 and the led. I asume all these components together draw less than 10 mA (atmega is 0.5 mA, as5600 is 6.5 mA). The voltage difference is 12V - 5V = 7V and 7V * 0.01 A = 70 mW of power wasted. This is nothing compared to what the motor uses.
Thank you, this is an outstanding project. I'm adding it to my build list. It looked like the servo is overshooting the position somewhat. I saw a feature you may want to consider researching and/or implementing. I think it was James Bruton who programmed the controller to half the remaining rotational distance and go there, half it again, half it again.... That would allow the servo to ramp down and stop the servo at a more precise point.
The way to solder microcontroller pins is not one by one, but add a decent amount of soldering tin basically soaking multiple legs by keeping the tin liquid, tilt the board to use the gravity and just pull the soldering iron slowly, it will attract the tin and leave just enough tin on the pins. I usually start soldering the microcontrollers to my boards and then the smaller parts. Nice project as usual! Thank you for sharing!
I just tap the board to the table so the solder falls off..thats how i managed to remove a big short when i was soldering a new nand flash for my router
I was thinking that too. It should definitely not be overshooting that much with such slow movement. The whole point of a servo like this is having fast movement with positional accuracy. Considering he's using a multiturn encoder it might even be smarter measuring the angle of the motor shaft before the gear reduction. That might add some mechanical challenges of where to place the PCB though.
@@enteente6027Measuring the motor shaft angle will make it lose the ability to measure the absolute position of the output shaft, also losing the ability to compensate for play in the gears
@@nrdesign1991no, you will still know the absolute position of the output shaft since you know the gear ratio, as he is using a multiturn encoder. Play in the gears can also not be compensated either way, because even when measuring the output shaft there's nothing the motor can do about it
Super informative video ... thank you. Personally, I'd have made a couple of changes: 1. My opinion: the 328p has been over-hyped because of the Arduino community, but by today's standards it has some issues, so I'd use something else. Being 8 bits is probably not an issue here, but it's more expensive than 32 bit alternatives, such as the CH32V003 or the ESP32-C3. Besides this, Atmel(Microchip) debuggers are 'really' expensive and the 328p is very easy to brick. Even one of the newer ATTiny chips would be a better choice. 2. I had an issue with pcbway, so I much prefer JLCPCB. They are very reliable, high quality and probably cheaper anyway. They just don't advertise as much. Otherwise, Great project ... looking forward to more.
The 328P not 'hyped' as much as it is easy to leverage a ton of available code and support. I put it in a lot of my commercial designs, not because it is amazing, but rather because it is easy. I have a lot of code ready to go so firmware dev cycles are short and the final performance is easy to predict.
One comment about your PCB: for IC connections, the pad for pin 1 should have a different shape than the pads for the other pins. Usually, pad 1 is square and the other pads are rounded.
Great video and interesting idea. One thing i would add though is two header pins that can be used as external reference inputs or endsrops for driving things like a linear axis
Thanks! Yeah, that's a good point. I've been thinking about it right now, to make an linear actuator with the same PCB. I mean, the board already has digital pins available, the SPI pins, MOSI, MISO and SCK, which are used only for burning the bootloader, so we can use those as digital inputs.
@@HowToMechatronicsIt seems you did much more than just some thinking. I really liked your design for a 3d printed linear actuator. I used to work as a test engineer for linear actuators and I probably couldn't habe done it much better myself.
Next time try knife type K type soldering head for the best results. You can solder better with these. I soldered most of the smd by hand and been doing that for over 15 years and never had a problem also temperature is important, hakko inline temperature control works best too. Cheers
Neat project. It would be interesting to pair that Hall sensor with a wireless controller like an ESP32 in case your "output" is actually physically pretty far away from the drive section.
Curious if you have tested the torque of this new servo. Are the gears PETG or PLA? Great video. Hoping you make a video creating a servo (close loop positional) BLDC 3 phase motors used in drones and hoverboards!! Seems that is what they use for a lot of robots axis these days.
When soldering SMD components, tin only a single pad and solder the device to it. Then the other pads can then be soldered while the IC is being held in the right position by the first connection. DON'T tin multiple pads, as the bumps of tin will prevent correct positioning of the device.
I wonder how easy it would be to code an auto calibration routine, where the motor spins up as fast as at it can, stops as quickly as it can, and measures the overshoot to calibrate the PID values? Have a button that you have to hold down and power the device up to run the calibration :D So many possibilities with this. Even adding an option for BLDC motors. This is a great video :D
If you plan to use this on a battery powered device, I would steer clear of linear regulators like the AMS1117, and instead opt for an equivalent switching regulator.
Thanks! Well the default center position is always the same, even after power loss because it depends on the magnet orientation. However those new center positions that we can set with the push button are not stored, they are lost with power loss. However, that can be easily solved, we can store last center position value in the EEPROM of the microcontroller.
Great project and good one for me to reference, as im doing a linear servo design at the moment. I have to ask, is the PID configured correctly? Im seeing lots of over shoot and correction happening. If the PID is configured it shouldnt over shoot?
Interesting project, please tell me the values of subrack resistors and the possibility of using a more powerful module to control the motor, for example IBT-2 or BTS 7960
What are the benefits and tradeoffs of such a project as opposed to simply buying a servo with the features you desire? Wouldn't this burn out the DC motor if you use it to rapidly swing back and forth?
This is a fun project, but I thought the AS5600 was supposed to be pretty good, within 1deg, looks like you're getting a ton of slop, 5-10deg in your position control?
Awesome stuff. I am a copier tech and there are ready to go gearboxes with DC that just need your circuit. I have made DC servos using photo interrupters but not close to 4096 accuracy. Great content! Did you use onshape for the PCB design?
on pins 5 and 6 in the ckt diag at 8:39 , won't Atmega328p require pull up resistors from drv8871 as they are signal pin? I mean i have started learning hardware for my line tracer bot, and wanted to build my own pcb, this ckt diagram looked helpful for my whole motordriver, thats why am asking.. any help is appreciated.
Odd question but could you add a how to on converting the scara robot arm into a 3d printing robot arm, I always see space x and all the big time manufactures of heavy machinery always using 3d printers that are usually arm mounted for a larger project, and I know they use direct metal printing but I would love a how to just to understand it a little better
Is there anywhere I can buy this type of board fully assembled? I've just made the same thing, using multiple parts, and find your single board solution is superior...but having to solder it is way too much effort, especially when I will probably need ~20 boards.
I have the boards I ordered from PCBway (a great company BTW) and am getting the components together. A few things though, can you provide a more complete schematic that corresponds to the component numbers on the PCB? I am having to reverse engineer the board to match all of the capacitor and resistor values with the diagram provided, and it is very time consuming and can lead to mistakes. Also, there are many components that you don't source (i.e. center select button, chip resistors with sizing, SMD electrolytic capacitor, etc.) I had to research the chip resistors and found they were 0805 resistors, which would have been nice to know beforehand, as I already had 0402's on hand and thought they would work before I received the boards. Anyway, other than that I love this project and am looking forward to working on it.
This is an engineering marvel. @howtomechatronics... question... how do you "home" this servo? Do you need an endstop? I'm asking on the continuous rotation mode. I would need to use them on a Sailboat, and a multiturn potentiometer (near ˜10 turns from end to end) is not an option (humidity environment).
I have subscribed but unable to use social media nor have a working laptop. I fixed vehicles for 40+ years and seem heater controls go from cable to all electronic. Today, for $10, I can have a 12Vdc electric motor that couples to a door. It directs air thru the heater core or around it. The dash controller is no more that a potentiometer to move from cold to warm, then hotter or full hot. I have the actuators that drive a pot using an internal gear. I am building an air distribution box for a 67 Chevy C10. You have fascinating devices but I was looking for something simple. I can scan your channels for a video but if you think of something that helps. Thank you!! DK. Retired. ASE Master tech.
Can this board be made to use potentiometers tho? I rehab robot toys and the vast majority of the motors used are DC servos but unlike hobby servos, the controller circuitry is on the often broken main board. so i have 3 potentiometer wires and 2 motor wires and rather than take apart good hobby servos and use their boards for this, i want to make a drop in replacement thats like the boards in servos. can your circuit support potentiometers rather than magnetic encoder?
good work !, i try to order pcb and the web detect a 4 layers , but is a 2 layers . where i can download the firmware? , don't see the link in description. thanks
Check out my favorite 3D printers, the K1 Max: amzn.to/3txQUC6 or if you are on a budget, the Ender-3 V3 SE: amzn.to/3FkCPus
I hope you enjoyed this video and learned something new! If you'd like to support me making more content like this, please consider supporting me on Patreon: www.patreon.com/howtomechatronics
I have done a lot of soldering of small components and if you don't want to go the whole paste mask route I suggest you get some 0.35mm solder instead of the 0.56 or 0.71 which you are using, it dramatically reduces blobs and bridging. Also for soldering QFN's and SOIC's it's advisable to use a no clean gel Flux, I use Multi-core BGA flux but there are others.
I also like to use a low temperature solder (~180C). as it flows much nicer and reduces risk of thermal damage if you have to do rework.
I have a hall effect encoder, IBT_2 motor driver, Arduino Uno and flysky transmitter receiver. I want to run brushed dc power window motor as servo type. how to get arduino code for this
I recommend using a switching power regulator instead of a linear one. Reason is that the voltage doesn’t have to be super precise and switching regulators don’t waste the power from converting 12 V to 5 V.
I tried using one of those small voltage changing switching pwr supply, loses notable current. Perhaps a larger pwr. supply located elsewhere would provide enough amps if you go that route.
@@2150dalekwell yeah your only converting the voltage not the amprage :)
I don't see that as a big problem here. The only notable devices using 5 V are the atmega, as5600 and the led. I asume all these components together draw less than 10 mA (atmega is 0.5 mA, as5600 is 6.5 mA). The voltage difference is 12V - 5V = 7V and 7V * 0.01 A = 70 mW of power wasted. This is nothing compared to what the motor uses.
@@enteente6027 yes you are right, I didn’t see that the motor gets 12 V in the first place. Thought it gets also 5 V.
@@enteente6027 The ATmega328P will use more power than just 0.5mA.
I wish TH-cam had an option to give 5XThumb ups. You sir, certainly deserve 5X👍
Thank you, this is an outstanding project. I'm adding it to my build list. It looked like the servo is overshooting the position somewhat. I saw a feature you may want to consider researching and/or implementing. I think it was James Bruton who programmed the controller to half the remaining rotational distance and go there, half it again, half it again.... That would allow the servo to ramp down and stop the servo at a more precise point.
a PID would be better but that would take a bit more of your MCU
@@justinc2633 was gonna say that PID is good for control
You are doing a great job for the community. Thank you for these informative videos. You’re amazing
Happy to hear it, thank you!
The way to solder microcontroller pins is not one by one, but add a decent amount of soldering tin basically soaking multiple legs by keeping the tin liquid, tilt the board to use the gravity and just pull the soldering iron slowly, it will attract the tin and leave just enough tin on the pins. I usually start soldering the microcontrollers to my boards and then the smaller parts. Nice project as usual! Thank you for sharing!
I just tap the board to the table so the solder falls off..thats how i managed to remove a big short when i was soldering a new nand flash for my router
Thank you!
The PID needs work. It overshoots a lot.
I was thinking that too. It should definitely not be overshooting that much with such slow movement. The whole point of a servo like this is having fast movement with positional accuracy. Considering he's using a multiturn encoder it might even be smarter measuring the angle of the motor shaft before the gear reduction. That might add some mechanical challenges of where to place the PCB though.
@@enteente6027Measuring the motor shaft angle will make it lose the ability to measure the absolute position of the output shaft, also losing the ability to compensate for play in the gears
@@nrdesign1991no, you will still know the absolute position of the output shaft since you know the gear ratio, as he is using a multiturn encoder. Play in the gears can also not be compensated either way, because even when measuring the output shaft there's nothing the motor can do about it
Yep, that's right. I will leave that for another tutorial I guess.
Cheers! :)
Yeah, was thinking the same. Perfect shield though!
Super informative video ... thank you.
Personally, I'd have made a couple of changes:
1. My opinion: the 328p has been over-hyped because of the Arduino community, but by today's standards it has some issues, so I'd use something else. Being 8 bits is probably not an issue here, but it's more expensive than 32 bit alternatives, such as the CH32V003 or the ESP32-C3. Besides this, Atmel(Microchip) debuggers are 'really' expensive and the 328p is very easy to brick. Even one of the newer ATTiny chips would be a better choice.
2. I had an issue with pcbway, so I much prefer JLCPCB. They are very reliable, high quality and probably cheaper anyway. They just don't advertise as much.
Otherwise, Great project ... looking forward to more.
The 328P not 'hyped' as much as it is easy to leverage a ton of available code and support. I put it in a lot of my commercial designs, not because it is amazing, but rather because it is easy. I have a lot of code ready to go so firmware dev cycles are short and the final performance is easy to predict.
One comment about your PCB: for IC connections, the pad for pin 1 should have a different shape than the pads for the other pins. Usually, pad 1 is square and the other pads are rounded.
I research on this so long ago, I think u are first one get on this topic thanks alot. I waited so long.
Glad to hear it!
What's it like to actually complete a project that works? I've always wondered lol. Very nice design!! Thanks for sharing.
great project. a tip for your soldering, bring the solder in first and use it to transfer the heat to the board 😉
Thanks! I'm trying. :)
Having an option to use Encoder separately (on a daughter board) will be great addition!
Great video and interesting idea. One thing i would add though is two header pins that can be used as external reference inputs or endsrops for driving things like a linear axis
Thanks! Yeah, that's a good point.
I've been thinking about it right now, to make an linear actuator with the same PCB. I mean, the board already has digital pins available, the SPI pins, MOSI, MISO and SCK, which are used only for burning the bootloader, so we can use those as digital inputs.
@@HowToMechatronicsIt seems you did much more than just some thinking. I really liked your design for a 3d printed linear actuator. I used to work as a test engineer for linear actuators and I probably couldn't habe done it much better myself.
I like the gears. I've never seen that herringbone geometry before.
Plz make video demonstrating mpu9250 and calculating ots roll witch and yaw from accelerometer, gyroscope and magnetometer
Next time try knife type K type soldering head for the best results. You can solder better with these. I soldered most of the smd by hand and been doing that for over 15 years and never had a problem also temperature is important, hakko inline temperature control works best too. Cheers
Very nice project. I will try out but only issue is that i lack 3d print design.
Cheers !!
What tool was used to make the circuit diagram? It’s very nice!
Neat project. It would be interesting to pair that Hall sensor with a wireless controller like an ESP32 in case your "output" is actually physically pretty far away from the drive section.
As always another high quality work. Thank You. I hope you will make a self balancing bicycle with reaction wheel one day.
Thank you!
Ingenious. I have a need for something like this.....soon as I finish your RC transmitter project, that is.
Thank you!
Why haven't you tuned the PID loop?
You have either too much I or not enough D.
Nice project, thanks for sharing!
Already spent too much time making this project, so I left that for those who will build this project. Cheers :)
Very nice presentation! For future servo discussions, can you indicate the torque you were able to achieve with the home build?
Great work, wanted to build this for a while, saved me a lot of time
Great to hear!
Curious if you have tested the torque of this new servo. Are the gears PETG or PLA? Great video. Hoping you make a video creating a servo (close loop positional) BLDC 3 phase motors used in drones and hoverboards!! Seems that is what they use for a lot of robots axis these days.
Great video as always! You are my inspiration, man.
What an amazing video! Are you planning to use this custom servo in another project?
Terrific job! Outstanding description....thanks for sharing your design
Glad to hear it, thank you!
When soldering SMD components, tin only a single pad and solder the device to it. Then the other pads can then be soldered while the IC is being held in the right position by the first connection. DON'T tin multiple pads, as the bumps of tin will prevent correct positioning of the device.
Excellent work!!! Thank you for your valuable information. What gear (camera, lens) do you use? I need something similar for my lectures.
That's a superb video, great job ! I was wondering how do you make your schematics ?
Thank you! I draw the schematics manually with Illustrator.
What software did you use for the circuit diagram?
It is very nicely laid out and clear!
I wonder how easy it would be to code an auto calibration routine, where the motor spins up as fast as at it can, stops as quickly as it can, and measures the overshoot to calibrate the PID values? Have a button that you have to hold down and power the device up to run the calibration :D
So many possibilities with this. Even adding an option for BLDC motors. This is a great video :D
Yeah, there are so many possibilities. Thanks! :)
The servomotor knows it's current position at all times...
If you plan to use this on a battery powered device, I would steer clear of linear regulators like the AMS1117, and instead opt for an equivalent switching regulator.
Clean that soldering iron tip!! It will make your work much easier :)
Thanks for the iron tip tip! :)
Great job! Is the center position permanently stored even without power supply?
Thanks! Well the default center position is always the same, even after power loss because it depends on the magnet orientation. However those new center positions that we can set with the push button are not stored, they are lost with power loss. However, that can be easily solved, we can store last center position value in the EEPROM of the microcontroller.
Fantastic video! May I ask what field of engineering you went to school for or if you went to school?
Thank you! Mechatronics, of course. Cheers :)
hello, great desing, what are the barings size, for the two that you use ? HELP ASAP
Great project and good one for me to reference, as im doing a linear servo design at the moment.
I have to ask, is the PID configured correctly? Im seeing lots of over shoot and correction happening. If the PID is configured it shouldnt over shoot?
Hey, thanks!
No, the PID was not configured all the way.
Interesting project, please tell me the values of subrack resistors and the possibility of using a more powerful module to control the motor, for example IBT-2 or BTS 7960
Which program do you use to draw schematic at 8:34
Please which software do you use to draw the pcb and 3d redering.
Which software did you use to design the circuit diagram
Really amazing video ❤
What are the benefits and tradeoffs of such a project as opposed to simply buying a servo with the features you desire? Wouldn't this burn out the DC motor if you use it to rapidly swing back and forth?
very interesting project and well done.
Thank you! Cheers!
This is a fun project, but I thought the AS5600 was supposed to be pretty good, within 1deg, looks like you're getting a ton of slop, 5-10deg in your position control?
Awesome video! Consider using a lot more of "external" flux while soldering those SMD components ;)
Thanks for the input!
It's an amazin project. Thanks a lot for share your study
Glad to hear it, thanks!
Awesome stuff. I am a copier tech and there are ready to go gearboxes with DC that just need your circuit. I have made DC servos using photo interrupters but not close to 4096 accuracy. Great content! Did you use onshape for the PCB design?
I think you just need a smaller soldering iron tip and you would have no problem with these smaller components.
on pins 5 and 6 in the ckt diag at 8:39 , won't Atmega328p require pull up resistors from drv8871 as they are signal pin? I mean i have started learning hardware for my line tracer bot, and wanted to build my own pcb, this ckt diagram looked helpful for my whole motordriver, thats why am asking.. any help is appreciated.
Excellent explanation. Here, take my subscription.
Where to give the inputs of step & direction in this circuit for CNC machine
Odd question but could you add a how to on converting the scara robot arm into a 3d printing robot arm, I always see space x and all the big time manufactures of heavy machinery always using 3d printers that are usually arm mounted for a larger project, and I know they use direct metal printing but I would love a how to just to understand it a little better
Are we able to connect & control multi servo motors simultaneously with different IP address?
Very useful video, thanks
Good job friend 🤩
OMG!!! I want to do this with a Crown Vic or Chevy Malibu window/ wiper Motor.
Next upgrade - use bldc motor 💚
That would be interesting!
Is there anywhere I can buy this type of board fully assembled? I've just made the same thing, using multiple parts, and find your single board solution is superior...but having to solder it is way too much effort, especially when I will probably need ~20 boards.
Can you fit all that on a 8 pin tiny? The 5th pin can be fused for use in logic. I cant imagine youd need more than 5 pins on that 328p.
What diagram software are you using for your circuit layout that was presented?
can you show a closed loop diagram with feedback?
I have the boards I ordered from PCBway (a great company BTW) and am getting the components together. A few things though, can you provide a more complete schematic that corresponds to the component numbers on the PCB? I am having to reverse engineer the board to match all of the capacitor and resistor values with the diagram provided, and it is very time consuming and can lead to mistakes.
Also, there are many components that you don't source (i.e. center select button, chip resistors with sizing, SMD electrolytic capacitor, etc.)
I had to research the chip resistors and found they were 0805 resistors, which would have been nice to know beforehand, as I already had 0402's on hand and thought they would work before I received the boards.
Anyway, other than that I love this project and am looking forward to working on it.
Bro what is the value of c11 capacitor in the PCB board
@@gokulkrishnan2317 c11 is the 100nF capacitor that is coming off the AREF leg of the Atmega328p.
The servo in the video has quite a bit of overshoot. But that's just a matter of PID tuning
It would be cool if it were possible to use the bldc motor.
Most Impressive, Thank you
Many thanks!
Can you share project details
I have noticed you don't answer any of the questions supporter post????
This is an engineering marvel. @howtomechatronics... question... how do you "home" this servo? Do you need an endstop? I'm asking on the continuous rotation mode. I would need to use them on a Sailboat, and a multiturn potentiometer (near ˜10 turns from end to end) is not an option (humidity environment).
Thanks!
Well yeah, you need to have an end stop for homing for making use of the continuous rotation mode.
Then the PCB design is now good to go? With no problems?
What is causing the latency between the RC input and motor movement (arrow)
Awesome video!
That's pretty damn cool.
Thanks!
Thanks for the info, what drawing software do you use?
very useful, thanks
Glad to hear that!
very well done
Great work Dude :)
Why the huge overshoot? Have you seen openServo?
Getting an perfectly symmetrical magnet and mounting it perfectly over the shadt center isn't trivial.
I have subscribed but unable to use social media nor have a working laptop. I fixed vehicles for 40+ years and seem heater controls go from cable to all electronic. Today, for $10, I can have a 12Vdc electric motor that couples to a door. It directs air thru the heater core or around it. The dash controller is no more that a potentiometer to move from cold to warm, then hotter or full hot. I have the actuators that drive a pot using an internal gear. I am building an air distribution box for a 67 Chevy C10. You have fascinating devices but I was looking for something simple. I can scan your channels for a video but if you think of something that helps. Thank you!! DK. Retired. ASE Master tech.
It has some backslash ... goest to set deg, passes it, then back a little....
Impressive ! Awesome ! Great !
Thank you!
Would this drive a treadmill motor? They are 12 volts. I don't know about the amperage.
Can this board be made to use potentiometers tho? I rehab robot toys and the vast majority of the motors used are DC servos but unlike hobby servos, the controller circuitry is on the often broken main board. so i have 3 potentiometer wires and 2 motor wires and rather than take apart good hobby servos and use their boards for this, i want to make a drop in replacement thats like the boards in servos. can your circuit support potentiometers rather than magnetic encoder?
Do you sell completed units?
Can this pcb with components available
Great video
Хороший драйвер получился. Я взял ASMC- 04 драйвер и модуль AS5600, хочу заменить родной потенциометр магнитным as5600.
Шестерни каким пластиком печатали?
R4,R5 How much resistance is there?
Thanks
We need to read real time temperature on the remote control then order the motor move to adjust speed of blower by the remote control ,can you?
you may try other control methods, maybe the overshot can be avoided
Why not use a common microcontroller like ESP32?
long time no see bro..
Yeah I know
Is the code somewhere posted?
can you pleas make a proper flight controller for drone
good work !, i try to order pcb and the web detect a 4 layers , but is a 2 layers . where i can download the firmware? , don't see the link in description. thanks
Thanks! The PCB is 4 layers. The middle layers are for GND. The source code will be available in couple of days on the website article.