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.
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.
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.
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
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.
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
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.
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.
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.
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.
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?
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.
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
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
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
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?
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?
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?
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 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.
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.
A big problem with this design is that it needs homing every time you use it. If power is lost, you lose the home position. Even if you know the output shaft location, that isn't helpful because it is not constrained to a single turn. Commercial servos like this use a backup battery, so that the position is not lost during power off.
You need homing for the continuous rotation mode, that's right. But for the limited rotation mode, up to 360 degrees, you don't need homing. The AS5600 is like an absolute encoder. It reads the magnetic field orientation of the magnet on the output shaft.