tuenhidiy / cnc-plotter-from-dc-motors-and-optical-encoders Goto Github PK
View Code? Open in Web Editor NEWThis Arduino sketch is used to control 2 DC motors and 2 optical encoders from printer head frame by step/ direction signals.
This Arduino sketch is used to control 2 DC motors and 2 optical encoders from printer head frame by step/ direction signals.
I'm using the dual channel L298N h-bridge instead of the shield and 2 identical geared motors w/encoders. It was a pretty straightforward port since the library( https://github.com/AndreaLombardo/L298N ) initializes similarly and has similar API.
example:
directionX = FORWARD;
becomes:
directionX = L298N::FORWARD;
motorX.run(directionX);
motorY.run(directionY);
becomes:
motors.runA(directionX);
motors.runB(directionY);
The odd effect I'm getting is when I test the DEADBW_X and DEADBW_Y, which I'd defaulted both to 4.5, by using my finger to move the encoder wheel on the back of the motor and when I move the Y motor the deadband stays at ~1/2 rotation of the encoder wheel and it triggers changes in the X motor at the ends of the deadband. Moving the X motor encoder does not cause feedback on the Y motor and the deadband feels more like I'd expect. ie motor hums and hums louder as I try to move further out of the deadband.
I swapped motors and lowered the DEADBW to 2.5 and indeed on the X axis the motor resists a much smaller movement but again the Y motor has a wide deadband , half a rotation of the encoder, and when it hits the ends the X motor jumps.
Since I have identical motors I also changed the PID to identical values(those of the default X axis).
Ideas?
Hi and great work and write-up on Instructables. I was wondering if you'd looked and/or done anything like a port of your project to something like the Arduino Leonardo for single axis control instead of doing dual axis in the Arduino Mega?
I have the idea of a larger drawing bot using L298N H-bridges to drive automotive wiper motors and it just seemed like it could be streamlined and packaged differently with a single axis control handled by a small Arduino Leonado for each motor/encoder/driver unit. I also have some large geared motor units with encoders mounted on the unit and would probably be used for the prototype.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.