Hello people,
Since I'm new here I'll give a little introduction of my project and finish this post with a few questions I run into in this project. Personally I'm more of a ship modeller then an electrision and programming is also somewhat new to me. I do start to understand qiute a bit of the programs that I have currently but when things don't work straight away I'm quickly at a loss as to how I can solve it.
Since I did an internship at a shipyard now 15 years ago I started building a model of the ship I worked on during this internship. The vessel in question is a diving support/ well stimulation vessel which is a mouth full for saying it makes sure that the drill and seabed piping around oil rigs are kept in good condition. This means lots of smaller cranes and 1 large crane, some form of drilling tower, fire monitors, lifeboats and 2 ROV's. Since I like to make all that moves on the real ship moving on my model I got to the point that I'm using a Raspberry Pi to control all these functions and also to transfer the commands for the lifeboats and possibly also the helicopter. That is the reason why I made an account here, I would like to keep track and ask for your help of the part of the project that can be considered (perhaps with taking the definition a bit loosely) robotics, ie, the electronics (including PCB's, I do design a few myself), programming and wiring and that both for the ship and the transmitter which is fully 3D printed and designed by me and is also Raspberry Pi powered.
The transmitter is made out of 2 parts, the first houses 3 joysticks for bowthruster control and 12 joysticks for things like cranes etc. Due to the large amount of functions that benefit from speed control the 12 joysticks have their functions multiplexed through a radiobutton on the 10" touchscreen, which in turn is used to control on/off functions, display the ships status (course, speed, engine RPM, rudder angle) and to display live videofootage from either of the 6 camera's on the ship (MotionEyeOS and some WiFi repeaters in bouys will make this possible) so I can attach a towing cable at about 1km range (maximum range of the 2,4GHz transceivers) with ease while also being able to sail the ship outside my view without hitting the first object that happens to lay in the ships path. Dynamic Positioning (ie holding position) will be the cherry on the icing for this project where I want to try to achieve the same accuracy as the real ship being 16cm, and I'm also thinking about position holding referencing a certain object like another shipmodel and oil rig or whatever though I'm not yet sure what form of localisation would be best in this instance.
The second part of the transmitter is ship specific, housing the primary propulsion controls, in this case being 2 azimuth joystick controls which I will 3D print myself and 3 switches so I can control the ship with either 1 of the joysticks or both joysticks where in the latter the left joystick will only control the left azimuth etc. An LED will indicate which joystick is currently active.
So now on to where I am now. The main part of the transmitter has some wiring problems causing the joysticks to not get any power and in terms of construction only the removable bottom plate and back plate need to be added (made fitting as both are currently too wide) and the reset button needs to be mounted such that it can actually be operated. The part for this model is in the process of rewiring from using potmeters including 10 turn pots for the rotation to using AS5600 sensors which measure the angle to 0,01degree accuracy without limitations to the number of rotations and either pots or also AS5600 for the throttle, depending on some design choice with regards to room avaible.
The model has most of the electronics component though my self designed PCB turned out to have a short circuit and will need a new order with this problem corrected, 1 of the 9DOF IMU sensors still needs to be purchased and I need another PWM module taking into account the additions I spotted on the real ship when I saw here last sunday. The I2C wiring and the transceiver is also connected. I made a somewhat complicated box (currently using the term quite loosely) in which the Pi, the first PWM module (a total of 6 will be used) and a PCB that I did design correctly and some circuitry to control the power to the Pi (basically the way a computer is turned on and off, I'll mention thi further in the question part later in this post) and this is opposite to the fuse box and directly ahead of the 12V 12A battery powering the entire ship.
In terms of used electronics I chose the Adafruit Motor Shields with I2C communication for the stepper motors and main propulsion engines. I use PWM modules for controlling servo's and also for controlling pumps for simulating cooling water from the ships engine rooms, for washing the anchors and for all firefighting equipment which will be fully controllable individualy though I'm not yet sure whether or not I will actually build in 6 main firepumps or if I'll use 3 with each 2 valves to control the waterflow. The downside of the valves is that these are almost as big as the firepump as well. For these pumps I use cheap ESC's capable of controlling 2 engines at the same time since these are powerful enough for the job and since the pumps will be running in 1 direction only I don't need any on/off outputs to control the direction. For the on/off functions I use the MCP23018 IC mounted on self designed PCB's, some with relays for powering heavy load functions. In total this project houses 8 MCP23018's, 3 of which will be used for randomly controlling the interior lighting with 32 LED's each feeding light to up to 3 cabins strategically placed to make it look totally random. Due to the PCB's coming in batches of 5 I also control 2 relays from the same MCP23018's as I use for the interior lighting.
Due to the complexity of this project I have an Excel document containing overviews of all functions and status of these funcions (wiring connected, mechanical, programming, testing and fully up and running), the pins on the controlling PCB it uses, which I2C adress the device has, which command each function requires, which libraries the Pi needs etc. Besides this I also have a planning which doubles up as my note pad for keeping track of all the different things I need to be mindful of.
Now on to the current problems I run into. First and foremost the problem with the power control for the Pi. Currently I have a timing relay and a latching relay . The timing relay should set the Unset pin to the latching relay but he Pi shuts down before the timer has expired. Because of the limited available room in the new main control box (with the current version I described earlier taking out the Pi for maintaince is near impossible when the deck is glued in place, the new version fits just through the opening in the deck and through the superstructure above it) I decided to try to make a better solution with a 555 timer though the design quickly went to a 556 so 1 half can be used as a latching switch for the relay also on the PCB and the other half as a timer to give the Pi time to properly shutdown before power is automatically turned off. The problem I have is using the timer to wait before turning the OUT high. See below the current design of the PCB, I still need to add some resistors and a capacitor, but I'd like to know how to make the timer delay the switching of the relay, have you guys got any thoughts on this? I will use this PCB both in the transmitter and the boat as well as all future projects.
Thanks in advance.
Greetings, Josse