Model Boat Mayhem

Technical, Techniques, Hints, and Tips => Radio Equipment => Topic started by: Brian60 on June 01, 2016, 05:37:42 pm

Title: Servo control question
Post by: Brian60 on June 01, 2016, 05:37:42 pm
This might actually be better suited to the micro controller section, but as its servo related I'll post here.
So I want to change the start position of a servo. All servo's when plugged in as far as I know, self centre, so that they have a sweep of say 60degrees each side of centre.

But what if I didn't want it to self centre, what if I wanted it to begin at one end of that 60 degree arc and then move through the whole 120 degree sweep to the other end and then stop there until it was given a signal to return? Does anyone have a clue how to achieve it?
Title: Re: Servo control question
Post by: Klunk on June 01, 2016, 05:48:34 pm
the easy way is to put it on a ratchet channel on your tx, thats what yachts do. servo at bottom to full top!
Title: Re: Servo control question
Post by: inertia on June 01, 2016, 06:27:26 pm
Brian
It's not clear from your post but if you only need the two positions then use a 2-way switched channel e.g. "retracts". If you want to position the servo somewhere along its travel then you'll need a control such as a slider or rotary knob (or, as Klunk says, a ratchet on one of the main stick axes).
DM
Title: Re: Servo control question
Post by: Brian60 on June 01, 2016, 07:23:01 pm
The TX idea is a no go I'm afraid. I need to know there is no possibility of it accidentally operating when I don't need it too. Basics of it are I'm wanting it to work as a lever. Think of a childs seesaw a pivot in the middle. The servo acts on one end via a lever attached to the servo. In the off position the servo is at the lower end holding down the seesaw. Operate the servo and it lifts its lever from the end of the seesaw, allowing that end to rise and the other end to fall. So I'm needing it to soley operate via a switch of some kind, off its down, on its up.

I know I can do this with a motor and end stop switches, my problem is a. the size of the motor involved, b. the lifting/lowering force involved, the gearing in a servo would help in this case, I'm not sure a dc motor (for the small size needed) would have the same sort of torque.
Title: Re: Servo control question
Post by: g6swj on June 01, 2016, 08:52:13 pm
Hello Brian,

How do you envisage making sure there is no possibility of accidently operating it when you don't need it - if not TX switch as per Inertia's suggestion then how will it be switched safely?

Also do you need the servo to travel the 120 degrees at full servo speed or have it slowed down so the movement is less violent/more smooth?

You could use a TX switch pattern to introduce some safety mechanism - eg. if TX switch flicked one way twice in quick succession (time would be defined) then and only then would the servo start it's movement - as you can guess this would involve the good old Adruino. As a quick after thought could this be switched using a relay or do you need the physical movement?

Regards
Jonathan
Title: Re: Servo control question
Post by: NFMike on June 01, 2016, 10:42:50 pm
If it isn't classified why not tell us what the end result of all these levers is to be?
You might get some suggestions for ways to achieve it more gracefully.
Title: Re: Servo control question
Post by: derekwarner on June 01, 2016, 11:00:24 pm
Brian.....forgive me...but could you consider the splines on the servo shaft as the primary positioning base and the servo drive disk with one arm only...[like a dividing head]

Set the servo to the natural neutral position with the drive arm @ centre, lift the drive arm of & reposition it ~~ 60 degrees out of phase?....Derek
Title: Re: Servo control question
Post by: Stavros on June 01, 2016, 11:36:28 pm
OK the Obvious question is what radio set are you using...lets start there


Dave
Title: Re: Servo control question
Post by: malcolmfrary on June 02, 2016, 07:43:17 am
On switching on in the right order (Tx, then RX), the servos center onto whatever the transmitter tells them - their "home" position is where their internal position sense pot agrees with what the transmitter it telling it. 
Any servo is just a motor with a gearbox and some electronics comparing instructions from the transmitter with information from its sensing device.  When they agree, it stops, when they don't, it drives.  Hopefully the right way for agreement to happen.
Title: Re: Servo control question
Post by: tigertiger on June 02, 2016, 11:40:33 am
DM
Would an Action servo morph do it?


TT
Title: Re: Servo control question
Post by: Brian60 on June 02, 2016, 02:08:36 pm
Thanks all. I like the idea that when the answer alludes you, chuck it in here for a brainstorming session and you always get plenty of varied answers.

As ever Malcolm pointed out the obvious which had never crossed my mind! I always seem to overlook the simple for the complicated and get into all sorts of difficulty %)

Anyways. thinking about it overnight and taking on board the answers here. I realised that this in only one part of an overall problem that will be fixed using an Arduino Mega - if the arduino is controlling other parts of a multifunction operation, then assembling the extra code for it to control a servo as well should be childs play :o :embarrassed: :embarrassed:
Title: Re: Servo control question
Post by: inertia on June 02, 2016, 02:23:26 pm
TT
I don't think there's any need for anything elaborate, Mark. A P96 would only adjust the speed and degree of travel anyway.

Brian
I don't know why you're so worried about the thing "accidentally operating" - accidents like that don't happen. The servo would only traverse from one extreme to the other when you trip a pretty solid-action toggle switch. If you really are that bothered then you can buy a toggle switch to replace the one on Channel 5 of the Tx which require you to physically lift the toggle lever up and away from the body and move it across to its other position, when it springs back in and locks itself in that position. That way you can't accidentally trip it. APEM make them but I've no idea what the code or the price is. My new Optic 5 Tx has a push-to-changeover button for the 5th channel which is also more difficult to trip accidentally than a standard toggle switch.

The simplest answer is to label the standard switch 'On' and 'Off' and keep your b****y fingers away from it!

I may have got it all wrong but that's based on my interpretation of what you've said. As Plague says, a bit more info would greatly help.

Dave M
Title: Re: Servo control question
Post by: Brian60 on June 02, 2016, 05:31:25 pm
Thats ok Dave, maybe I should elaborate why the accidental operation is important. The lever action (seesaw) will lift or lower my azimuth thruster into or out of the hull. The thruster has to be in its 'park' position to lift through the hole in the hull, if the the lever were to attempt to retract the thruster in any other position - think of park being 0 degrees on a 360 degree circle, then serious damage would occur to the thruster, the hull or both, resulting in a possible sinking.
Title: Re: Servo control question
Post by: inertia on June 02, 2016, 05:43:54 pm
Gotcha. Perhaps you might incorporate a microswitch in the signal wire to the lift servo so that it's only "made" at a point where the azimuth thruster is in its park position. I know sweet Fanny Adams about Arduinos but it might be as easy to contrive a circuit which causes the "Raise" command to centre the azimuth steering servo automatically before switching the lever servo. Both would achieve the same result but represent solutions from different centuries!
DM
Title: Re: Servo control question
Post by: Netleyned on June 02, 2016, 06:05:35 pm
We had the same system in the last century.


Surveying in the 70's we had a bottom profiler
That dropped from the hull.
On switching to retract the elliptical pod
went to fore and aft before retracting


Ned
Title: Re: Servo control question
Post by: Crossie on June 02, 2016, 06:38:55 pm



 Brian, you may want to consider the use of an already existing piece of electronic kit that is used on model submarines for a very similar problem. Many subs require their front dive-planes to be in a specific position before they can be folded or retracted, my T class and the Gato are examples, the item is called a Bow Plane Interlock and one can be obtained from Kevin McCloud Designs, a spot of Googling should reveal his contact details, or have a search in one of the submarine forums.
 Simple to install and is only a small item, set up is simple,


                                                   Trevor
Title: Re: Servo control question
Post by: Brian60 on June 02, 2016, 06:44:54 pm


 Brian, you may want to consider the use of an already existing piece of electronic kit that is used on model submarines for a very similar problem. Many subs require their front dive-planes to be in a specific position before they can be folded or retracted, my T class and the Gato are examples, the item is called a Bow Plane Interlock and one can be obtained from Kevin McCloud Designs, a spot of Googling should reveal his contact details, or have a search in one of the submarine forums.
 Simple to install and is only a small item, set up is simple,


                                                   Trevor

More investigaton is afoot. But Dave (Inertia) hit the nail on the head with a Arduino command that won't allow the retraction of gear until the azimuth prop has returned to its park position.
Title: Re: Servo control question
Post by: Crossie on June 02, 2016, 06:52:16 pm



 Brian, here's a link http://forum.sub-driver.com/forum/technical-support-and-tips/kmc-designs-support/114650-bow-plane-interlock


         Trevor
Title: Re: Servo control question
Post by: malcolmfrary on June 02, 2016, 10:24:22 pm
If the problem is to ensure that a servo (rotation) is in a particular position before a second servo (retract) can act then an extra position sensor to indicate correct alignment is needed which would allow either the "retract" signal to reach the servo or could switch between two signal sources controlling that servo. 
In the elder days I would have been thinking of a couple of quad NAND gate packs to do the logic switching, but an Arduino would certainly work, given enough program. 
Thinking modern, if the "retract" signal could be arranged to have the Arduino take over the rotation control and put it into the right position and then retract ........and only allow rotation when extended, of course.  Extra sensor to let the Arduino know when extension was complete.  Of course, the bow plane interlock mentioned earlier might well do all of this and leave my last few minutes thinking as confirmation of my round wheel inventors club membership.
Title: Re: Servo control question
Post by: Brian60 on June 03, 2016, 07:57:06 am
You see. Malcolm added a part in his last reply that I had overlooked!

Apart from being in 'park' before retracting, I would of course also need to make sure it couldn't operate-revolve before it was extended! Another note to self, think of all possibilities and then seek advice over what you may have missed.
Title: Re: Servo control question
Post by: Crossie on June 03, 2016, 09:15:52 am

 Yes Brian, the bow plane interrupt does indeed prevent movement while the item is in the 'parked' position. Another thing is that during the set-up process you can determine exactly where the park position is, you aren't limited to a particular servo neutral or end point.

                    Trevor
Title: Re: Servo control question
Post by: Brian60 on June 03, 2016, 11:36:11 am
Yes Brian, the bow plane interrupt does indeed prevent movement while the item is in the 'parked' position. Another thing is that during the set-up process you can determine exactly where the park position is, you aren't limited to a particular servo neutral or end point.

                    Trevor

 :-)) :-))
Title: Re: Servo control question
Post by: barriew on June 03, 2016, 06:19:48 pm
Brian,
Assuming you will be using an Arduino to calculate what you want your azimuth device to do, then you do not need another gizmo to control its raising and lowering. There is a servo control instruction for the Arduino which not only sets the direction and speed of moving the servo. but also halts execution of the programme until the servo has got to where it should be. So two lines of code will do what you need.


Search VarSpeedServo


Barrie
Title: Re: Servo control question
Post by: TomHugill on June 03, 2016, 11:04:57 pm
Hi Brian,

There's what I think is a ready made option, engel produce an RMR module for the dive plane retracts on submarines. It stops the servo controlling the front planes from operating until they're unfurled.
Title: Re: Servo control question
Post by: Brian60 on June 04, 2016, 07:55:45 am
Brian,
Assuming you will be using an Arduino to calculate what you want your azimuth device to do, then you do not need another gizmo to control its raising and lowering. There is a servo control instruction for the Arduino which not only sets the direction and speed of moving the servo. but also halts execution of the programme until the servo has got to where it should be. So two lines of code will do what you need.


Search VarSpeedServo


Barrie

Got it Barrie, a pretty neat solution.

Hi Brian,

There's what I think is a ready made option, engel produce an RMR module for the dive plane retracts on submarines. It stops the servo controlling the front planes from operating until they're unfurled.

Thank you Tom, I'll have a look at it, but as Barrie's solution above falls into line with the rest of the operation which is controlled by Arduino, I think I'll be going with that.
Title: Re: Servo control question
Post by: g6swj on June 04, 2016, 09:17:54 am
Brian,

I think you are on the lines of having one Arduino function that controls both park and raise/lower positioning sequentially

Logic something like:

Action lower: if in park/ lower / switch on user rotation control
Action raise: disable user rotation / go to park position / raise

You could add proximity sensors ( micro switches/hall sensors & magnet etc) to check both raise/lower & park positions all attached to the Arduino analogue ports and add these sensor state checks into your Arduino function.

Also you would want to trigger this sequence from your TX - again Arduino attached to RX channel allow this. All possible with Arduino board costing less than £6 although I appreciate you are using a Mega. Your project sounds very complicated - I would suggest you may want to consider multiple Arduino's to separate out some of the functionality.

Have fun and keep us updated on your progress

Regards
Jonathan
Title: Re: Servo control question
Post by: Brian60 on June 04, 2016, 02:03:13 pm
Spot on with that analogy Jonathon. I have two Arduino's the mega I bought just to control the azimuth unit - 9 degrees of freedom etc, except the imu I'm considering is 11 sensors! plus the Uno to interpret other units on the vessel, although I'm thinking another Mega for the analogue inputs/outputs would be better than the Uno
Title: Re: Servo control question
Post by: Brian60 on June 04, 2016, 05:43:27 pm
Well I guess it's going to be a 9 DOF IMU with a seperate GPS chip. I cannot find an IMU that combines the accelerometer, magnetometer, gyroscope and the gps on one board. But I digress from the original question I asked.