UKC

Electronics home project –Servos

New Topic
This topic has been archived, and won't accept reply postings.
 goldmember 05 Jul 2016
I’m keen to learn more about electronics, I would like to make a toy which can ‘wave’. I would like to use this https://www.howesmodels.co.uk/product/Hitec%20HS-765HB%20Sail%20Arm%20Servo servo as a basis for my project (can change if required). From my school days I know I need a power source (mains or battery) and some method to control its speed. Can anyone help point me in the right direction?
 Cheese Monkey 05 Jul 2016
In reply to goldmember:

Arduino controlled stepper motor
OP goldmember 05 Jul 2016
In reply to Cheese Monkey:

Thanks CM. I really very new to this, could you pop on a link please? how do i power the set up?

cp123 05 Jul 2016
In reply to goldmember: Hi

An Arduino is a small microprocessor that is easily programmed from a PC or laptop. To buy the branded one costs about £30 but as it is all open source, there are cheaper clones on ebay for much less.

I would combine an Arduino with either a servo or a stepper motor, either would work. On ebay you can get servos very cheaply - certainly no more than £10 for a larger one which would develop plenty of torque.

Power wise the Arduino has a 12V barrel power plug, so can be powered of that or batteries. You can power it over USB but that is only 5V and ~500ma, so not that much power. The arduino website has lots of information and a quick google of Arduino waving robot/machine will most probably show up dozens of step by step designs.

Cheers

Chris
 Cheese Monkey 05 Jul 2016
In reply to goldmember:

Battery or mains adaptor. Power is important but tbh probably the least of your concern! Possible to do it without Arduino but much more involved. www.arduino.cc
 wercat 05 Jul 2016
In reply to goldmember:
It might also be worth considering the PICAXE range of controllers, programmable in a kind of BASIC - as per usual a free programming editor and compiler is provided by them. These are used a lot in education and are surprisingly powerful. The language has support for servos and the help guides (either separate or bundled with the software) have a lot of hardware interface examples. Incredibly good value and British based.

http://www.picaxe.com/


For the purists, you can always progress to Arduino or PIC assembler programming but PICAXE will get you a long way
Post edited at 12:48
 marsbar 05 Jul 2016
In reply to goldmember:
https://www.kitronik.co.uk/

Lovely people at least one climber.
 wercat 05 Jul 2016
In reply to goldmember:

Not sure you should go as far as this man:

http://www.bbc.co.uk/news/technology-36711989
OP goldmember 05 Jul 2016
In reply to wercat:

mind is now blown! not sure what i need for my project now
how can i connect my servo up to the arduino?
does the Arduino need to be programmed can't I get one with a wheel or switch to vary the speed?
12v barrel plug prefect!
 jkarran 05 Jul 2016
In reply to goldmember:
How big a toy do you want to make? That is a powerful decent quality servo. Something like this would probably be a better starting point: http://www.hobbyking.co.uk/hobbyking/store/__16269__HobbyKing_8482_HK15138_...

It'll need 5Vdc supply and a decent amount of current if it's to do any work. 4AA batteries is sufficient (4.8V NiMH/NiCd works fine), it may also run off a USB port's power supply but if it stalls (jams) you'll potentially draw too much current and damage your USB port.

To control it you need to provide a pulse width modulated signal, 0 to 5V amplitude, between 1ms and 2ms long for full +ve and -ve deflection. 1.5ms is the neutral point. 20ms pulse repetition period is normal but not critical. This is probably better than relying on my memory: https://en.wikipedia.org/wiki/Servo_control

An Arduino or similar will do the control easily and there should be plenty of libraries and examples to get you started. Alternatively you could easily build a variable-width pulse generator from a 555 timer chip (or its modern equivalent). Lots of info online about that sort of thing and in the datasheet.
jk
Post edited at 13:43
 Toerag 05 Jul 2016
In reply to goldmember:

>I would like to make a toy which can ‘wave’.
Reading between the lines it looks like you want to make a w**king machine....
In reply to goldmember:

The servo you linked is a 4.8V device (probably intended for 4 NiCd or NiMH batteries). I would guess that a nominally 5V USB PSU ought to suffice, but you need to check that it's not significantly over 5V. Ah; on closer inspection, it can operate between 4V8 and 6V0; USB PSU it is, then.

It appears to use a 50Hz input control, pulse width modulated, with pulse width between 900 and 2100us, which presumably controls the position of the arm through the 140 degree swing.

So you will need a pulse generator that can produce such a pulse, and then generate a series of varying length pulses to make the arm move backwards and forwards. The way in which the series of pulses varies in length will determine the nature of the motion; for a simple harmonic motion replicator, the pulse length would vary sinusoidally (with the fixed 900us offset).

As others have suggested, one of the little Arduino or PIC microprocessor boards should allow you to write a simple program to control and output pin to drive the servo control line. The 20ms period is handy, since most of these things will probably have an regular interrupt at that rate. You code would wait for the interrupt, then choose the next output width, set the output, set a timer running for the desired output width, turn off the output when the timer ends, and then go back to waiting for the next interrupt.
 Luke90 05 Jul 2016
In reply to goldmember:

Lots of the people who have already replied appear to be much more knowledgeable than me about these matters, so I defer to their expertise if what I'm about to suggest wouldn't actually work. However, it strikes me that you could achieve a waving motion more simply with an ordinary motor and some mechanics rather than the electrical complications of servos and micro-controllers.

Of course, learning about those electrical gubbins might be exactly what you're looking for from the project and you could certainly make a more sophisticated and flexible device that way, but if you're more mechanically inclined I think you could consider just using a motor (perhaps variable speed) with some cams and levers.
 Luke90 05 Jul 2016
In reply to goldmember:

If going down the servo route, this might provide some help or inspiration:
http://littlebits.cc/tips-tricks/fridays-tips-and-tricks-servo
In reply to Luke90:

> However, it strikes me that you could achieve a waving motion more simply with an ordinary motor and some mechanics rather than the electrical complications of servos and micro-controllers.

Yes, you certainly can. All you need is a motor, a gear reduction chain, and an offset peg on the output gear, connected to a slot in a pivoted waving arm. You'll get a sinusoidal movement of the arm.

But if you want to learn about servos, microprocessors and a bit of programming...
 markAut 05 Jul 2016
In reply to goldmember:

Loads of great advice here. This link may get you most of the way...
https://www.arduino.cc/en/Tutorial/Sweep

I love arduinos, they are easy to program (ok, there is a learning curve, but loads of tutorials and a great community) and you can do all sorts with them.

As said above, get a £4 uno clone rather than paying full wack.
csambrook 05 Jul 2016
In reply to goldmember:

+1 for the arduino.

I'm a long-time software engineer with electronics experience so I've seen a *lot* of different development platforms, microcontrollers etc. IMO the ardunio is by far the best starting point if you are new to electronics and software, it's as simple as it gets, there's masses of information (admittedly not all of it great as it's often posted by people who are themselves just starting out), the bits to support projects are easy to get, cheap and plug together very easily without (generally) too much detailed knowledge being needed. Plus it's actually really capable so if you get in to it you can build really fun things quite easily. And it's cheap so you can afford to play and not fret about breaking expensive stuff.

 balmybaldwin 05 Jul 2016
In reply to goldmember:
What are you actually trying to make?

If you want something that you can make wave on command (via a button or a twist knob) then no need for complex electronics - just get a servo tester (http://electronic-things.co.uk/product/srvtest/?gclid=CMbTv_6R3c0CFZAW0wodw... and a rx battery box for AA bats: http://www.wirelessmadness.com/etronix-rx-battery-case-with-bec-plug-et0255...

If you want something that will detect you and wave automatically or to wave at set intervals etc then an Arduino board could be used, but also consider the new BBC micro thing - if you are new it's designed for kids to learn to code.


Or if you want to make something that will follow you around (a drone or little R2D2 bot etc) then look at an Ardupilot board running ardurover software (what they use for the driverless car race across America)
Post edited at 21:22
 wercat 06 Jul 2016
In reply to Paul Phillips - UKC and UKH:

yes, it's definitely not top-roping!
 jimtitt 06 Jul 2016
In reply to Luke90:
> Lots of the people who have already replied appear to be much more knowledgeable than me about these matters, so I defer to their expertise if what I'm about to suggest wouldn't actually work. However, it strikes me that you could achieve a waving motion more simply with an ordinary motor and some mechanics rather than the electrical complications of servos and micro-controllers.

> Of course, learning about those electrical gubbins might be exactly what you're looking for from the project and you could certainly make a more sophisticated and flexible device that way, but if you're more mechanically inclined I think you could consider just using a motor (perhaps variable speed) with some cams and levers.

That£ s called a windscreen wiper motor

I´ ve actually spent the last few months working on a new bending machine with an industrial electrician with micro-switches, a programmable controller and who knows what electrical junk. Since none of it actually could cope with the rigours of life and variability in material I scrapped it all and went back to standard mechanical systems. it works now. It´ s suprising how effective a 20mm bolt as an end stop and a 10 quid blow-off valve is.
Post edited at 19:35
 Andy Johnson 06 Jul 2016
In reply to goldmember:

I'd recommend getting a copy of Making Things Move by Dustyn Roberts (https://www.amazon.co.uk/dp/B004E9SYHY - don't be put-off by the cover). It is pitched at beginners and has lots of information and projects for different types of motor (servos, steppers, etc.) among other things

 Mark Edwards 07 Jul 2016
In reply to goldmember:

OK, so I maybe dropping you in at the deep end, but if you want to learn electronics, sooner or later you are going to end up pouring through datasheets. So take a look at the L297/L298 chipsets.
I tried the Arduino route before moving onto the STM Discovery range, which I am very happy with, and have used to develop my own boards (currently upgrading a project from STM32F4xx (ARM M4) to STM32F7xx (ARM M7).
However, for simple, Python programming (or C), I would suggest you look at the Raspberry Pi and its motor control shields.

It’s easy enough to get the components from Farnell, RS, Digikey or Mouser, with a credit card, but if you want, drop me a line and I will help.

However, the windscreen wiper solution suggested above, does seem the simplest solution to your requirement.

www.st.com/resource/en/datasheet/l297.pdf

csambrook 07 Jul 2016
In reply to Mark Edwards:

"However, for simple, Python programming (or C), I would suggest you look at the Raspberry Pi and its motor control shields."

I'd definitely not recommend the Pi as a first platform. It's a massive learning curve getting (and keeping) it configured. Lots of the stuff you end up doing is not focused on the task in hand and you're just googling answers to problems then trying other people's solutions until something kind of works. This is not me having a downer on the Pi, I'm currently using one as the host for an automated test jig at work as for that it's the most appropriate tool but getting over the hurdles has been painful. As an example I spent a couple of hours today getting it on our corporate network simply because the GUI interface puts quote marks in an obscure configuration file when it shouldn't. That wasn't part of solving my real task and it wasn't interesting, it was simply a side issue I needed to solve before I could move on.

In the OP's case it sounds to me as if (s)he needs something straightforward to start with as there will already be plenty of interesting things to learn anyway.
 David Riley 08 Jul 2016
In reply to csambrook:

Tell me about it.
 wercat 08 Jul 2016
In reply to csambrook:
That was why I suggested the PICAXE. My interest is more in assembler for old eight bit microprocessors and I just don't have time as well for a longer learning curve for something else I don't need to get into- just something that was quick and easy to learn to do jobs, even if limited compared with ARDUINO and PIC assembler.

I greatly admire the way they've gone about making the basics easy to learn and some of their products are pretty powerful.
Post edited at 09:28

New Topic
This topic has been archived, and won't accept reply postings.
Loading Notifications...