Model Boat Mayhem

Please login or register.

Login with username, password and session length.
Pages: 1 2 3 4 5 6 7 8 9 10 [11] 12 13 14 15 16 17 18   Go Down

Author Topic: T.A.R.G.E.T - Rotating Seven gun turrets?  (Read 250879 times)

dreadnought72

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 1,892
  • Wood butcher with ten thumbs
  • Location: Airdrie, Scotland
Re: T.A.R.G.E.T - Rotating Seven gun turrets?
« Reply #250 on: January 19, 2017, 09:06:19 pm »

Very good!  :-))


Andy
Logged
Enjoying every minute sailing W9465 Mertensia

C-3PO

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 1,107
  • I thought that hairy beast would be the end of me
  • Location: Outer Rim world of Tatooine
Re: T.A.R.G.E.T - Rotating Seven gun turrets?
« Reply #251 on: January 20, 2017, 08:22:47 am »

Thanks Andy,

I do have some issues that I need to resolve. For example getting the Arduino to read 2 of the RC RX channels presents some challenges.

Using the pulseIn command is very slow( and I am not a fan of this route) , even when you use a timer to read it once every x ms rather than every loop. Using 2 interupts to read the 2 RC RX channels also seems an issue as quite often the RC RX signal out is not stable hence the interupts are on overtime.

Any thoughts?

C-3PO
Logged
I think it's the way I have learnt most of my stuff - getting very stuck first...

Martin (Admin)

  • Administrator
  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 23,359
  • Location: Peterborough, UK
    • Model Boat Mayhem
Re: T.A.R.G.E.T - Rotating Seven gun turrets?
« Reply #252 on: January 20, 2017, 08:43:02 am »


Can you use two Arduino's?
 They're cheap enough...
Logged
"This is my firm opinion, but what do I know?!" -  Visit the Mayhem FaceBook Groups!  &  Giant Models

C-3PO

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 1,107
  • I thought that hairy beast would be the end of me
  • Location: Outer Rim world of Tatooine
Re: T.A.R.G.E.T - Rotating Seven gun turrets?
« Reply #253 on: January 20, 2017, 09:07:21 am »

Hi Martin,

You may well be right with this suggestion.

I have been working along the lines of KISS - but as you get deeper into the actual development/assessment you find some the the physical limitations that on paper do not present themselves.

I may not of been very clear with my last post, it's all relative, if you are trying to control 7 steppers x 4 digital lines for each (28 signals) , read a sensor, read 2 RC chanels, pat your head and rub your tummy - if just one of these takes more time than you expect it impacts directly on the others as this is not a mutli tasking environment.

I am still wanting to come up with a solution that uses the least amount of kit, is the simplest and cheapest option. I can make most of my development issues go away is I go down the master and slave(s) route but the cost creeps up quite fast....

Not putting pressure on Andy but I know he has taken a different approach and he is writing his own stepper library which may well help with stepper control efficiency.

C-3PO
Logged
I think it's the way I have learnt most of my stuff - getting very stuck first...

Martin (Admin)

  • Administrator
  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 23,359
  • Location: Peterborough, UK
    • Model Boat Mayhem
Re: T.A.R.G.E.T - Rotating Seven gun turrets?
« Reply #254 on: January 20, 2017, 11:53:22 am »


Keep going C-3PO, we're loving this!   :-))

Logged
"This is my firm opinion, but what do I know?!" -  Visit the Mayhem FaceBook Groups!  &  Giant Models

Colin Bishop

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 12,171
  • Location: SW Surrey, UK
Re: T.A.R.G.E.T - Rotating Seven gun turrets?
« Reply #255 on: January 20, 2017, 01:21:39 pm »

Yes, what a wonderful way of staving off dementia!

Colin
Logged

Shipmate60

  • Global Moderator
  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 5,800
  • You bark - I will bite!!!
  • Location: Fareham
Re: T.A.R.G.E.T - Rotating Seven gun turrets?
« Reply #256 on: January 20, 2017, 05:29:56 pm »

Surely the most useful system would be to control 4 turrets as in most capital ships.
The "additional" turrets could be an "add on" for additional turrets.
This would enable more of the systems to be sold and who knows even make a profit for the originators.


Bob
Logged
Officially a GOG.

ballastanksian

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 6,447
  • Model Boat Mayhem inspires me!
  • Location: Crewkerne
Re: T.A.R.G.E.T - Rotating Seven gun turrets?
« Reply #257 on: January 20, 2017, 08:33:16 pm »

I can see the logic of developing the full seven turret arrangement and then developing two, three, four, five and six turret systems from it so that all classes of battleship and cruiser can be controlled.

The originator can release the four turret system as a standard and then later release the other products as and when to maximise on exposure to the market but without the added expense of time and money in development as they have already done it all.

I was wondering if a ten turret system is too way out, as the Warrior class of Armoured cruisers had ten turrets 9.2inch (6x1) and 7.5inch (4x1).

Logged
Pond weed is your enemy

Bob K

  • Bob K
  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 3,686
  • Location: Windsor
Re: T.A.R.G.E.T - Rotating Seven gun turrets?
« Reply #258 on: January 20, 2017, 09:01:00 pm »

If it helps, my planned build of a seven turret ship will be in two halves.  By all means plan for 4 or 5 turrets, as long as I can put two systems in mine operating from the same Rx channel. 
Logged
HMS Skirmisher (1905), HMS Amazon (1906), HMS K9 (1915), Type 212A (2002), HMS Polyphemus (1881), Descartes (1897), Iggle Piggle boat (CBBC), HMS Royal Marine (1943), HMS Marshall Soult, HMS Agincourt (1912)

dreadnought72

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 1,892
  • Wood butcher with ten thumbs
  • Location: Airdrie, Scotland
Re: T.A.R.G.E.T - Rotating Seven gun turrets?
« Reply #259 on: January 20, 2017, 09:21:56 pm »

Four turrets (two aft, two forward, both superfiring) is an utter piece... quite straightforward, compared to what's being worked on. (I'm aiming for wing turrets, cross-deck firing solutions, and all the vagaries of WW1 turret layouts).


Getting there!


Andy
Logged
Enjoying every minute sailing W9465 Mertensia

C-3PO

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 1,107
  • I thought that hairy beast would be the end of me
  • Location: Outer Rim world of Tatooine
Re: T.A.R.G.E.T - Rotating Seven gun turrets?
« Reply #260 on: January 21, 2017, 10:52:00 am »

Surely the most useful system would be to control 4 turrets as in most capital ships.
The "additional" turrets could be an "add on" for additional turrets.
This would enable more of the systems to be sold and who knows even make a profit for the originators.

Bob

Bob - I cannot talk for anybody else but I have no desire to make this a commercial venture and all the baggage that goes with that (stock, liability etc etc).

My vision is that it's open source, freely available - which would mean anybody can use, amend, add to etc.

I would like to go down the gentleman's agreement that if you choose to use this system - in acknowledgement of the development you make a contribution to the RNLI - perhaps a minimum of £10 - however clearly this is not mandatory.

The core code would be well documented that would hopefully make configuration easy - so if you want 1 or 21 turrets it's easy to make this a reality. I envisage a PDF document that leads you by the hand as to how to buy the kit, put it together and then load the software.

If you Google "Arduino Radio Control" or perhaps have a look at www.rchub.co.uk you will see that there are thousands of people playing with Arduino's and RC - most people publish their code openly for others to use.

Arduino's can seem daunting - if you spoke to someone who had never seen an RC kit before and spoke about ESC, Servos, trim tabs, joysticks, servo reverse, reciever channels, proportional control - their head would be spinning with all the jargon which we take for granted. It's the same with Arduino, if you spend a short amount of time getting familiar you wonder what all the hype was about.


I think this video shows that this project is viable, has substance and not just hot air. - https://youtu.be/FFJTJn-q-e4


Andy (dreadnought72) is also developing a solution, I have not had a conversation with him but perhaps the end solution is a hybrid of both our efforts.

There are few people on Mayhem that have seen the light with Arduino and RC and what it's potential is ( a few are listed below) - have a look at:

Andy's - Turret Control - http://www.modelboatmayhem.co.uk/forum/index.php/topic,56884.msg593347.html#msg593347

IKB's 2.4ghz relay switch http://www.modelboatmayhem.co.uk/forum/index.php/topic,57013.msg592796.html#msg592796

Barriew's ramp control http://www.modelboatmayhem.co.uk/forum/index.php/topic,53368.msg564242.html#msg564242

JohnRedearth's - Ballast Control http://www.modelboatmayhem.co.uk/forum/index.php/topic,54401.msg562802.html#msg562802

Tim - tsenecal - Robbe multi channel decoder http://www.modelboatmayhem.co.uk/forum/index.php/topic,53368.msg557637.html#msg557637

So embrace the little Arduino - it's a lot of fun and very rewarding......

C-3PO
Logged
I think it's the way I have learnt most of my stuff - getting very stuck first...

C-3PO

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 1,107
  • I thought that hairy beast would be the end of me
  • Location: Outer Rim world of Tatooine
Re: T.A.R.G.E.T - Rotating Seven gun turrets?
« Reply #261 on: January 22, 2017, 07:22:22 pm »

Good news - no technical issues outstanding - previous issue relating to reading 2 rc channels really quickly so it did not slow down the rest of the code now solved - cause was dumb programming

I have been refining my code, making it easier to read, cleaning up stray code and making it run faster and started to document it so it's easily digestible

So I thought I would share with those that are interested the main program loop - this is the code that runs repeatedly after the initialisation (setup code executed etc)

I have put all my code into 7 logical functions that are easy to maintain. This is the main loop code and the functions that are called to be executed - the code itself is stuffed into the functions - none of which are very large or scary!

There is even code for sound, light, smoke and elevation...

Quote

void loop()

{

  read_rc();                          //  read radio control receiver channel A (3 way switch), process and set mode

  read_compass();               //  read mems compass sensor and process

  run_mode_function();       //  run function code associated with mode

  update_turret_limits();     //  update the status for each turret based on movement limits

  update_no_fire_zone();   //  update the status for each turret based on movement limits

  update_steppers();          //  enable stepper, move, disable stepper if reached destination

  debug_print();                 //  run function debug print function - disable by using "//"

}


Regards
C-3PO
Logged
I think it's the way I have learnt most of my stuff - getting very stuck first...

ballastanksian

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 6,447
  • Model Boat Mayhem inspires me!
  • Location: Crewkerne
Re: T.A.R.G.E.T - Rotating Seven gun turrets?
« Reply #262 on: January 22, 2017, 10:22:19 pm »

Good lord that is so simple! I imagined it being a telephone books worth of typing to realise.

So the functions are extra code beyond what you have published above?
Logged
Pond weed is your enemy

dreadnought72

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 1,892
  • Wood butcher with ten thumbs
  • Location: Airdrie, Scotland
Re: T.A.R.G.E.T - Rotating Seven gun turrets?
« Reply #263 on: January 23, 2017, 09:06:27 am »

Good lord that is so simple! I imagined it being a telephone books worth of typing to realise.

So the functions are extra code beyond what you have published above?


Must be, yes. Each function call is just a swan in the pond - there'll be an awful lot of paddling going on under the surface.


Andy
Logged
Enjoying every minute sailing W9465 Mertensia

Martin (Admin)

  • Administrator
  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 23,359
  • Location: Peterborough, UK
    • Model Boat Mayhem
Re: T.A.R.G.E.T - Rotating Seven gun turrets?
« Reply #264 on: January 23, 2017, 01:03:27 pm »


I've seen 'Beans on toast' recipes longer than that!   :o

 Well done that man!
Logged
"This is my firm opinion, but what do I know?!" -  Visit the Mayhem FaceBook Groups!  &  Giant Models

C-3PO

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 1,107
  • I thought that hairy beast would be the end of me
  • Location: Outer Rim world of Tatooine
Re: T.A.R.G.E.T - Rotating Seven gun turrets?
« Reply #265 on: January 23, 2017, 01:09:12 pm »

Good lord that is so simple! I imagined it being a telephone books worth of typing to realise.

So the functions are extra code beyond what you have published above?

Thank you Martin for the compliment....

Re functions...
Yes the main code sits nicely compartmentalised into seperate functions, grouping similar functionality together that get called and executed by the main loop.

Imagine a 500 page reference book without any chapters and no index - this is your program!! - hard to navigate and see what is what.

Add chapters to the book groupling similair functionality together (analogy of functions = chapters) straight away you can use the index ( function name) to jump to the right part of the book (code)

The additional benefit is the main loop is simple and clean and  it's easy to see what is happening in what sequence and to make changes you go to the function  and make changes to the actual code there.

And apart from the waffle above I have to keep it simple so I understand it!

C-3PO
Logged
I think it's the way I have learnt most of my stuff - getting very stuck first...

C-3PO

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 1,107
  • I thought that hairy beast would be the end of me
  • Location: Outer Rim world of Tatooine
Re: T.A.R.G.E.T - Rotating Seven gun turrets?
« Reply #266 on: January 27, 2017, 03:57:23 pm »

A quick update of C-3PO's version of a solution...

I have been adding code to make the T.A.R.G.E.T system/program more robust.

I have added a "start-up" procedure regarding turret alignment. When the system is switched on an alarm will chirp every x seconds and no turret functionality will work.

The user is required to turn the pot knob on the RC fully to both limits  (could perhaps be another control - but you can't knock the knob like you can a switch!) to confirm the user has placed the turrets in the park position - the system recognises that it has been "calibrated", the alarm is disabled and the system comes on-line.

Should the power be interupted to the unit the above procedure will need to be repeated to get the turrets to move.  A bit cumbersome but better this than bits of superstucture being bashed by turrets.

In all my years of programing I have been caught out many times when the error checking code was not good enough and the unbelievable happened - normally when a variable creeps to an unintended value.

C-3PO
Logged
I think it's the way I have learnt most of my stuff - getting very stuck first...

roycv

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 3,389
  • Location: S.W. Herts
Re: T.A.R.G.E.T - Rotating Seven gun turrets?
« Reply #267 on: January 27, 2017, 10:14:27 pm »

Hi all, still sorting this problem out.  My little grey cells have been at work again.  I have the following 'simple' possible solution.
I am thinking of a different intermediary unit, a cheap servo tester., or actually two  I have a little blue one cost 99p with a knob on for positioning the servo connected. 
I am thinking of drilling a hole through the knob and glueing in a 1mm piece of brass wire.  The end will have a light spring just enough to return it to its extreme right or left position.  So that you turn the knob the servo moves, release the knob the knob returns under spring control.
The main forward gun which trains left or right has a good servo drive.  Now think of this as the tiller with two arms and rods.

When the main gun servo turns say left it will push the extended wire of servo tester which is connected to the left side guns and they will move from ahead to broadsides.  The rod operating the servo tester will have short tube attached where the spring is located so it is a bit like a piston in a cylinder.  The rod from the 'tiller' arm (main forward gun) will push the whole tube as there will be a collar on the rod and the servo tester turns and operates connected servos.

When the forward gun points ahead again the rod will stay in the tube (cylinder) but the spring will return it until the left side guns train ahead.  When the main gun trains to the right the rod will be retained in the cylinder but have no effect on the servo tester movement.

There will be a second servo tester for the right hand side with a similar connection.
So when the guns train left or right only one servo tester will operate.  My little blue servo tester has 3 o/p servo connections and requires its own 5 volt input.
Cost of this is less than a fiver and no programming, anyone see any flaws in the idea?

My little grey cells are now exhausted!
best regards Roy
Logged

C-3PO

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 1,107
  • I thought that hairy beast would be the end of me
  • Location: Outer Rim world of Tatooine
Re: T.A.R.G.E.T - Rotating Seven gun turrets?
« Reply #268 on: January 29, 2017, 09:41:14 am »

REFERENCING A TARGET

How do you refer to a target? Do you simply always use the magnetic compass point?

In my head I can hear phrases like Green 050 - not sure if this fact, fiction or Hollywood. Clearly if you are on a boat without a compass then using the port/startboard 180 arc is meaninful.

Maybe some of relates to aircraft?

So can someone out their put me out of my confusion.

On a navy ship what reference would you use for a target?

Cheers
C-3PO

PS - roycv - your idea sounds very creative - will be interesting to see if you can make it reality - will follow with interest.....
Logged
I think it's the way I have learnt most of my stuff - getting very stuck first...

Allnightin

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 247
Re: T.A.R.G.E.T - Rotating Seven gun turrets?
« Reply #269 on: January 29, 2017, 10:33:13 am »


So can someone out their put me out of my confusion.

On a navy ship what reference would you use for a target?


In a modern ship with a radar based command and control system it would be something like " Take track 1234 with 4.5" (and no mention of true or relative range or bearing) unless  caught by surprise and the first indication was a visual sighting from the Gun Direction platform on the upper deck when the call might be "Alarm aircraft Red 90"
Logged

Colin Bishop

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 12,171
  • Location: SW Surrey, UK
Re: T.A.R.G.E.T - Rotating Seven gun turrets?
« Reply #270 on: January 29, 2017, 10:49:05 am »

You mean it's not just 'look over there!'?  ok2

Colin
Logged

C-3PO

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 1,107
  • I thought that hairy beast would be the end of me
  • Location: Outer Rim world of Tatooine
T.A.R.G.E.T. - Rotating seven gun turrets?
« Reply #271 on: January 30, 2017, 10:58:53 am »


1:   training +/- 150 ‘.  No firing, directly ahead, say +/- 20’, and beyond +/- 140’
2:   training  +/- 150’.  No firing over hood below +/- 30’, and beyond +/- 140’.
3:  training between 25’ and 150’ either side.  No firing 10’ inside this either side.
4:  training between 30’ and 150’ either side.  No firing 10’ inside this either side.
5:  training between 25’ and 150’ either side.  No firing 10’ inside this either side
6:  training  +/- 150’.  No firing over hood below +/- 30’, and beyond +/- 140’.
7:  training +/- 150 ‘.  No firing, directly astern, say +/- 20’, and beyond +/- 140’

Using Bob's information above I have a few questions on what the expected behaviour of turrets 3,4,5

I have the question in my head - let's hope I can explain it in text:(

Scenario A

From Park - If using the pot I move the position of T1 to 45' (forget turret 2,6,7 for now)  I would expect T3,4&5 to join in the same position.

From Park  - If using the pot I move the position of T1 to 10' what happens to T3,4&5 as they can only track to 25' or 30' - Do I move them to their lowest degree track position so they are as close to T1 as possible or something else.

Rather than make this post more complicated I will only pose one scenario at a time as the solution to one scenario may answer other questions I have.

Thanks in advance
Regards
C-3PO
Logged
I think it's the way I have learnt most of my stuff - getting very stuck first...

Bob K

  • Bob K
  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 3,686
  • Location: Windsor
Re: T.A.R.G.E.T - Rotating Seven gun turrets?
« Reply #272 on: January 30, 2017, 11:30:00 am »

Not sure if I have fully understood this one.

However, a turret that CAN bear on its designated target should do so.
Other turrets that can not quite reach this angle should bear as close as their limits allow, in case the ships heading alters later so that they can bear.  If a wing turret that cannot fire across the deck finds itself on the "wrong side" of the ship it should revert to parked position until the target moves to its own firing side.
Logged
HMS Skirmisher (1905), HMS Amazon (1906), HMS K9 (1915), Type 212A (2002), HMS Polyphemus (1881), Descartes (1897), Iggle Piggle boat (CBBC), HMS Royal Marine (1943), HMS Marshall Soult, HMS Agincourt (1912)

C-3PO

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 1,107
  • I thought that hairy beast would be the end of me
  • Location: Outer Rim world of Tatooine
Re: T.A.R.G.E.T - Rotating Seven gun turrets?
« Reply #273 on: January 30, 2017, 11:36:41 am »

Bob,

Thank you

Got it So if T1 @ 20' T3,T4&T5 would go to 25',30',25' as close as they can get to 20' of T1

So  using pot T1 now goes to 340' you would expect T3,T4,T5 to go to  335,330,335 ?

C-3PO
Logged
I think it's the way I have learnt most of my stuff - getting very stuck first...

dreadnought72

  • Full Mayhemer
  • *****
  • Offline Offline
  • Posts: 1,892
  • Wood butcher with ten thumbs
  • Location: Airdrie, Scotland
Re: T.A.R.G.E.T - Rotating Seven gun turrets?
« Reply #274 on: January 30, 2017, 04:10:03 pm »

However, a turret that CAN bear on its designated target should do so.
Other turrets that can not quite reach this angle should bear as close as their limits allow, in case the ships heading alters later so that they can bear.  If a wing turret that cannot fire across the deck finds itself on the "wrong side" of the ship it should revert to parked position until the target moves to its own firing side.


That's the solution I'm adopting. "Can't fire? Go to the nearest firing arc limit."


Andy
Logged
Enjoying every minute sailing W9465 Mertensia
Pages: 1 2 3 4 5 6 7 8 9 10 [11] 12 13 14 15 16 17 18   Go Up
 

Page created in 0.149 seconds with 22 queries.