X and Y related project request

Hello everyone! I have a project request. here are the details: I want a device that tells you the x and y coordinates. here is what my project is about: I am using 2 motors controlled by l298n motor driver using ESP8266 V3 CH340 that are fully controllable via WIFI (html page), I added 2 buttons one that sets the x and coordinates (stores them in a variable) and then a button that you click it that goes to the coordinates that are set in a variable. What is the device that I should use? I am glad if you can help! :smile: :heart: If you still don't understand what I mean read this: I have made a fully controllable wifi (html page) (also controlled by a mobile phone) car using 2 motors (controlled by L298N and ESP8266), I added 2 buttons that is the first button saves the position the car is in, and the other button makes the car get to the place you saved. so I need a device that gets me the x and y so it will be able to do the things I said. My electronics are: L298N motor driver and ESP8266 and of course 2 dc motors. programing app: Arduino IDE. My hardware is fully working and works smoothly!

Hello

Use stepper motors and limit switches.

what do you mean? stepper motors cant get x and y.

If you’re using a motor driver with DC motors, look into rotary encoders.

I’d recommend you redesign using stepper motors. Then you’d know exactly where they are positioned.

Stepper motors go where you tell them to go… you should always know where they are :wink:

3 Likes

Please post your code in code tags, and a complete system diagram.

Do you want to move to a known x and y position or do you want to know the the current x and y position

I want it to move to a known x and y position

They are stepper motors. You dictated the position. Where is your code?

I am using dc motors. Ill send the code.

Don't forget the code tags. You can't know the x and y position using only motors, you need positional encoder hardware.

What are code tags? Ill send the code soon cuz the device where the code is updating. I gtg ill reply soon.

Please take some time to read the forum instructions. It's all there.

It seems to be a typical XY-problem, isn´t it?

7 Likes

Please follow the advice given in the link below when posting code, in particular the section entitled 'Posting code and common code problems'

Use [color = red]code tags[/color] (the </> icon above the compose window) to make it easier to read and copy for examination

Your system does not yet have any feedback mechanism to tell the Arduino the current position. The Arduino, using DC motors on an H-Bridge motor driver like the l298n, can only control the direction and the amount of power applied. You can make the motors spin at various speeds but the Arduino hs no way to know the speed or position of the motors or anything attached to them.

You could add some kind of feedback mechanism. Perhaps a slotted wheel with an optical sensor to give a pulse as each slot goes by. That would allow you to keep track of relative position but only as long as the motors came to a complete stop before changing direction. A 'shaft encoder' or 'rotary encoder' would be slightly better as it would be able to sense changes of direction as well as motion. In both cases, to get an absolute position (X, Y coordinates) you would need some kind of 'home' position sensor like a limit switch.

Using hobby servos for absolute positioning might work if the load was very light and the area was small. They typically move about 180°.

one motor can't, but two can.
One will be move you on the X-direction, and second on the Y

1 Like

Hi, @memind

Can you please tell us your electronics, programming, arduino, hardware experience?

Thanks.. Tom.. :smiley: :+1: :coffee: :australia:

Look for an old 3D printer, you just need the rails & stuff: if the steppers work, all the better.

The frame and rails:

BIQU 3D Printer B1 SE Plus Auto Leveling 3D Printer | eBay

FOR PARTS Mini Desktop for Kids 3D Printer Intelligent Leveling 100x100x100 | eBay

Hi, @memind
Are you building a CNC type machine or a plotter?

If so Google;

arduino 2d plotter cnc

It will show you the basics of what you are trying to do.

If you use DC motors you will need encoders on your motors to keep track of their position.
If you use steppers you will not need encoders as you will be counting steps as the steppers move back and forth.

Tom... :smiley: :+1: :coffee: :australia: