Shop OBEX P1 Docs P2 Docs Learn Events
Static depth control model submarine with Fuzzy logic? — Parallax Forums

Static depth control model submarine with Fuzzy logic?

Rob v.d. bergRob v.d. berg Posts: 89
edited 2009-06-12 04:57 in Propeller 1
Hi,

I·have a question about a Fuzzy control, here my problem.

I have a submarine model, 1.65m·(Dutch Walrus class)·and about 30kg. To dive, there is a maintank and two trim tanks (pistons with feedback), air compressor, electronics and two Prop's.

One big·challenge is to 'hang' (float) in the water·(without speed). A pressure sensor gives me the depth within 1.3mm. There are two PID inside·one for high and one·for controlling the speed·(cascade). So to get the right PID settings,·is a hell of a job (like the·DanceBot?).
The problem is to controll the speed (horizontal) of the submarine under water within some cm's (1 or 2),·by·controll the pistons.

I bought viewport·and i'm looking at·the Fuzzy logic module, for control the static depth of my submarine. The Lunar lander has also high and speed to control. When i looked in the·code, it is not·so easy to translate.·PID has·setpoint, measure value, gains·etc.

I'm new to Fuzzy logic, and·i do not know if this is realistic to do with Fuzzy, and what·is the best way to start. There are all kind of classes and maps....

I have:
Setpoint depth: 0-3000mm
Sensor 2 bar ABS:·integer·value within 1,3mm resolution
Speed: max speed must be < 20mm/sec (approximately)
Two·Pistons·each 400ml/0.2gr per step (resolution), controlling·by sending an integer between 0 and 2000 to the driver of the·pistons, moves the pistons to the right·position.

Any ideas·to start?

Regards,
Rob.





··

Comments

  • HannoHanno Posts: 1,130
    edited 2009-06-12 01:30
    Hi Rob,
    Fascinating what people are doing with their Propellers!
    This problem does sound similar to the balancing problem I encounted with my DanceBot. Turning a single PID loop is relatively understood and doable even with trial and error. However a cascading PID is much harder- at least for me. I ended up combining the cascading PID loop with fuzzy logic to solve my problem. So, I was still using the basics of PID: I have sensors or values for the proportional, derivative, and integral error relative to a target setpoint. They get combined to produce the feedback. I used fuzzy logic to preprocess the values into fuzzy classes.
    Sorry, it's not easy...
    Hanno

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Download a free trial of ViewPort- the premier visual debugger for the Propeller
    Includes full debugger, simulated instruments, fuzzy logic, and OpenCV for computer vision. Now a Parallax Product!
  • LeonLeon Posts: 7,620
    edited 2009-06-12 04:57
    I'd model it first with Scilab (free) or MATLAB (expensive). Scilab has a fuzzy logic toolbox and PID functions.

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
    Suzuki SV1000S motorcycle
Sign In or Register to comment.