Coder Social home page Coder Social logo

tuenhidiy / cnc-plotter-from-dc-motors-and-optical-encoders Goto Github PK

View Code? Open in Web Editor NEW
8.0 2.0 7.0 18 KB

This Arduino sketch is used to control 2 DC motors and 2 optical encoders from printer head frame by step/ direction signals.

C++ 100.00%
3-axis-cnc-plotter cnc-from-dc-motor cnc-from-dc-servo-motor grbl-control-dc-motor quadrature-encoder optical-encoder cnc-plotter-from-dc-motor cnc-from-old-printer

cnc-plotter-from-dc-motors-and-optical-encoders's People

Contributors

tuenhidiy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

cnc-plotter-from-dc-motors-and-optical-encoders's Issues

ported to L298N but Y axis movement feeds back into X position

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?

Port to Arduino Leonardo per axis

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.