Model Boat Mayhem - Forum

Technical, Techniques, Hints, and Tips => The "Black Arts!" ( Electrics & Electronics ) => Topic started by: Norman Castle on January 07, 2016, 06:34:38 PM

Title: Gun turret rotation - servo or stepper motor?
Post by: Norman Castle on January 07, 2016, 06:34:38 PM
 I've only ever used a servo controlled by Arduino (and then only the once) and I know nothing at all about stepper motors, but might I be better off with one on the next build?   What are the pros and cons of each?
Title: Re: Gun turret rotation - servo or stepper motor?
Post by: essex2visuvesi on January 07, 2016, 09:12:40 PM
Im looking into the use of a stepper motor and arduino on my next turret


Using servos does seem to limit the amount of movement to a little under 180 degrees which in the case of my current tirpitz build was sufficient and also with the size there was not enough room


I'm planning on using one of these
http://www.hobbyking.com/hobbyking/store/__26925__Stepper_Motor_and_Driver_Board_5V.html
and a mini Arduino board
Title: Re: Gun turret rotation - servo or stepper motor?
Post by: Subculture on January 07, 2016, 09:23:00 PM
Servos can give about 270 degrees of movement if the mechanical limits are removed. The limit then becomes the feedback pot. Another way to get more movement is to gear up the servo say 1:2. That will give you plenty of movement at the expense of torque, but most servos will have more than you need anyway.
Title: Re: Gun turret rotation - servo or stepper motor?
Post by: Martin [Admin] on January 07, 2016, 10:45:45 PM
 
I've seen many turrets mounted on 'standard' servos, they look very 'jittery' after a few years.
I would recommend either using much bigger servos than you would expect, bigger servos have bigger bearings or mounting the turrets on a
proper shaft with ball-bearings and then drive the turret through belts, gears, etc.

However, CNC controlled stepper motors do look really cool!  O0

https://youtu.be/cR-YlZ9NdIA (https://youtu.be/cR-YlZ9NdIA)

Title: Re: Gun turret rotation - servo or stepper motor?
Post by: dreadnought72 on January 07, 2016, 11:27:50 PM
I'm planning on using one of these
http://www.hobbyking.com/hobbyking/store/__26925__Stepper_Motor_and_Driver_Board_5V.html (http://www.hobbyking.com/hobbyking/store/__26925__Stepper_Motor_and_Driver_Board_5V.html)


Highly recommended. The stepper is geared down - that is, you can't drive the stepper by turning the output axle - a Good Thing for turrets. These are also super-cheap. I got five for about a tenner off the 'bay. Just make sure that the Arduino you're choosing has enough outputs for the steppers.


Andy

Title: Re: Gun turret rotation - servo or stepper motor?
Post by: C-3PO on January 08, 2016, 12:01:54 AM
You could always use i2c motor controllers, you could then control loads of them using just 2 wires/pins from Arduino!
C-3PO




Title: Re: Gun turret rotation - servo or stepper motor?
Post by: derekwarner on January 08, 2016, 12:45:29 AM
Missile launchers on real war ships move with surprisingly fast motion in both train and elevation motions...when we scale this down the speed of motion is literally snap..snap... <*< bang...to the point if you blinked you miss the movement .....having said this, there is ZERO jerkiness in any movement

Gun mounts on real war ships are a different kettle of fish....older vessels say WWII and 12"  mounts were very slow and graceful in motion....having these move with lightning fast speed would look rather out of place....more modern gun mounts...say 76 mm are much faster in all motions, however far slower that the missile launchers

Stepper motors [and the associated controller's] are designed to enable fast and repeatable positional accuracy. That said, this repeatable positional accuracy is only possible if the supporting structures are robust enough to cope with the mass being accelerated and de-accelerated to the stop position

Martin is eluding to the point of robustness which is the key for smooth operation :-))

I think the jury would need to consider the cost verse's the outcome with this topic.... :o ..... Derek
Title: Re: Gun turret rotation - servo or stepper motor?
Post by: Brian60 on January 08, 2016, 02:40:11 AM
Stepper motors are designed for that purpose maybe, but that is not to say they can't travel slowly. The xy gantry on my laser can be driven at 1mm per second or in imperial terms, in 1 minute it would travel a little over 2 1/4inches.
How slow do you want to go?
Title: Re: Gun turret rotation - servo or stepper motor?
Post by: Norman Castle on January 08, 2016, 07:23:38 AM
Hmmm.  Interesting.  In my case we're talking about a very light weight turret/gun mount and a slow rotation, by which I mean something like 10° per second.  I can get by with 180°, and my first try at one actually works well enough considering with the turret mounted directly onto the servo.  It does tend to be a bit jittery/jerky though if I slow it right down.

I was just wondering whether a stepper motor might give me a smoother slow-speed rotation (assuming the turret mounting/bearing is good), and might also be cheaper than a decent standard servo.
Title: Re: Gun turret rotation - servo or stepper motor?
Post by: C-3PO on January 08, 2016, 08:49:09 AM
Check out the spec of the stepper motor you intent to use. The Hobby King one mentioned by essex2visuvesi has 64 steps of 5.625 degrees.

So movement from one step to the next will be a swift movement of 5.625 degrees and therefore possibly jerky. I'll try it later and see what happens.

Some stepper controllers allow micro stepping. Some stepper motors have a high "step" number of say 200 and combined with 1/8 microstepping you can achieve 1600 steps per revolution, which equates to about 4 revolutions per minute free running without any programmed delays.

For anybody that gets into micro stepping - I can't remember the detail but you need to investigate limiting the current to the motor as this is a one factor in achieving smooth movement.

Fascinating
C-3PO

Title: Re: Gun turret rotation - servo or stepper motor?
Post by: Norman Castle on January 08, 2016, 09:03:27 AM
D'oh ... I now realise what the limitation is i.e. the size of the step!

So how about the other alternative - a small geared dc motor?  Can I program a Uno to run a loop of various sequences of rotation direction, amount of travel and traverse speed in the same way that I can with a servo?
Title: Re: Gun turret rotation - servo or stepper motor?
Post by: C-3PO on January 08, 2016, 09:45:45 AM
Hello Norman,

Yes you could use a small DC geared motor under Arduino control. To an extent that's what the servo is!.

A shot in the dark - experiment reducing the voltage to the servo - haven't given this much thought so probably end up with egg on my face but worth a shot!

If you want to control DC motors with the Arduino then best get an Arduino shield that will allow stepper(both types) and DC etc. Google Arduino Motor Shield.

Also try Googling Arduino Robot Supplies as you will find lots of gears/pulleys/geared motors/mounts etc on these sites - an example in general

https://www.coolcomponents.co.uk/robotics/motors and then have a look at this (DC motors only but cheap) https://www.coolcomponents.co.uk/drv8835-dual-motor-driver-shield-for-arduino.html

Also www.pololu.com do some cool bits of kit
C-3PO



Title: Re: Gun turret rotation - servo or stepper motor?
Post by: inertia on January 08, 2016, 10:03:28 AM
I would suggest a small DC motor (stepper or otherwise) fitted with a worm gear and driving a large ring gear which is fitted to the bottom of the turret. That will slow down the speed of rotation considerably and should iron out any visible jittering or stepping. Control by Arduino, twin-relay switch, whatever. This has the ability to give you 360° movement and the speed can be altered by changing the supply voltage to the motor.
I think Technobots and Model Radio Workshop both do dedicated turret servo controllers. These will be restricted in rotation by the end stops inside the servo - unless you remove them (in which case good luck!).
DM
Title: Re: Gun turret rotation - servo or stepper motor?
Post by: Subculture on January 08, 2016, 10:07:19 AM
Standard analogue servos e.g. those pulsed at about 50hz tend to get a bit 'grainy' or jittery when slowed down. Digital servos work much better, and I found Hitec servos, which tend to be pulsed at a higher rate than some other makes, are particularly smooth.

Finally if the turrets are going to be shuttling about a lot, then you might want to look at the Hobbyking 'Mi' range of servos. These use a magnetic encoder in place of a feedback pot, meaning there are no wipers or carbon tracks to wear out. This is generally the main reason for jittery positioning.
Title: Re: Gun turret rotation - servo or stepper motor?
Post by: malcolmfrary on January 08, 2016, 10:11:14 AM

A shot in the dark - experiment reducing the voltage to the servo - haven't given this much thought so probably end up with egg on my face but worth a shot!

C-3PO
You can't really do a lot with voltage to the servo - the internal electronics are designed around 5 volts plus or minus not much.  Digging inside the servo and inserting a resistor of about the same value as the motor resistance might do the job of slowing the motor and allowing it to start under load.


The idea of a worm and ring is pretty much what happened on model railway turntables - they rotated slowly and smoothly (thinking of the old Tri-ang one)
Title: Re: Gun turret rotation - servo or stepper motor?
Post by: C-3PO on January 08, 2016, 10:31:33 AM
Cheapest solution by far Arduino £5 and a few bits of cable! Can also run an almost unlimited automated sequence of movements (varying degrees and speed), switched on and off by radio channel all  to make it look realistic. I'm sure close up the servo jitter is noticeable - 5 metres out of the boating pond is it an issue?

PS Struggled to type this post as my vision obscured by egg!
C-3PO
Title: Re: Gun turret rotation - servo or stepper motor?
Post by: Martin [Admin] on January 08, 2016, 10:51:21 AM
 
OK, come on C-3P0, write up an article how it's actually done!

(http://files.enjin.com/94106/gauntlet-thrown-down.jpg)
Title: Re: Gun turret rotation - servo or stepper motor?
Post by: john44 on January 08, 2016, 01:36:49 PM
With wiring diagrams to please C-3PO for dummies like me.


John
Title: Re: Gun turret rotation - servo or stepper motor?
Post by: Norman Castle on January 08, 2016, 01:48:39 PM
I'm sure close up the servo jitter is noticeable - 5 metres out of the boating pond is it an issue?
 
Nope, but I'm one of those people who when something does what I wasn't expecting it to do (in this case, jitter), I want to know why it's doing it  :}
Title: Re: Gun turret rotation - servo or stepper motor?
Post by: C-3PO on January 08, 2016, 04:58:59 PM
Wow,
I have just returned from "Gods own Junkyard" - could have sat in there for hours, shame I couldn't afford any of the lights - it's even better than the pictures on their website!

http://godsownjunkyard.co.uk/

I never knew how much I liked coloured lights/neon etc. ( better to google gods own junkyard and look at images...)

Norman - I understand the curiosity - good on you - I think the jitter is down to the way the varSpeedServo library works/ is being used.

I like a challenge - I think I can do away with the jitter on the £5 Arduino solution - get those eggs ready!

Hello Martin/John44 - yes happy to do diagrams etc but to do it justice and help save lots of questions I'll do it properly which will take some time to prepare so watch this space.

C-3PO





Title: Re: Gun turret rotation - servo or stepper motor?
Post by: dreadnought72 on January 08, 2016, 06:59:18 PM
So movement from one step to the next will be a swift movement of 5.625 degrees and therefore possibly jerky.


That model is geared down - it takes 4096 steps (in an 8-step sequence) to do 1 revolution at the output shaft. It's great (and smooth) at slow speeds, and <0.1° accuracy is surely enough for us?


Andy
Title: Re: Gun turret rotation - servo or stepper motor?
Post by: tsenecal on January 08, 2016, 07:00:25 PM
having seen others build working turrets on their ships, the "elephant in the room" that nobody has brought up, is this:


in all the turrets i've seen, jerkiness was not caused by the speed of the servo, or the types of gears, or the use of stepper motor or DC motor.


it has to do with how the turret itself is mounted on the deck. don't just bolt it to the servo horn and expect it to be flawless.  support the turret.  you need to design a system that has as little friction as mechanically possible. it matters not if you use ball bearings, or bushings, or teflon.  just make sure you can rotate the turret by hand with no "sticking" or other issues, and whatever "motor" you use will be able to rotate the turret without issue.
Title: Re: Gun turret rotation - servo or stepper motor?
Post by: tsenecal on January 08, 2016, 07:03:30 PM
if you do go with a stepper motor, even if it is the cheap geared job, i use a "real" stepper driver that basically requires 2 pins from the arduino (and can even be used to power the arduino).  arduino sends a direction and a "step" command. adds cost, but reduces the amount of work needed in the actual arduino code.  https://www.sparkfun.com/products/12779 (https://www.sparkfun.com/products/12779) is the one i have used in the past
Title: Re: Gun turret rotation - servo or stepper motor?
Post by: C-3PO on January 09, 2016, 08:32:57 AM
Supply line of eggs secured for an future information mishaps - sorry I got this one wrong - should have read further down the spec sheet and I should have realised it had a geared output as it is offset


dreadnought72 thank you for correcting my mistake re stepper motor - it does exactly as Andy states


C-3PO
Title: Re: Gun turret rotation - servo or stepper motor?
Post by: Norman Castle on January 09, 2016, 09:23:20 AM
My brain hurts now.

So going back to square one, if the turret/platform/roundabout/whatever weighs no more than 50gm, 170° rotation is enough for this application and control is with an Arduino Uno, what's my best bet for slow, smooth traverse?  I don't have the facilities to make anything more sophisticated by way of a mounting than a brass tube pivot turning in a brass tube sleeve.

Picking up tsenecal's point about jitter being down to the mounting of the turret itself, in this particular case the jitter's still there if I just stick a 4" piece of balsa strip to the servo horn.  This is with a (genuine) HiTechS-311.

BTW, that micro metal 100:1 geared motor at £12.39 that C-3PO kindly linked to above from Cool Components looks remarkably like the one that's on Ebay and from Component Shop at well under a fiver ...
Title: Re: Gun turret rotation - servo or stepper motor?
Post by: C-3PO on January 09, 2016, 10:45:00 AM
Hello Norman,


Sorry I may have added to the brain pain!



I'm sure you are right that eBay have the same item cheaper re geared motor  - just make sure it's shipped from UK (ideally).


Re turret rotation which is more important to you ability to vary/determine the speed of travel OR smoothness of travel at one set speed?


C-3PO
Title: Re: Gun turret rotation - servo or stepper motor?
Post by: ballastanksian on January 09, 2016, 11:48:29 AM
Whatever you choose Norman, make sure to keep an eye in top weight when designing and building.

Title: Re: Gun turret rotation - servo or stepper motor?
Post by: Norman Castle on January 09, 2016, 01:00:29 PM
Re turret rotation which is more important to you ability to vary/determine the speed of travel OR smoothness of travel at one set speed?

The former  :-)

Whatever you choose Norman, make sure to keep an eye in top weight when designing and building
 
No worries on that score, mister.  I'm red hot on keeping top weight (or whatever the technical term is) down!
Title: Re: Gun turret rotation - servo or stepper motor?
Post by: dreadnought72 on January 09, 2016, 05:32:17 PM
Best bet, IMO, is to go with the geared stepper listed above. Super cheap and smooooother than Smooth Radio quietly playing The Carpenters.  %) Mount the stepper securely to the hull, and the turret directly to the output shaft. If I ever get a day off work, I'll brew up some code and demonstrate jitterlessness by the Power of Video.   :-))

Andy
Title: Re: Gun turret rotation - servo or stepper motor?
Post by: Norman Castle on January 09, 2016, 05:43:24 PM
Best bet, IMO, is to go with the geared stepper listed above.

Cheers Andy.  Sorry to be a (insert term of choice here), but which motor?
Title: Re: Gun turret rotation - servo or stepper motor?
Post by: dreadnought72 on January 09, 2016, 06:41:43 PM
The 28BYJ-48 stepper: five for eight quid. Here's (http://m.youtube.com/watch?v=B86nqDRskVU) an in-depth look into this model.

Andy
Title: Re: Gun turret rotation - servo or stepper motor?
Post by: plastic on January 09, 2016, 08:54:22 PM
I don't get it.  :o

Are the turrets supposed to be traversing back & forth randomly? In real life, the guns would be stationary until battle and then they'd probably all point the same direction and stay trained on the target - what exactly is the end result that the op is expecting?

All of these solutions seem way too complcated compared to a simple geared dc motor under each turret and some rotation limit microswitches.  :-))
Title: Re: Gun turret rotation - servo or stepper motor?
Post by: dreadnought72 on January 09, 2016, 09:28:26 PM
Hi Plastic!


Here's why I get it: my plan (coming soon to this forum!) is to rotate five turrets via individual stepper motors to a designated target bearing. By tying in an Arduino to a six-axis gyro/accelerometer my turrets will 'track' a target no matter what course alterations the hull makes. Given that steppers allow rotations that are smooth, well below degree sensitivity, and indefinitely repeatable and accurate, I think this is the best solution to realistic gun control on a ship.


...We'll see.


Andy
Title: Re: Gun turret rotation - servo or stepper motor?
Post by: g6swj on January 09, 2016, 09:36:00 PM
plastic,

I think the intention is to add some "animation" to the model. The position of the gun turret does not traverse back and forth randomly which I guess is what you would achieve with limit micro switches. The animation is only limited really by your imagination and programming ability!

The solution the guys are using is a pre-programmed sequence of movement/speed/delay before next movement with no human intervention.

e.g. a sequence can be as simple or complicated as you want to make it:
Title: Re: Gun turret rotation - servo or stepper motor?
Post by: g6swj on January 09, 2016, 09:37:09 PM
wow Andy - I like your thinking....
Title: Re: Gun turret rotation - servo or stepper motor?
Post by: C-3PO on January 09, 2016, 09:46:24 PM
Fresh eggs within arms reach :)

Andy - what a great idea - would love to see it working.

Could you use a compass reads (electronic). Get the compass bearing of the enemy, store the reading and then as the compass reading change compare to your stored reading and adjust guns with the plus/minus difference.

C-3PO
Title: Re: Gun turret rotation - servo or stepper motor?
Post by: dreadnought72 on January 09, 2016, 10:08:13 PM
I bought a solid-state compass for testing, but it's not at all ideal. There's a lot of 'dip' at our latitudes (the signal for 'dip' is more than the horizontal 'north') so any slight roll of the hull causes dramatically unusable figures to pour out of the compass.


Then I discovered the joys of combination gyro/accelerometers. I'm only using the gyros in one (mathematical!) plane, since slight roll, and even less pitch, has little noticeable effect - it's that old cos(little-theta) thing - but I have been astounded by the accuracy.


Indeed, I thought the chip was faulty first time I plugged it in. It drifted by 0.01 degrees every couple of seconds.


...It's measuring the rotation of the Earth.  :o


Andy
Title: Re: Gun turret rotation - servo or stepper motor?
Post by: C-3PO on January 09, 2016, 10:35:49 PM
Great project - look forward to your updates.

All understood (I think) re compass not being an option.

I had a quick look at the spec for a gizmo (appreciate you may be using a different board but I'm sure it also has lots of hieroglyphics in it's spec I have never heard this word before "quaternion") and I could feel my brain hurt as I read the specification - best of luck!

Title: Re: Gun turret rotation - servo or stepper motor?
Post by: derekwarner on January 09, 2016, 11:22:23 PM
Guys......this is all a step up in technology :o, however we need a defined time period for what is being considered to understand prototypical armament movement

If we are talking five turrets, are we are looking at vessels between WWI  to WWII?.......the low speed movement of turrets in these latter years was radar controlled

Turrets of these generations did not perform an SHM [random simple harmonic mode ] in both train and elevation awaiting confirmation from the FCC [fire control computer] to determine all variables.....[& yes O0  in earlier days FCMC 'fire control mechanical computers' were used]

I am sure the system components offered below by dreadnought72 and  C-3PO would work very realistically with ultra modern missile launchers, and to a latter extent modern small bore & low calibre high fire rate gun turrets [British 3'' or the Italian Otto-Malera 76mm], however collectively be wasted on model vessels based on designs between WWI  to WWII

Further even with all of this technology controlling a vessel turrets train and elevation of a warship in heavy seas does need human intervention  :P as the target still must be defined........... Derek

Title: Re: Gun turret rotation - servo or stepper motor?
Post by: Norman Castle on January 10, 2016, 07:58:50 AM

I don't get it.  :o

Are the turrets supposed to be traversing back & forth randomly?

Only apparently.  Perhaps I should have explained that I'm not after lifelike turret rotation.  I'm actually trying out various ideas for the next build, the general theme of which is perhaps best described as watered-down Steampunk with overtones of Burning Man ...  8)


The 28BYJ-48 stepper: five for eight quid. Here's (http://m.youtube.com/watch?v=B86nqDRskVU) an in-depth look into this model.

Thanks for that Andy.
Title: Re: Gun turret rotation - servo or stepper motor?
Post by: The Old Fart on January 10, 2016, 07:59:44 AM
I have stepper motors controlling the crane swing and lift, on my Dusseldorf.
When checking the current drawn, I realised that the stepper were still drawing current when stationary.
Reprogramming the 'picaxe' controller now switches off all outputs when not required.
saves around 1/2amp drain on the battery.
Title: Re: Gun turret rotation - servo or stepper motor?
Post by: dreadnought72 on January 10, 2016, 10:12:41 AM
Sounds like the spec for the one I'm using - it's an MPU-6050 (http://playground.arduino.cc/uploads/Main/mpu-6050.jpg) mounted on a breakout board and it requires IC2 comms to chat to it.

Andy
Title: Re: Gun turret rotation - servo or stepper motor?
Post by: derekwarner on January 10, 2016, 10:24:57 AM
So Mr Castle finally says ......'perhaps I should have explained that I'm not after lifelike turret rotation'..... :o

Well ..who are the fools here?  >>:-(...the members who I also suppose who could have expended less constructive thought & comment on a hypothetical with a  %% poster? 

But after all we did learn a little on the potential of stepper motors & controllers :-)) .... we live & learn..... Derek
Title: Re: Gun turret rotation - servo or stepper motor?
Post by: Colin Bishop on January 10, 2016, 10:59:18 AM
Steampunk?

Title: Re: Gun turret rotation - servo or stepper motor?
Post by: g6swj on January 10, 2016, 11:07:29 AM
There are no fools here! There are hobbyists exploring what's possible. And the answer is simple - you can make the movement do exactly what you want and using these methods (some sort of microprocessor) it will be more lifelike than almost all other solutions. I don't recall anybody specifying type or period of model - just an exploration of what could be achieved and how.

Guys......this is all a step up in technology :o, however we need a defined time period for what is being considered to understand prototypical armament movement

Why do we need a defined period when any movement could be simulated?

Mr Castle - or Norman to most of us, has already achieved quite a lot in a short period of time and is simply wanting to refine the concept - specifically the smoothness of movement.

Lighten up guys - it's supposed to be fun! - and if Norman ends up with a gun turret spinning like he wants but nothing like the real thing does it matter?
Title: Re: Gun turret rotation - servo or stepper motor?
Post by: Norman Castle on January 10, 2016, 02:26:22 PM

Steampunk?

Sort of, Colin.  The original inspiration was this picture which I found on the internets.  I just thought "Ooooh look - a Steampunk Springer"...

(http://i79.photobucket.com/albums/j158/danfoto_photos/237_zpsoxg4swey.jpg)

Then it occurred to me that it might be fun to try to combine elements of Burning Man "art cars" with that approach, which naturally led me to thoughts of moving elements, and before you know it I'm knee deep in turret rotation and the Arduino, thanks to the help I've received via this forum. 

It's a hell of a learning curve for me, but it's all great fun  :-)

(PS  The gun and the turret itself's been the easy bit - one aerosol cap, one curry sauce jar lid, two bits from The Lady Wife's dead garden sprayer, some plasticard and some plastic filler)
 
Title: Re: Gun turret rotation - servo or stepper motor?
Post by: malcolmfrary on January 10, 2016, 07:05:22 PM
This dead garden sprayer - got to ask - was it dead before or after it lost these two bits?


While a bit of notchiness might not be noticeable out on the lake, things like this tend to get attention ashore, so smooth is better.  Harping back to turntables, in use, the real thing needed to have the engine being turned as balanced as possible to turn more easily.  Extrapolating this, a turret needs a lack of contact with its hull other than its bearing.  That way, smoothness comes down to the motor and gearing.
If going steampunk, it will need a very good steam maker in order to really look like something from the late Victorian era in the other trouser leg of time.
Title: Re: Gun turret rotation - servo or stepper motor?
Post by: Norman Castle on January 11, 2016, 06:04:49 PM
Oh believe me, Malcolm, the sprayer was definitely way past its best-before.  There's only so much you can do with one of those with epoxy and gaffer tape, and besides, The Lady Wife's birthday was approaching  %)

I'd love to make a proper job of a Steampunk boat, but alas (a) I have neither the facilities or the skill necessary to do it justice and (b) in any case I'd be worried about it being top-heavy.  So this one is simply a Springer influenced by some elements of Steampunk, some elements of Burning Man art cars, and the biker chappie from Postman Pat ...

Getting back to turret rotation, in this particular application there's actually no contact anywhere 'twixt turret and deck, but I have established that the bloomin' servo I need to use is a little bit jittery even when plugged into my servo tester and set to the neutral position!   It's not a problem as such though - I'm just keen to understand as much as I can about this whole turret rotation / servo control / stepper motor / Arduino lark.  It's all new to me and it seems to have endless possibilities  :-)
Title: Re: Gun turret rotation - servo or stepper motor?
Post by: malcolmfrary on January 11, 2016, 08:53:27 PM
If it is jittery on the tester, first check the tester batteries (been there got the tee shirt) and/or another servo to compare.  A perfectly testing servo means that not only is the servo a good'un, but so is the tester, the battery and all the bits of wire between them.  Jitter could have its source anywhere in the chain.  And there ain't no rule saying that there is only one source at a time other than in Haynes manuals.
Title: Re: Gun turret rotation - servo or stepper motor?
Post by: afb on January 13, 2016, 02:31:54 PM
I've quickly done a video on a gun turret project I'm working on, so you can see how slowly and smoothly a stepper can operate. I've made the speed of traverse proportional to joystick displacement which may or may not be a good idea? The video also shows the maximum traverse speed possible with this particular motor which (after a 64:1 gearbox) does 4096 steps / rev. The stepper is just under £4 (including a driver board) at Technobots or considerably cheaper if you're prepared to wait for a Chinese eBay supplier to deliver. I dispensed with the driver board and just used its chip on my breadboard. Technobots also do the same motor with a 16:1 gearbox if you need a bit more speed, but that's almost £5 and *without* the driver board. By step counting I can limit the angle of rotation - pot adjustable from zero to 360 degrees with "detents" at 90, 180 and 270 indicated by the LED in a setup routine - or there is the option for continuous rotation which can be needed for smaller guns.

Now working on a second channel to "fire" the gun - storing the "bang" as a sound sample in the Arduino - incidently I'm fresh out of Arduino Nanos which I'd be using so the video shows me using the much larger UNO during the development process.

https://youtu.be/eNhRwx8Gp_c (https://youtu.be/eNhRwx8Gp_c)
Title: Re: Gun turret rotation - servo or stepper motor?
Post by: Norman Castle on January 13, 2016, 03:20:30 PM
I've quickly done a video on a gun turret project I'm working on, so you can see how slowly and smoothly a stepper can operate. I've made the speed of traverse proportional to joystick displacement which may or may not be a good idea?

Now working on a second channel to "fire" the gun - storing the "bang" as a sound sample in the Arduino

Crikey!  That's well impressive.  And I had no idea you can store a sound sample on an Arduino ...
Title: Re: Gun turret rotation - servo or stepper motor?
Post by: plastic on January 13, 2016, 05:53:25 PM
Clever - but if you are going to synchronise the turrets to all point at one target, how do you designate the coordinates of the fixed target point to a moving boat?

Could you not get the same effect easier in the old analogue way that linear-tracker record players used of LEDs down the bore and locking on when the correct colour/pattern is lined up?

You could just chuck a target buoy into the water and let the guns find it optically and they would stay locked on no matter what the boat did. You could use an actual designator to find it that then enables the guns when a 'lock' is found.
Title: Re: Gun turret rotation - servo or stepper motor?
Post by: afb on January 13, 2016, 05:57:42 PM
Norman - there's 32K of program space on the Uno/Nano (328 based ones) so if your control program isn't too large you could have say 24k of memory free in which to store sound samples - that's 3 secs of audio at 8K sampling rate. Use the PROGMEM statement which is part of the "pgmspace.h" library to store data in the program memory. Formatting the sound data before you put it in there and then playing it out again is not trivial however, if you're already struggling to move a stepper!
Title: Re: Gun turret rotation - servo or stepper motor?
Post by: dreadnought72 on January 13, 2016, 06:53:52 PM
Clever - but if you are going to synchronise the turrets to all point at one target, how do you designate the coordinates of the fixed target point to a moving boat?

Thinking of typical ranges of the time as 8000yds and up, at the scale I'm working at, the minimum distance to target would be about 110yds. All turrets would effectively be parallel.

A scaled 20 knots is about 'walking pace', say 10 feet per second. At 110 yards the change in angle of a target, at maximum, is only a degree a second or so. When on parallel/near-parallel courses (like most of the actions in WW1) the angular change is minimal.

To effect a turret rotation as the target changes bearing is automatic during a turn by the turret-carrying vessel, and would require a simple 'new target heading' and 'set' transmission in the system I'm developing.

IDEALLY, all prospective targets (!) should mount an IR-LED on their masts. There are chips available that can read signals from such LEDs. The work of scanning the horizon for a target wouldn't be impossible using Arduinos/other processors. ...Which, I suppose, would be a game changer for those who are determined to sink boats with gas-powered bbs.

Andy
Title: Re: Gun turret rotation - servo or stepper motor?
Post by: plastic on January 13, 2016, 07:08:19 PM
Thinking of typical ranges of the time as 8000yds and up, at the scale I'm working at, the minimum distance to target would be about 110yds. All turrets would effectively be parallel.

A scaled 20 knots is about 'walking pace', say 10 feet per second. At 110 yards the change in angle of a target, at maximum, is only a degree a second or so. When on parallel/near-parallel courses (like most of the actions in WW1) the angular change is minimal.

To effect a turret rotation as the target changes bearing is automatic during a turn by the turret-carrying vessel, and would require a simple 'new target heading' and 'set' transmission in the system I'm developing.

IDEALLY, all prospective targets (!) should mount an IR-LED on their masts. There are chips available that can read signals from such LEDs. The work of scanning the horizon for a target wouldn't be impossible using Arduinos/other processors. ...Which, I suppose, would be a game changer for those who are determined to sink boats with gas-powered bbs.

Andy

Very easy to do with analogue circuits - fit an IR LED that flashes a pulse train on a rotating 'designator' on the warship and retro-reflectors on the target buoy/boat and when the pulse train is detected by the turrets L & R detectors, they turn until the boresight detector picks up the signal which means the gun is trained.
Duplicate circuits in each turret and they'll work independently as a team to stay trained on target no matter where the boat is in relation to the target.
This can be done with a couple of op-amps like the old record players tone-arm.

If all you are going to do is turn the turrets to 90 deg, why bother with all your complication? The old Lindberg Blue Devil Destroyer mechanism could do that.
Title: Re: Gun turret rotation - servo or stepper motor?
Post by: dreadnought72 on January 13, 2016, 07:39:56 PM
If all you are going to do is turn the turrets to 90 deg, why bother with all your complication? The old Lindberg Blue Devil Destroyer mechanism could do that.

? That's not at all what I'm attempting to do.

Andy