ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

DC Motor with Encoder and Arduino

asked 2020-12-25 02:15:18 -0500

Joesan gravatar image

I'm trying out to connect a DC motor with Arduino and ROS, but I'm not sure where to start and how to understand the idea behind the encoder. I know that there are a ton of tutorials in the internet that I can search for, but none of them offer a basic explanation of what value the encoder would offer and how to read, sketch the circuitry. Any pointers in this direction would be definitely helpful for me. Could you please help me her?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-12-25 06:31:45 -0500

duck-development gravatar image

To connect ros with arduino you use this http://wiki.ros.org/rosserial_arduino...

And for the arduino you may read this https://www.dfrobot.com/blog-585.html

On the arduino you Reead the encoder values, integrate those abs send the value to the ROS. Ros send you motor speed commands and the PID insede the arduino try to achieve the target turn speed.

edit flag offensive delete link more

Comments

I have the serial part done. I understand how that works. It is just the motor encoding logic that I need help with the circuit and with the sketch! I will read the blog article you posted.

But my question is, is there a ready to use library for this purpose?

Joesan gravatar image Joesan  ( 2020-12-25 06:52:23 -0500 )edit

The questen is what kind of encoder do you have. Simple photodiode or somethink with an I2c interface or canbus.

duck-development gravatar image duck-development  ( 2020-12-25 06:59:24 -0500 )edit
duck-development gravatar image duck-development  ( 2020-12-25 07:01:35 -0500 )edit

I just purchased this one here from Amazon

The product pages does not say what encoder it is.

Joesan gravatar image Joesan  ( 2020-12-25 07:08:57 -0500 )edit

You may use the above arduino library

duck-development gravatar image duck-development  ( 2020-12-25 07:52:52 -0500 )edit

You need also ein Motor driver

duck-development gravatar image duck-development  ( 2020-12-25 07:53:24 -0500 )edit

I have the L298N H Bride as well!

Joesan gravatar image Joesan  ( 2020-12-25 09:43:36 -0500 )edit

You may read this post because it contains everything you need

https://create.arduino.cc/projecthub/...

duck-development gravatar image duck-development  ( 2020-12-25 13:50:47 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2020-12-25 02:15:18 -0500

Seen: 970 times

Last updated: Dec 25 '20