PDA

View Full Version : Servo input / output



Garfield007
28-01-2006, 22:50
Hi Help wanted by a new be

I will describe what it is I would like to do first.
This is for a remotely operated underwater Vehicle (RoV)
All I require is to control the depth
I need to read a Radio control receiver output as a reference point (RP)
I then need to read a pressure sensor that has a output of 0-400mv (I might need to amplify this output to 0-5 volts) We will call this DS

I now need to look at the RP and compare it with the DS
If the RF is > DS then the servo needs to be increased by half the difference between RF and DS
If the RF is < DS then the servo needs to be decreased by half the difference between RF and DS
I have the Picaxe 28x and starter kit have tried to get my head around this but to no avail.


Then output a signal to the servo

Loop
Any suggestions are welcome

Any more information I can give …Please ask

Fowkc
28-01-2006, 23:38
Sounds like a fairly ambitious project to start out on PICAXEs with (that's not meant to discourage you!). I haven't used PICAXEs with servos myself, I imagine you'd have something like:

Pressure sensor input (0 to 400mV) --> Op-amp to amplify signal to 0 to 5v --> PICAXE ADC input.

Look up the READADC10 command for details on how to get the ADC value.

What is the radio link? (i.e. frequency, type..)

When you say "increase the servo by half" I guess you mean move the servo half of the difference (proportionally) between your reading and your reference, so that you end up with an exponential decay towards the reference point?

Edited by - Fowkc on 1/28/2006 10:41:53 PM

Edited by - Fowkc on 1/28/2006 10:43:45 PM

Garfield007
29-01-2006, 11:37
The receiver output is the normal for any receiver, 1ms to 2ms is the full movement swing with 1.5 ms being the centre.
READADC10 command That’s 1 that I have not tried yet :)Will do tomorrow when time permits.
"needs to be decreased by half the difference between RF and DS"
the reason why I need this bit is to stop the RoV pulsating up and down.

Thanks for the input 

BeanieBots
29-01-2006, 18:12
Sounds simple enough. It's more a question of getting the numbers into the right range to work with.
To read a standard servo signal you need the pulsin command. The units are 10's of microseconds so a center position (1.5mS) will give a vlaue of 150.
You should condition your sensor signals (op-amp or other methods) to give a signal that is 0-5v so that it can be read by the ADC using ReadADC.
Then mathematically, convert both to numbers that have the same full range. How this is done will affect the "gain" and hence stabilty of your control loop. Unfortunately, the exact requirements of that depend on so many factors such as the rate at which your ROV rises or sinks, it is impossible to advise on values. You will either have to experiment or do the loop sums based on your ROV's known behaviour.
The PICAXE's limitation with such calculations is that it can only do integer values of 16-bit. It might pay to do the sums on paper first and then convert to maths can be done by the PICAXE.

hippy
29-01-2006, 19:10
Running the 28X at 16MHz will provide a PULSIN resolution of 2.5uS, which gives 400 steps of 'servo' / transmitter positional control, and also allows faster calculations of any adjustment control.

Garfield007
29-01-2006, 21:01
A BIG thanks for the advice will now get Pressure sensor moded to output 0-5 volts this is not a problem.
then I will start to put it all together
btw the reaction time with the RoV is slow as it is for shallow water 10 Mtr max depth

Thanks to you all

premelec
30-01-2006, 16:47
Is your RF transceiver going to be under water - or floating antenna on surface? Sorry if I've misunderstood but IF you are using underwater RX/TX could need to use Low Fqy... Kite and baloon lofted antennas have also been used by submariners :-)

Garfield007
30-01-2006, 17:54
I will be using a unbiblical cable connected from the Transmitter to the receiver
Method below
To connect the transmitter to the coax:

1.Remove the antenna.
2. Attach the center conductor of the coax to the screw which the antenna was attached to.
3. Attach the outer conductor/shield of the coax to the ground of the transmitter.

To attach to the receiver:

1. On the end that attaches to the ROV, remove the outer conductor/shield the equivalent length of the extended transmitter antenna.
2. Coil the exposed center conductor and receiver antenna together. DO NOT CONNECT THE WIRES.(This needs to be inside the ROV.)
3. Connect the outer shield to the ground of the ROV.

You're now ready to transmit.
I hope this is what u wanted

BeanieBots
30-01-2006, 19:17
Many modern RC systems can do this without having to enable the RF at all. Check to see if your radio supports "Servo Test & Setup" via the power lead. You may find that a special lead is available that will plug into the power socket of the transmitter and the power socket of the receiver. This is how airplanes can be set up on the field without having to enable the transmitter. It also uses a LOT less power from the transmitter.

Garfield007
30-01-2006, 20:24
Yea but the distance is 5 mtr at max
This is too small for me


Edited by - garfield007 on 1/30/2006 7:26:57 PM

Garfield007
11-02-2006, 12:50
Hi again after a short time I have achieved what I set out to do WITH YOUR HELP of course. So just to say A big Thanks to those who Helped :) BTW the accuracy if approx 100mm witch is outstanding.