I want to build a robot with Arduino. I have done a fair amount of research and there is lots of material on the subject. There are even entire communities dedicated to Arduino robots, which is great.
My use case is this: I have a big sheet of paper (~ 2 x 2m) and want a driving robot to draw lines on it. The lines can be straight or curved. The robot is controlled remotely but has to steer very accurately in order to draw shapes. I would like to work without sensors on the robot.
This (excellent) project by an US-based artist is really close to what I am trying to achieve: Mechanical Parts
Here is what I know so far:
Two independently motorized wheels should be enough to control the robot. I need two motors that can be controlled very precisely.
In order to make a drawing, the robot has to know its current position. If the robot has to know its position, I need a software odometer: a way to calculate the distance travelled by each of the two wheels.
For the software odometer to work, my robot needs encoders. Encoders can tell how many times a motor has turned. Here is an article with some code describing Position estimation of a wheeled bot with arduino
The whole robot construction has to be big enough to hold a pen and some kind of arm to lift and lower it.
A proportional-integral-derivative controller (PID controller) helps to draw precise curves. I think this is not a hardware part, though, but something I implement in my Arduino logic (correct?).
As I begin to understand the concepts behind robot control I need to know what to buy. Of course I checked out the robot kits available, including the official Arduino Robot. But as far as I can see they work with sensors and (probably) don't have the precision needed for my use case because they do not do the whole encoder thing (please correct me if I'm wrong).
As far as I can see I need
A base structure to hold everything together
Two wheels
Two motors
Two encoders
Something to lift and lower a pen
More stuff to control the robot remotely, which I will care about later
Can you help me choosing the right parts to get started?
I am also happy if you have general project guidance based on my project outline.
To do what you want without sensors, you will need stepper motors. As long as the motor does not skip a step you always know where it is relative to it's "home" (or reference) position . Steppers are commonly used in plotters, scanners and printers which are analogous to your project.
If you are new to all this stuff you need to make your project absolutely as simple as possible.
As @groundfungus has said, stepper motors should provide the motion and the position-keeping all in one. I think you will need to use narrow hard wheels with very thing tires to minimize slip between the wheels and the surface.
Don't bother with the complication of encoders until you are sure that you need them - i.e. after you have a project that works reasonably well but "could do better".
A small servo can be used to lift and lower the pen. I suggest the pen should be held on the paper by weight and be free to move up and down a few mm rather than being held down firmly by the servo.
It might also be a good idea to start without bothering with batteries. It shouldn't be a problem for the robot to drag a cable around if you hold the cable to minimize drag - at least for the initial testing stage. It will also allow for the Arduino code to be updated quickly.
MOST IMPORTANT the motors (whatever sort you choose) and servo need to be powered separately from the Arduino. The Arduino can't provide enough current for motors.
groundfungus:
To do what you want without sensors, you will need stepper motors.
Using a stepper motor would remove the need for wheel encoders, but with wheel encoders as proposed you could use any type of motor.
You will need to manage the acceleration of the 'bot to keep wheel slip acceptably low. Just limiting the maximum acceleration and deceleration should be sufficient. If you decide to use stepper motors, you can take advantage of the accel stepper library to manage that for you.
zoomkat:
Google any youtube are your friends. Doing some searching you should be able to find examples of code and components you described.
Thanks zoomkat. I was certain that I'd done my research, but your suggestion brought a very interesting link to my attention: MURtle Drawing Robot.
Robin2:
As @groundfungus has said, stepper motors should provide the motion and the position-keeping all in one. I think you will need to use narrow hard wheels with very thing tires to minimize slip between the wheels and the surface.
Don't bother with the complication of encoders until you are sure that you need them - i.e. after you have a project that works reasonably well but "could do better".
Ok, I might start off without encoders. But the project above (MURtle Drawing Robot) seems to use IR sensors as encoders. Can anybody confirm this?
Robin2:
MOST IMPORTANT the motors (whatever sort you choose) and servo need to be powered separately from the Arduino. The Arduino can't provide enough current for motors.
Could you elaborate how to do this? So far all I have done is hooking things up to the Arduino. Do I buy a special motor or do I need a separate board or other component that takes care of powering the motors?
Ok, I might start off without encoders. But the project above (MURtle Drawing Robot) seems to use IR sensors as encoders. Can anybody confirm this?
The below seems to indicate this. I've seen simple bot setups that used continuous rotation servos with large plastic jar lids attached for wheels. Encoder patterns were printed and attached to the wheels and the Ir distance chips used for rotation detection. A rubber band can be used around the lid to act as a thin gripping wheel tread.
The IRS01A IR Sensors are connected to 2 analog input pins of the controller board. No additional hardware like Schmitt-Triggers has been used.
Assuming you are going to start with stepper motors they need a suitable driver board. The driver board takes instructions from the Arduino and power from a power supply and sends suitable power pulses to the coils in the stepper motor. You need to match the driver and the motor.
You will probably want physically small stepper motors - perhaps something like this or this. These are bipolar stepper motors and can be driven with a stepper motor driver board (one for each motor) like this or its Pololu equivalent.
And no matter what the project in your video uses, start simple without encoders.
Stepper motors seem to be a good solution. They may miss a step here and there but overall they can be controlled quite precisely and (hopefully) eliminate the need for encoders. From what I read online it may be a good idea to get a stepper motor with a step angle of 1.8 degrees (200 steps per rotation). This will deliver a resolution of about 1mm on a wheel with 60mm diameter. A 64-step motor seems too unprecise to me (3mm resolution on a wheel with 60mm diameter). I am not sure what motor to choose exactly, though. There are different sizes, (NEMA 4, NEMA 7, NEMA 8 …). Bigger sizes seem sturdier and stronger. What motor would you choose so that two of them can move and steer a vehicle that weighs approximately 300-500g in the end (rough estimation)?
I need some way to attach the motors to my chassis, right? Can you tell me what the part is called that is needed for this? Or do the motors come with holes so I can screw them directly onto the chassis?
The stepper motors are controlled by controller boards. Some of you suggested using one board for each stepper motor, but would it not be easier to use something like this shield? It can control two stepper motors at once which means fewer parts. The shield's wiki says that to use it you need a special library. Is this a plus or a disadvantage? Here is another one but it doesn't say if you need a library: Adafruit Motor/Stepper/Servo Shield
A question about connecting the Arduino with the motor controller and the controller with the motors: What kind of cables do I buy? Is soldering needed or do I use the kind of cable that you can plug in?
I have some Nema 17 steppers and they are big and heavy - overkill for your project I suspect.
The motors that @Zoomkat referenced (which are widely available) have 64:1 gearing so that means 64 x 64 steps (3840) steps per revolution. I don't know whether they would be too slow. You could (perhaps should) add reduction gears to the small motors I suggested.
The ULN2003 boards that drive @oomkat's motors and the motor shield that you mention are much less sophisticated than (say) the Easydriver stepper driver. The Easydriver requires fewer Arduino pins and it can be powered with higher voltages while protecting the motor by limiting the current. It's very hard to know if that sophistication is needed for your project. The Easydriver (and equivalent) boards can only drive 4 or 6 wire stepper motors. Not 5-wire motors. The motors @Zoomkat refereenced are 5-wire motors as far as I know.
Beware that a shield may occupy all or most of the Arduino pins making it difficult to connect stuff that doesn't need to use the shield.
Personally, I think I would start by experimenting with the motors @Zoomkat referenced - even if you buy them elsewhere at double the price they are still relatively expendible as learning tools. If you can find 4-wire versions of them I would go for them in preference.
You can buy plastic and aluminimum angle at most decent DIY stores. Either is a convenient source of material to make fixing brackets.
I can't answer your question about soldering, but a cheap soldering iron is a very useful investment if you are tinkering with Arduinos. The only diffiult thing is being careful not to burn yourself
Robin2:
The motors that @Zoomkat referenced (which are widely available) have 64:1 gearing so that means 64 x 64 steps (3840) steps per revolution
I'm not sure I understand. Does this mean that I can control the motor so fine that in theory I can tell it to turn 1/3840 of a revolution or (360/3840 =) 0.09375 degrees? This is a very fine control.
Robin2:
You could (perhaps should) add reduction gears to the small motors I suggested.
Do you mean to turn the slow turning of the motor into a faster turning of the wheels? I am not sure about this idea because this means more hardware parts which have to be screwed at the right places to connect properly. (Still a bit shy to add complexity because I don't have experience with robots.)
Yes. I do mean very fine control (I hope I'm right) but remember there will be some backlash in the gearing.
I meant gearing to slow down the wheels as in the stepper with the gearbox but perhaps with less reduction. I'm assuming the robot will not need to move quickly.
I chose not to buy the ultra-cheap stepper motors (5-wired) but 4-wired stepper motors which can be controlled by the easydriver V 2.0 board. The reason is that apparently the easydriver provides more flexibility and can possibly be re-used in another project. Here's my shopping list, I hope the parts will work well together. I already placed the order.
As for the chassis, I think I will make a custom one based on this layout but bigger.