Jump to content
THIS IS THE TEST SITE OF EUROBRICKS!
THIS IS THE TEST SITE OF EUROBRICKS!

Featured Replies

Posted

Hi! I want to share with you results of my recent works, which you may find interesting/useful:

  1. Motorization of 42164 Off-road Buggy with Circuit Cubes
  2. Web-browser remote control for Circuit Cubes supporting return-to-center steering.
  3. Controlling Circuit Cubes using Lego remote with smartphone as hub.

1. Motorization:

Despite the small size of Circuit Cubes squeezing Bluetooth Hub and two Cubit Motors into 42164 Off-road Buggy was quite a challenge, but it turned out to be possible - you can see results below:

In case you wanted to build the model (free instructions available at rebricable.com) or use CC to drive your own MOC here are some notes about challenges and their possible solutions:

A. Rear drive for 42164

There is not much space at the rear of 42164 - initially I hoped to put hub and motor symmetrically but it was impossible. Transmission of power from the engine to the wheels can be done using 3x 16-tooth wheels, but the resulting buggy speed was a bit low (wheels with small diameter do not help here). The solution that kept neat arrangement of the hub and motor was to use new 20-tooth and 12-tooth gears and chain to gear up the drive. It might be possible to swap hub and motor and move hub 1 stud to the bottom, to use 24-tooth and 8-tooth gear for further speed-up, but this reduces access to hub on-off switch. The power of cubit motor is absolutely sufficient (someone used CC to drive 42128 :pir-oh:), the only thing which can stop the buggy is extremely poor grip of the wheels.

B. Return-to-center steering

Fortunately putting motor in the front of buggy was quite easy, contrary to making working return-to-center steering. As this can be useful for somebody, here are a few approaches that didn't work, and the final one, which does:

  • First idea was to keep original way of steering 42164 by leaning it left or right with use of the motor directly moving the front axle. This does not work, as the rear spring in buggy is too strong and rotating front axle to one side rather moves the entire front of buggy up, than leans it to the side.
  • Fixing front axle horizontally (no more leaning) + 1x4 gear rack +16-toooth gear to steer the wheels and two rubber bands to return them to center. But Cubit Motor when not powered is practically impossible to rotate even by hand, so no rubber will make it move. I tried to use 16-toooth with pin-hole instead of axle-hole to make clutch, this would, however require to have rubber bands weak enough to allow running motor to steer the wheels, but strong enough to return wheels to center, when motor is not powered. I don't know if this is possible even in theory, but even if it was, finding proper rubber bands would be probably hard.
  • As the mechanical return-to-center was hard to implement, other option is to do the steering to remote control side. Since the original CircuitCubes app does not have this feature, I decided to write custom remote control application using HTML/JavaScript, which would allow to use in in the web-browser in smartphone. But here comes another problem: Cubit motors do not have rotation sensor and rotating the motor by given angle requires powering it for precisely determined time interval. The required precision is of order of a few milliseconds and... it some times works, but sometimes not exactly. To reduce impact of this imprecision I used 8-tooth gear instead of 16-tooth, but still there were annoying situations where centering failed.
  • So the question was: how to make return-to-center which would ignore small errors of the motor rotation angle? Solution is to make some part of the rotation idle and affect the position of wheels only when the angle of the motor's axle is big enough. The motor has attached thin 3-beam, which after some rotation touches the tip of 85x85p.jpg?1658325742.9837854, moving the wheels (see picture below). When it retracts towards middle, two 85x85p.jpg?1658325749.2477865 elements center the steering rod. Misalignment due to rotation error sometimes happens, but it is rare enough to not to spoil the fun.

400x222.png

2. Web-browser remote control for Circuit Cubes supporting return-to-center steering

The app allows to control 2 motors using Circuit Cubes Bluetooth Hub, the code is available in github repo. You can select channels where motors are connected, revert the direction of rotation (as it also depends on how connection was done), and adjust the speed of motors. Default setting of steering motor speed (125) make it strong enough to move the wheels steering rod and counter the rubber connectors, and slow enough to allow precise movement for the defined return time (90ms).

400x556.png

3. Controlling Circuit Cubes using Lego remote with smartphone as hub.

As you can see the application has additional button to connect Lego remote. It turned out to be possible to implement small subset of Lego Wireless Protocol, just to receive button events. This allows smartphone to be a relay for communication from Lego remote to Bluetooth Cube. The only drawback is small delay, but it is not very noticeable. I am mentioning this topic separately, since my adventure with programming Circuit Cubes started from a thread on Lego Train Tech forum, where such relay was made using C++, Legoino and M5 Atom microcomputer (thanks for sharing your code @Asper!). It wouldn't be much work to expand my current application to control trains, and smartphone as a main hardware is more accessible than M5 Atom. If somebody would like to do it I am open for cooperation.

 

image.jpeg

image.jpeg

Edited by Repkovsky

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Recently Browsing 0

  • No registered users viewing this page.
Sponsored Links