![]() I tried to supply the radio from a clean power supply, and that seemed to fix the problem at first. Maybe the Raspberry’s noisy supply voltage causes frequency interference? After all, the voltage from Lego rechargeable battery box, that is initially clean, coming from two LiPos, goes first to a 5V switching regulator, and then to Raspberry’s internal 3.3V regulator, before reaching the radio board. I tried it, but this time it had no effect. Maybe extending the antenna will help? In my earlier submarines I added a longer antenna and increased the range from 7 to 10 meters. I had tested it before disassembly, and the range should be 7 meters. When I got to test the radio inside the hull, with Raspberry and all other parts running, I noticed the range was only 3 meters. That took care of it – the radio worked always after that. SecsSinceRadioReset = (perf_counter_ns() - prevRadioResetTime) / 1e9 If (buttonDive.value = 1 or buttonForward.value = 1 orīuttonBackward.value = 1 or buttonLeft.value = 1 or buttonRight.value = 1): # to fix it, we will quickly power off and on the radio every 9 secs # after 10 secs of silence it will make the surface button to not work # the radio board has an auto-surface safety feature The power is cut off for one loop interval, 25 ms, which is long enough to reset it. Or more precisely, after 9 seconds of not pressing any buttons, since I can detect all button presses in code. I put a code to reset the board very quickly every 9 seconds. Since I’m powering it through Raspberry GPIO pin, I can control when to power it. Otherwise the surface button was dead.Įventually, I came up with a brutal idea. What made it worse, if the auto-surface thing was turned on only for a moment, you would need to press dive button once to reset it. It worked most of the time, but sometimes the surface button still stopped responding. I connected the switch wire to Raspberry and put code in to trigger it every 5 seconds, to make the board think it is at surface. The auto-surface feature is waiting for the ballast to reach the limit, and then it will stop driving the motor. □ The ballast has limit switches to indicate when to stop driving the motor. The little toy submarine has a piston ballast, like I’m making here. First I reverse engineered the operation principle. I spent a lot of time trying to bypass it. This is a new feature in this brand of toy submarine, which is why I hadn’t noticed it in previous submarine projects. When no buttons are pressed within 10 seconds, the submarine will automatically rise to the surface. The manual calls it “automatic lifting function”. The surface motor wire would turn on apparently by itself and the surface button stopped working. While testing the board, I kept having problems with the surface button. If modeButtonStep != 0 and (perf_counter_ns() - prevModeButtonTime) / 1e9 >= 1.5: Three button presses in a certain order in 1.5 seconds to change the mode. The only way I can think of is to use button sequences. to empty the syringe after dive.īut the radio transmitter has only 6 buttons which all have a function already. Also, I need to be able to bypass PID control and drive syringe directly, e.g. The PID can be controlled using a pressure sensor or a laser distance sensor, so I need to change between those two. I first created Button instances for all the GPIO inputs and one output for powering the radio.īuttonSurface.when_pressed = buttonSurface_pressedīuttonSurface.when_held = buttonSurface_held I added a DuPond connector to it for testing different antennas. The blue wire on the left is the antenna. 6 wires for buttons, one ground wire and one power wire. Then I connected the wires to Raspberry GPIO pins. ![]() Great, I can connect them directly to Raspberry. I measured voltage from the radio board motor wires that I’m using to read button presses. Connection to Raspberryįirst I checked if I need pull up/down resistors to protect the Raspberry. It was around 7 meters regardless of supply voltage. I also verified that the control range was not affected. That means I can use the Raspberry Pi 3.3V output to power up the radio board. I tested it using an adjustable power supply, and found the minimum voltage that made the board function to be 2.3V. It would make recharging the submarine easier, as there would be only one battery on-board.īut does the radio board work with voltage other than 3.7V it it designed for? Now I wanted to remove that and use power from the Lego battery box. In previous submarines I’ve supplied the radio board with a LiPo battery. Here is a closeup of the board from both sides, after I removed the big green cylinder that was a LiPo battery. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |