-
Posts
35 -
Joined
-
Last visited
Content Type
Profiles
Forums
Gallery
Everything posted by LabManager
-
@gyenesvi your understanding is correct. The PCB is used mostly for simplifying the wiring, and 4.8 mm holes are used to fix it on the vehicle (this is also an important function ) Everything else is done in the ESP32: with interrupts, read incoming PWM from pins connected to C1/C2, save LOW and HIGH timings in memory => calculate the rotation angle based on it => generate new signal for GeekServo (which is also PWM, but with completely different parameters). And this cycle is repeated continiously every 10 milliseconds. I don't think this can be done on a bare PCB with just basic electornic components, and some chip is needed anyway. I agree that the ESP32 is an overkill for a such trivial use case, and it could be implemented on some primitive chip like PIC, but that would require much more skills and knowledge than I have in electronics. Arduino is much easier to start with.
-
It’s been a while since I posted updates on this topic. Meanwhile, I think I’ve found the solution for most of my initial goals. These were the key features I wanted to have in my RC setup for LEGO: 1) Proportional steering (reason: it’s really needed to make a fast vehicle more controllable). 2) Using of PF-motors (reason: they are cheap and widely available). This goal is not fully met because I’ve chosen to use the GeekServo, but it is also cheap, and its quality is at least as good as 3rd party PF motors 3) Controlling the vehicle with a hardware gamepad without any kind of smartphone between the controller and the hub (reason: the less components, the better) And here is the list of the components I’m using now: 1) Mould King Power Module 4.0 is still the core component of my setup. This includes both the hub and the remote controller with proportional inputs. 2) Mould King Black L-Motor, which provides enough torque for a 1:16 car (however, I didn’t use it in the test vehicle for my demo videos, because they were shot indoors with limited space available) 3) The GeekServo for proportional steering 4) ESP32-CAM. It is not the smallest ESP32 board, but I thought it would be interesting to include realtime-FPV functionality. Can’t say this was a success, but it also works! 5) Custom PCB that acts as an adapter between MK hub and the GeekServo, implementing the logic which I described in the first post here. The PCB has 4.8mm holes so it can be fixed on a LEGO beam with 3/4 pins or axles. More detailed description, PCB files and Arduino sketches are available at my GitHub (https://github.com/pink0D/CameraBrick). I tried to use only commonly available components (even custom PCB’s can be also easily ordered nowadays), so I hope it will be possible to reproduce my work for anyone with basic soldering and programming skills. Some pictures of how it all looks like: And of course the videos: FPV demo GeekServo demo
-
Mini 42109 TG Rally Car - RWD
LabManager replied to N1K0L4's topic in LEGO Technic, Mindstorms, Model Team and Scale Modeling
Hi! What camera are you using for the FPV ? Can you share how you mount it on a such small car ? -
If you don't mind controlling an RC car with your smartphone, than BuWizz 3.0 + PU L motor is the most straightforward way for doing that. You can also use a gamepad, but in this setup it is paired with the smartphone, which then transmits your inputs to the LEGO hub, so there will be some latency (didn't measure it, suppose it is no more than some additional 10-20 milliseconds). Another option is BrickController2 app, it works the same way, but supports not only BuWizz, but also LEGO original hubs. However, LEGO Technic Hub with 4 ports is very heavy and bulky, while Lego Powered-Up hub with 2 ports is smaller, but if you connect one motor for steering then your buggy is going to be very slow with just one remaining PU L motor.
-
Hi, lagerratrobe! Well, it seems now that this topic should be renamed since it covers more of Arduino and schematics than just MK Servos. But I think it might be useful to collect such information, so feel free to ask any questions here. BTW - I moved the repo to another account, so please look at https://github.com/pink0D/TechnicPF. There are also some Arduino schematics for classic Arduino board (Pro Mini) and USB Bluetooth Dongle , but if you are ok with Arduino you can replace it with ESP32 (which has embedded BT). However, a lot of wiring is still needed to implement a custom controller. I didn't adandon the idea of making a custom PCB for that, but PCB design is really tricky for me.
-
You have a very interesting YouTube channel! I've found you video about controlling GeekServo 360 and it was very helpful. By the way, Arduino's library has these defines in Servo.h: #define MIN_PULSE_WIDTH 544 // the shortest pulse sent to a servo #define MAX_PULSE_WIDTH 2400 // the longest pulse sent to a servo For GeekServo 360 the limits should be 500 and 2500 respectively, but it still works fine. I'm not coming any close to these limits in my application, but does the Servo Library need to be modifed to use full rotation ?
-
GeekServo is fantastic! It gives so accurate control for my 4WD car now! If I knew about GeekServo before, the topic should be given a different name... However there's still a lot of work to be done (factory-made PCB, LiPo discharge protection, 3D-printed box, more functional software and so on, not to mention that my car needs a body too )))
-
Unfortunately I don't have an original Lego PF Servo to test MK 6.0 with it. But I guess MK can load different firmware versions to their hubs over the years. So you might have a "special" version of MK 6.0, which outputs the signal with correct frequency that works with Lego PF Servo and will also work with an MK Servo. And as MK 6.0 is a consumer product there should not be any problems with it. Anyway, the design of the product is up to MK and it's not opensource so we can only make assumptions. I agree with @gyenesvi that it may be intentional to dumb the servo down to 3 positions instead of letting it flutter which would be even worse Thank you for this suggestion! Didn't know about GeekServo, but it really meets most of my needs, so I've ordered it and now waiting for delivery. One tricky thing is that the GeekServo has 5V power supply, while PF is 9V, so my controller will require an additional DC converter taking some more space. For now, my prototype has become smaller and I've changed the overall design so it will not need the MK hub and controller any more: 1) Power will be supplied from external 7.4V LiPo battery with JST plug 2) USB BT 4.0 dongle allows to directly pair with PS4 controller (or any other which can make wireless connection by USB dongle, Logitech F310 is an example) 3) Outputs for 2x PF motors (4 pins, with hack for MK Servo) + 1x GeekServo (3 pins) + LEDs (3 pins) 4) Fits into 7x9x3 stud box (yet to be 3D-printed)
-
Hi everyone! I'm new to Eurobricks, so don't know if this is the correct forum for this topic. However I really want to share my recent findings about Mould King Servo Motor. I spent last weekend testing MK Servo Motor and MK 4.0 controller with a LEGO Technic MOC. MK 4.0 has a controller with analog sticks, so one can think that it supports proportional control for motors. However there are many controversial reviews about this on youtube/reddit/forums etc. It seems that proportional steering was supported by MK some years ago, but they dropped it (probably) due to problems with fluttering and quick battery drain. Part 1. Out-of-the-box MK capabilities Soon after receiving the order with MK components, my first findings where: 1.1) MK 4.0 does not currently support proportional steering with MK Servo Motor 1.2) MK 4.0 supports proportional power output to M/L motors I've also ordered MK 6.0, and it works absolutely the same way (the only difference is 6 outputs). So everything written below is true both for MK 4.0 and 6.0. This was of course very disappointing, because full left/full right inputs are not comfortable enough for controlling a fast moving Technic MOC. This triggered the beginning of my research. My hope was that if MK supported proportional steering in the past, then it could be controlled by software in some way. Part 2. MK Hub output The first thing I've done was looking at C1/C2 signals from the hub (since Power Functions is not a new thing, there's a lot of information on how PF Servo should be controlled). (Actually, before doing that, I've soldered dupont pins to a cutted PF connector cable to intercept the signal) This showed: 2.1) MK hub does output of PWM signals to C1/C2 wires with duty cycle proportional to the input on MK controller 2.2) The frequency of this signal is 470 Hz , which is 2 times lower than expected for a PF Servo Part 3. MK Servo input So the next obvious thing to do was to test how the MK Servo Motor performs when it gets a PF-compatible input signal. The original LEGO Power Functions components work at 1200 Hz, but there are many videos on YouTube showing Arduino-controlled LEGO servos, and Arduino's out-of-the-box frequency for PWM on digital pins is 980 Hz. To make this test, I've built an assembly utilizing Arduino Nano and L298N motor driver for making 9V output PWM signal (Arduino itself can produce just 5V with very low current). This showed: 3.1) MK Servo motor can rotate to intermediate positions, proportional to C1/C2 duty cycle of 980 Hz signal But, unlike LEGO PF Servo, which has 15 fixed positions and stops itself when it reaches specific position, MK Servo performs differently: 3.2) MK Servo does not have specific fixed intermediate positions 3.3) MK Servo does not stop in any of intermediate positions, which results in fluttering (even if when there's no noise in input signal) and, probably, higher power consumption as a result By the way, statements 2) and 3) are true not only for 980 Hz, but also for 1200 Hz signal, which I tried in hope that it will make MK Servo perform exactly as a LEGO PF Servo. Part 4. The PoC At this point I had an MK hub, which produced PWM signals at 480 Hz, and an MK Servo which expected 980 Hz. To solve this problem I've designed some kind of "frequency modifier", also based on Arduino. Please mind that this is a Proof-of-Concept, which needs to be made in a more compact way and to be more simple technically (Arduino seems to be over-engineering here). Anyway, what this PoC does is quite simple: 4.1) It intercepts the connection between MK Hub and MK Servo 4.2) It reads C1/C2 signals at 470 Hz from the MK hub (which are proportional to the inputs on MK Controller) 4.3) It outputs these C1/C2 signals at 980 Hz for the MK Servo 4.4) There are also some workarounds specific for MK Servo to solve fluttering and power consumption which I will not describe here as this post has already become huge - you can find them in sketch code here (the wiring diagram is also on github) https://github.com/igrolabs/ServoBrick The limitations are: - it has huge size (but I managed to perform a test drive of my MOC car with it) - the code is specific for Mould King - it is not working with other servo motors (I've also tried it with CaDa with no luck) - it can be modified to work also with original LEGO PF Servo (but I didn't do it) Part 5. So, what's next ? First of all, I would be glad to hear any of your feedback about this stuff. As for me, my thoughts are: 5.1) The test drive I've performed with my MOC car showed that there's little value in intercepting just the steering signal. 5.2) MK 4.0 controller showed to have bad sensitivity (6.0 was slightly better), which is not enough for precision steering 5.3) One possible evolution of the PoC can be in intercepting both steering and throttle signals, and to limit maximum steering angles when throttle input is high. This can make sense even when using MK controller 5.4) Controlling both steering and throttling signals results in bigger size of the "modifier box" and makes MK hub useless, so maybe it's more reasonable to develop a custom RC hub with battery, receiver and logic controller in one box. 5.5) Option 5.4 gives the possibility to use 2.4Ghz RC or PS4/PS5/XBox controllers, all of which have better sensitivity 5.6) It is unclear for me at the moment whether the PoC can be made small enough to fit in 1:16 scale MOC. 5.6.1) A hub bigger than MK 4.0 is not reasonable, because my overall goal is to build a fast 1:16 car with proportional steering, which requires use of currently available PF-compatible components (as you know, original LEGO PF Servo is discontinued). 5.6.2) There's already out-of-the-box solution (LEGO C+/PUP motors and hub + pybricks), but it is significantly bigger in size and can be fitted only in larger scale MOCs