View Full Version : BUILD LOG: Multifunction arduino robot - beginer
Radu_Andrei
19-11-2019, 09:54 PM
Hi everyone.
I've been thinking for the last half hour how to formulate this topic, and I could not come up with a decent way, as fundamentally I miss information about the name of most components, the wiring, and the programming, which I think means 99% of the project. With the hope that you are not offended and irritated by my humble 1% of knowledge (which might also be overestimated), I present my ambitious project.
One 20-25cm tall robot, with 3 main sets of functions. 1. Movement (basic 2/4 wheels system), 2. Tilt and pan head function, 3. Stepper motor control for varius applications. 4. Remote control. Please find attached my photo with my marveling pile of knowledge. Not.
26755
I did not add more components, as I don't now if I can run 4 tt geared motors, 2 servos, and 1 or 2 steppers of 1 arduino, or I need some expansion thing, or multiple arduinos.
Function number 3 is simple for someone who knows this stuff. Besides the other controls, there will be an extra joystick module for a steppers which when pressed(sideways) will act as a push button and move the stepper in 90 degrees divisions in the coresponding rotational point. 0, 90,180,270. The application of this is multiple, so I would not bother you with details. Like turning a cube on each of its 4 faces, when sited on a table and viewed sideways.
Functions 2 and 1 are for sure something you come accross all the time.
All this remote controled, by either a made from scratch remote, or a wireless ps2/3 controller, or whatever else.
The desired budget is 200 euro (221 dollars,171 pounds), but I think you are much more qualified to define the costs of such a project.
I don't even know where to start the conversation, not to mention the project.
Thank you for reading, and hope to hear from you.
Andrei
john swift
20-11-2019, 12:18 AM
Hi Andrei
just to get the ball rolling before some one how uses the arduino replies
looking at the photo it looks like it shows the Arduino nano
which has 14 Digital I/O Pins (of which 6 provide PWM output)
and 8 Analog Input Pins
many arduino kits either use 4 pins per stepper motor
via either 4 of the 7 darlinton transistors in a ULN2003 ic
( instead of all 8 in a ULN2803 I would use )
or a L298N dual "H" bridge IC that has 4 input pins and 2 enable pins
These solutions are OK if your learning to use the arduino
but a ready made stepper motor driver with just 2 inputs - step and direction
makes more sence to me as it save arduini pins - uses 2 instead of 4
and gives you control of the current through the motor coils
for low power motors have a look at the A4988 & DRV8825 used on 3d printers
how many motors do you need to control at once
radio transmitter & receiver modules are readily available
https://www.instructables.com/id/RF-315433-MHz-Transmitter-receiver-Module-and-Ardu/
John
Radu_Andrei
20-11-2019, 08:09 AM
Hi John,
I guess the remote will have 4 joystick modules. First for the 4 geared dc motors used for movement. Second for the two servos used for pan and tilt option, and third and forth for 2 steppers (described in the previous post as Function nr 3). And on and off button, and maybe some light buttons, but this are optional.
I am a bit limited by the size of the robot, which should have a base not larger than 10-12cm (4-5 inches), and no more than 25 cm in height, that is why I used a arduino nano, but anything else might work. The thing will have a wooden/plastic case on top to cover all components, and I cannot continue with the design until I figure out what and how large will be this arduino thing.
I intend to learn arduino, but I can't figure out where to start yet, and I would preffer to narrow somewhat the learning to my specific need. It seems to me right now, that in its entirety, this is a topic which requires years to master.
Thanks for the reply.
AndyUK
21-11-2019, 03:26 PM
My question is what do you want this robot to be? Something smart that can control itself, with a remote to change it's behavior, or do you want it to be always remote controlled (like a remote control car)?
In theory, if its option 2, you don't need an arduino for the movement, pan/tilt, or the remote control. The arduino is only really needed for the stepper motor control you mention. You could easily take an input from a remote control receiver to instruct the arduino and therefore the steppers. Look at remote control plane tutorials for basic analogue servo control - the pan tilt module is two of these - very simple. This (https://learn.sparkfun.com/tutorials/hobby-servo-tutorial/all) is a good tutorial from sparkfun - but look at the 'Traditional RC Application' photo - that is how simple the setup is (although it is missing a battery!). I'd then use essentially the same setup to a brushless speed controller and brushless motor for the movement.
Regards Arduino programming, the skills are the same whichever size you get. Start with a nano and try to get an LED blinking (there are lots of tutorials online). Get a cheap clone of the arduino though to save your budget for the main event - they work exactly the same. £3 on eBay should do you.
hanermo2
21-11-2019, 04:38 PM
Forget 200£.
200£ per axis is closer to the truth, if you want anything with decent accuracy, repeatability, and resolution.
And that is in materials costs, alone.
Anyone can make decent high-precision mechanicals, per axis, with any decent lathe.
But it is cheaper and easier to buy them, and they cost more than 100£/axis, and a lot more for really good ones.
Define your expected usage, payload, repeatability, speed, and resolution.
AndyUK
21-11-2019, 05:03 PM
Forget 200£.
200£ per axis is closer to the truth, if you want anything with decent accuracy, repeatability, and resolution.
And that is in materials costs, alone.
Anyone can make decent high-precision mechanicals, per axis, with any decent lathe.
But it is cheaper and easier to buy them, and they cost more than 100£/axis, and a lot more for really good ones.
Define your expected usage, payload, repeatability, speed, and resolution.
???
OP has never mentioned anything about needing high levels of accuracy strength or resolution. The requirements he has stated (simply a small remote control device able to translate, and have a pan/tilt, and drive a stepper motor or two...) are easily achievable in this budget. Think RC car budgets, not CNC.
john swift
21-11-2019, 09:16 PM
web search result for arduino joy stick shows it to have
2 potentiometers to give you analoge control of the X & Y position
and a n/o switch operated when you push the joy stick down
https://www.best-microcontroller-projects.com/arduino-joystick.html
Radu_Andrei
21-11-2019, 09:23 PM
Hi AndyUK.
Just a "always remote controlled" robot. Meanwhile I found on youtube a detailed tutorial on how to make a simple robot chassis. I'll watch the tutorials you've mentioned to figure out the pan tilt and check the RC thing.
What I could not find is function nr 3, or moving the steppers in the way I want. I've also seen keyboard modules with 4 buttons which can work as great as a joystick module. It is the same for me. Pressing button nr1 gets the steper at 0 degrees, nr 2 at 90, 3 at 180, and nr 4 at 270. 26756
I can use this function in many things (ex: furniture secret compartiments operated by a mixture of electrical and mechanical parts), but for this specific case, it is as you can see in the foto in the left side. 26757. I need to rotate parts of his heads, and might also be useful for body configurations, on 4 sides. It might be as simple as some writing on this 4 sides, but for now, I don't know exactly all the details. I just need the function done. (wiring and programming). The body and the case, I'll figure out after I find out the exact size of the electronics needed. (which does not have to be arduino, it can be anything else. If it works as intended, then I'm fine with whatever).
hanermo2.
As AndyUK said, I do not need a cnc. I already built one last year, and I spent way more than 200 whatever currency on axis. This time, I need remote control car with the appearance of a robot. A toy in fact.
Radu_Andrei
21-11-2019, 09:36 PM
john swift.
So it has 4 directions or only 2 like the RC remote/transmitter mentioned by AndyUK in the tutorial?
Radu_Andrei
21-11-2019, 09:48 PM
I think the easiest thing is to use a wireless ps3/4 controller, as it has all the buttons I need, even 4 extra, and you never know what other functions I might add.
I don't know if it is worth it, or it is cheaper to build from scratch a remote with 16 buttons (in what ever format they might be).
Doddy
21-11-2019, 10:16 PM
You haven't mentioned timescale.
A few random thoughts.
What you've described is achievable. I think some of the problems (for me, at least) are not the ones that you've identified, but more the physical manufacture, strength and weight.
You mention a height of 20-25cm, and you're clearly concerned about space for the Arduino - perhaps rightly so. You've not mentioned a diameter, or otherwise defined the complete space envelope for the robot, but I'm taking a punt at around a diameter of a similar size of 20cm. Immediately I'd share your concern, and think particularly how you intend to power this robot - onboard battery or flying lead (I guess you're looking for the former). That's likely to present the highest space requirement in the system - be honest with yourself about how long you expect the robot to operate without recharging. You're likely looking at Lipo or lead-acid (cost vs weight). That's going to limit further the available space that you have to play with.
Electronics - that's easy, once you've provisioned for it with adequate space and power :)
In honesty, if I was looking at a system like this I'd probably go federated architecture - have a motor-control Arduino (using motor drivers like John mentioned), a joystick / I/O controller etc, and get them talking over serial interface. That way you're not as compromised by I/O lines on the Arduino, and you can develop and test each subsystem separately. As Andy says - you can pick up cheap knock-off Arduino for very little cost.
Motors - find some cheap steppers, and stepper drivers - it gives you a reasonable degree of positional control without feedback systems. There are problems with keeping the motor coils energised - that impacts the longevity of the robot operation.
In all honesty - get yourself some stiff card or balsa or similar and start making a very basic model of how you envisage the robot could be constructed - with the choices of components that you have available (or, if you can be bothered, use a CAD package to just place the component into 3d space). This will help to visualise the problem space of your build. In terms of build, itself, then if you have access to a 3D printer, it's probably one very good application for this type of work to build the skeleton of the robot to bolt bits to. Buy yourself a couple of cheap nano's, a couple of joysticks, motor controllers and steppers and start playing. Learn from this, grow your self-declared 1% understanding to some level where you can start to better understand the system behaviour that you want and how to implement.
It's an interesting challenge - happy to chat further either here or PM.
Radu_Andrei
21-11-2019, 11:25 PM
Hi Doddy.
I build miniatures and film them, next to pets, as a hobby. The size of the pets forced me to go with 1:5 scale. That is why the smallest doorway has a width of 16-17cm and I need a robot body that can fit through that easily, and I would go with 12-14cm for that. The height of a door is 40cm, but in order to make the robot cute-ish, I would have him a bit more than half a door height. 26758
The structure/platform that will house all miniatures will take me until march to complete. It is designed with a thin floor and ceiling, and tested, that I can move a max 2kg object, with the help of neodynium magnets. As I film them, I need for the robot only the illusion of movement, and not necessary the actual robotics. This would be nice just to entertain the kid part of me, but it is optional, and I will easily dump it if there is not enough space.
The tilt/pan option would be great to save me from reaching in the frame each time I need him to turn his head or look up.
The most important part, which is not defined completely as design, but absolutely sure as a functioning principle, is the function3/stepper/4position thing. Even if the proportions of the robot will change very much, it will still include this in a form or other.
I would go with on board batteries, and would like him to work for apx 30 minutes per charge, if it is possible. If I give up the stearing system, I guess I'll make room for the batteries.
I said I would use steppers as the head enclosure is max 10 by 10 by 5-6 cm in heigh and I need two of them fitted in there, but 360 servos might work as well, I don't know yet. Surest way to go is to buy a few of each components I might need, as I live in a village and delivery costs quite a bit. So I would like to make one inclusive order, even if I will not use in the end some of the components. I'm talking the time so I can figure out all the possible components, the whole list and the smallest models of all things, drivers, motors etc.
The structure of the robot is fairly simple, out of hard wood, finger jointed I think. I have only a cnc, and as soon as I will get my hand on those parts and be able to measure them, I'll design the whole thing in artcam and router it. (might need a few prototypes until I get it just right).
I am not sure yet, what type of remote should I use, a play station controller or a arduino made one. From here I can start the list.
AndyUK
23-11-2019, 11:45 AM
Is the only reason you want stepper motors to position that head at 4 different places? Because if so it can be done with 360degree servos and a decent transmitter that sends a 0%, 25%, 50% etc signal. Granted, not as accurate as a stepper, but from what it sounds like you're doing more than accurate enough. I'd expect repeatability below 5 degrees. Removes any need for Arduino, and makes the electronics very very simple.
Doddy
23-11-2019, 11:48 AM
Servos are more attractive as well from the point of view of avoiding the stepped-nature of the motor spindle rotation - put any mass away from the centre of rotation and it's going to be evident on camera that the head with be bouncing around each step position. Plus the built in gearing of the servo gives obvious benefit in loading. If the radio system removes the need for the Arduino - a good thing (you can, of course, use the ardi to drive the servo as well), but if the goal is simply to have a remote radio providing the drive and head motion, then a RC solution could work well
Radu_Andrei
23-11-2019, 10:16 PM
AndyUK
Yes, it is the only reason, and I inclined toward those as they seem smaller than servos in the photos. The enclosure is 4cm tall (interior of box head), and any motor which is less than that, is welcomed. No arduino then, but I still need an 8 button (in any format, individual or 4 way joystick) remote control only for this head movement. And a couple more for the tilt/pan.
Doddy.
The goal is to have the thing done the simplest way possible, for now. I will upgrade it in the futute, if required. The simplest idea for the mechanics of the thing, is like in the photo from the previous posts, one motor up and one down, back to back, in the centre. I have a couple of steppers from a broken printer, and they are like 1.5 cm tall, which is great for this. Servoes seem tall, but if they simplify the project, I'll figure out some gearing and position them off centre.
Typing in google RC remote, I get lots of toy cars, and those classic remotes (front and back, left and right), and a few drone remotes which have lots of buttons (more like what I need). In the DIY section, there are also good ones, but to be honest I would rather buy one.
AndyUK
23-11-2019, 10:26 PM
This servo is £3 and 3cm tall. You could place them off-centre and use a gear to have two sharing the same space with one upside down to move the top and bottom of the head independently, or just one with a shaft to move both on sync.
Not sure how to know what angular range they have though...
https://hobbyking.com/en_us/hxt900-micro-servo-1-6kg-0-12sec-9g.html
Radu_Andrei
23-11-2019, 10:34 PM
They need to move independently. I'll pay happily more than that to get the metal gear ones. I guess I need at least 180 degree, so I can get 0, 90, 180 and -90. (I don't mind if it turns all the way back). Any ideea what remote control should I get?
AndyUK
23-11-2019, 11:36 PM
That would be at least 270 degrees. It seems most are 90 degree throws, you'll have to specifically look for one with enough range - you probably don't want continuous, because on those the signal is proportional to their rotational speed not their position.
I would get an FrSky Xlite, but that's because I'd use it for other things too. It would unfortunately eat up a substantial amount of the budget :( but it is an awesome little TX.
You'll need at least 6 channels, but the more the better. The Turnigy 9x has a decent reputation.
https://hobbyking.com/en_us/turnigy-9x-9ch-transmitter-w-module-8ch-receiver-mode-2-v2-firmware.html
Radu_Andrei
24-11-2019, 12:31 AM
The budget is amendable. It would be nice to stick to it, but if I'll not, that's life.
The Turnigy 9x, 8 channels goes here for 60-70 pounds plus another 10-15 for the receiver. It does not say if the batteries need to be purchased separately, but I guess so.
I found only a second hand FrSky. (I am not a fan of second hand electronics)
On amazon.co.uk there are a lot of models, up to 16 channels, around 50 pounds, for sure of inferior quality than what you have mentioned, and I also checked drones and damn, they got a lot cheaper since I last checked. But never mind, around 100 quit for a durable remote sounds good to me.
I'll wait a few days, to see if someone else has other model recommendations.
So I got an RC transmitter, batteries and a receiver. 4 servos (2 in the head, 2 in the tilt/pan neck system), and I guess some batteries on board.
What else do I need?
Radu_Andrei
01-12-2019, 06:28 PM
more details in next post. i have no ideea how to dele this one
Radu_Andrei
01-12-2019, 06:29 PM
It proved to be quite a hard thing to find a servo that goes 270 degrees. Very easy to find 360 continuous, though.
So this is the one I found, around 14 euro a piece, 4x4x2cm (which is the upper size limit for my project, but still, it is good). 26827
The only RC remote that does not break the bank, and has enough channels is this one. 26828. 10 ch and I can get at around 80 euro including the receiver, which seems a great deal.
1. rc transmitter/receiver and 270 degree servos x2 - 110 euro by now
Doing the research, I found a few extra options:
2. ps3 controller setup - pro: it does not need extra batteries, has lots of channels/buttons 26823
3. chinesse cheap remote 12 ch - pro: lots of channels for 25 quit. 26824
4. excavator toy -60 euro - pro: includes the cheap remote, and has 15 functions which mean lots of motors and gears, which I can take out of the case and reuse them for my project. no programming needed. cons: it is a toy, so I don't know how long it it gonna last 26825
5. ir remote control and steppers, and probably with a mega 2560. pro: almost everything is very cheap, so I can build as many 4 channel configurations I desire 26826
I am quite divided on this options, although the excavator thing seems the fastest way to go around, but I would like very much to hear your thoughs on this, some pros and cons.
AndyUK
02-12-2019, 04:12 PM
It proved to be quite a hard thing to find a servo that goes 270 degrees. Very easy to find 360 continuous, though.
So this is the one I found, around 14 euro a piece, 4x4x2cm (which is the upper size limit for my project, but still, it is good).
Definitely don't want a continuous servo - the voltage is then in relation to the speed, not the position.
The 300 degree option you've posted looks decent, but be aware it is a digital servo, which I believe means it wants a PWM signal in order to control it - certainly would tie in with the specifications which give min and max pulse widths.
Radu_Andrei
02-12-2019, 07:33 PM
I did not get to this part of research yet. Does this pwm signal means that I cannot plug it in directly into the flysky receiver?
AndyUK
02-12-2019, 08:12 PM
Yes and No.
Most receivers output an analogue signal, I believe it just varies in amplitude between 0V and 5V. That is great for just plugging straight into normal analogue servos.
But, you can potentially reflash the firmware on the receivers to output PWM signals.
Why would PWM be useful in this case? Much greater resolution than the analogue signal, less error in the system - if the servo can resolve down to 1us with 1000us pulses, you get 0.3 degrees per 1us, and can then control the servo to that accuracy (in theory!) - the analogue servo would need a resolution of 5mV to do the same thing.
My only experience with this is with FrSky receivers, and in that case the PWM output wasn't just on a per-channel basis, it would instead send all 8 channels in PWM through the first channel output - e.g. if Channel 1 was 100%, channel 2 was 0%, channel 3 was 75%, and the others were all 0% it would send a long frame, where the first 1000us would be on, the second 1000us would be off, then 750us on, then off for (5+0.25) 5250us. That setup is great if you want to send 8 channels worth of data to an Arduino or something, but you'd get some crazy servo behavior if you plugged straight into it.
TLDR; stick with analogue servos all around to make your life simple. Digital servos are probably better, but you're going to need to invest more time into ensuring the equipment is compatible first.
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.