Search the Community

Showing results for tags 'esp32'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Frontpage, Forum Information and General LEGO Discussion
    • Guest Section - PLEASE READ BEFORE YOU REGISTER!
    • New Member Section - PLEASE READ BEFORE STARTING!
    • Frontpage News
    • Forum Information and Help
    • General LEGO Discussion
  • Themes
    • LEGO Licensed
    • LEGO Star Wars
    • LEGO Historic Themes
    • LEGO Action and Adventure Themes
    • LEGO Pirates
    • LEGO Sci-Fi
    • LEGO Town
    • LEGO Train Tech
    • LEGO Technic, Mindstorms, Model Team and Scale Modeling
    • LEGO Action Figures
    • Special LEGO Themes
  • Special Interests
    • The Military Section
    • Minifig Customisation Workshop
    • Digital LEGO: Tools, Techniques, and Projects
    • Brick Flicks & Comics
    • LEGO Mafia and Role-Play Games
    • LEGO Media and Gaming
  • Eurobricks Community
    • Hello! My name is...
    • LEGO Events and User Groups
    • Buy, Sell, Trade and Finds
    • Community
    • Culture & Multimedia

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


What is favorite LEGO theme? (we need this info to prevent spam)


Which LEGO set did you recently purchase or build?


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Country


Special Tags 1


Special Tags 2


Special Tags 3


Special Tags 4


Special Tags 5


Special Tags 6


Country flag

Found 2 results

  1. Technic Control (TC) from 1986 is - at the very least - absolutely fascinating (to me). It was when TLG wondered into (electronic) robotics ... Evan Koblentz (@evank on EB), his website is http://brickhacks.com/, has assembled the most comprehensive resource available regarding TC - and it still grows ... a wonderful place to be. Thus nothing better to begin this thread with a spoiler … The project idea Building an “autonomously” operating, programmable “robot arm” constructed with original Technic Control (TC) LEGO elements (bricks, plates, 4.5V lamps and motors, interface A, all from 1986 – 1988) and PoweredUp (PUp) LEGO elements (hub, motor; from 2019). Most importantly: TC “interacts” with PUp in a way that TC tells PUp when to move the trolley “left/right” to pre-programmed locations consecutively , while operating “up/down/turn L/R, and grab/release” of the arm by itself. This thus requires 4 motors and TC cannot do that without help, as the interface A has only 3 reversible polarity motor outputs. See below for hardware/software details. What does this combo do? The robot arm [building instructions provided by @alexGS; shown here in a video on his YouTube channel (https://www.youtube.com/watch?v=xLENEktsZdQ)] “quasi-autonomously” exchanges the storage locations of two “parcels”, using three pedestals on a stand and a trolley: (Left) Lord Darth Vader checking on PUp stuff; (right) Captain James T. Kirk checking on TC stuff; (bottom) MK stand + some TC and other LEGO bricks + 4.5/12 rails + 3 pedestals. Trolley: pulled with a “run-around” chain by a PUp medium linear motor on the left (color/distance sensor not used); (back) PUp Technic hub, powered by the permanent ≈ 4.0 V output of interface A using a small DC/DC converter in the hub’s battery box, see below; (top left) interface A powering the three 4.5V motors of the robot arm and the three 4.5V lamps in the base; (top right) ESP32 Dev kit + opto-coupler board connecting to output A of interface A, Arduino serial to parallel converter, RS232 cable to Win11 laptop (not shown); (center) robot arm, design by @AlexGS). Further to the right is the XT (not shown). “Quasi-autonomously” because instead of a LEGO PUp hub or PBrick of any kind, an IBM XT running PCDOS 3.3 and QuickBasic 4.5 is the brain behind the TC hardware – and I simply failed to get the XT moving on the trolley as well :D Why such a weird project? a) I wanted to show that TC can interact with PUp with only modest and cheap 3rd party elements used; b) wanted to use original LEGO TC ABS elements mingled with modern LEGO ABS elements plus some MK ABS elements; c) love to bring together vintage and modern electronics, particularly from TLG as they >never< show(ed) us how to accomplish this, and d) because I am simply running out of space up here in my attic and can’t do much more other than rotating something rather small by 180 degrees on the spot :D Did some remodeling up here lately to accommodate an original IBM XT (this one from 1985) – and these monsters do consume some room. Even worse, in the setup shown in the above figure, for a full 180 degree turn of the arm, it needs to be a) in the upper position, otherwise it crashes into a shelf; and b) the arm also needs to be moved laterally when turning, otherwise it crashes into a pedestal :D Space … the final frontier … Here is a short (and very boring video) of what the robot arm does – it was way more fun to bringing those two LEGO programming worlds together than taking that video. More on that below. (Video does for some reason not load - it does on YouTube: Just click here: https://www.youtube.com/watch?v=-6WI4i-TcYs) LEGO Hardware used One version of the robot arm (grab/release, up/down, turn left/right) is depicted in one of the LEGO Dacta booklets coming with set #1092; however a >much improved< version was provided by @alexGS. I would not have been able (zill!) to build the robot arm without a ton of help from Alex. The turn table’s (the arm is mounted on) instructions are available as building card in Dacta set #1092. The simple trolley I made is pulled back and forth using the small LEGO chain elements and is operated by the LEGO Technic hub and a PUp tacho motor (see below). The trolley runs on dark gray LEGO plastic train rails. And oh boy – the rails are affixed to the base of a stand for the MK Flying Dutchman … for fun I added three LEGO 4.5V lights to the stand’s base – just for show, nothing else. Well, not exactly: It shows that the outputs of #9750 can drive much more than one 4.5V motor each … Up/down, rotation left/right, and grab/release of the arm is done with three #6216 4.5V motors, #9750 interface A, the XT (+ LEGO #9771 ISA bus card) running PCDOS 3.3 and a compiled MS QuickBasic 4.5 (1988) program I wrote for that purpose. So in essence most of the stuff used to build and operate the arm is about 35 years old; the stuff to pull it back and forth is from 2019 onwards. The Technic hub is powered from the permanent 4V DC output of interface A with an additional DC/DC converter: As said, the lateral motion of the robot arm is done with a trolley moving on 4.5/12V type LEGO rails, operated by the linear medium PUp M motor (#88008), hooked up to a 4-port PUp Technic hub #88012. An ESP32 Dev kit board running Legoino is used for controlling the PUp devices; there is also the PUp remote (#88010) for manual trolley operation and PUp program control. I cannot (and don’t want to) get used to the LEGO PoweredUp app. After all, this stupid app >always< crashes, when operating TLG’s very own #88008 motor in tacho (PID) mode – even after TLGs 4+ years of app development … Other electronic hardware employed It turned out that using the ESP32 Dev kit/Legoino hard/software combo was (again) a fortunate approach as I was too dumb to use the LEGO PUp color and distance sensor (#88007) to simply sense light on/off. The TC and PUp brains are thus synchronized via an opto-coupler (4N28, already referenced in this book from 1983, we have to keep it straight on the vintage front ;) http://www.bitsavers.org/components/motorola/_dataBooks/1983_Motorola_Optoelectronics_Device_Data.pdf) hooked up to the ESP32 board, in accord with the interface A electronic layout philosophy, which also uses opto-couplers (2x LTV 487 M; 4 couplers in each chip) for separating the circuitry of the control computer/interface card from the power lines of the interface A. In my setup, one of the 3 motor outputs of the interface A is wired via a bridge rectifier (because forward and reverse need to be sensed) and a 470 Ohm resistor to the photo diode of the 4N28. The photo transistor goes low when the diode is turned on; thus the corresponding ESP32 input is tied to VCC(+3.3V) via a 1kOhm resistor. This little PANT board (I made that PANT thing up of course, Arduino’s have SHIELDS, Pi’s have HATs …) is riding directly on the pins of the ESP board: Total cost here, including the ESP board, is about $15. I used 4.5V wires (#766c96) with 2prong connectors, took off one connector and soldered Dupont connectors to the bare wires, which attach to the corresponding pins on the PANT board (interface A <=> ESP32 connection). See below for some programming hints on that; essentially, the ESP notices even the shortest low-level pulses on its inputs; I simply very briefly turns on/off the corresponding interface A output, so that neither a motor nor a 4.5 light bulb (visibly) notice that at all, but the ESP does. Well the ESP is more than 30 years younger than the other old farts :D The computer running QuickBasic 4.5 (or QBasic 1.1) or TC Logo controls the LEGO interface A. The interface in turn “controls” the LEGO PoweredUp Technic hub. Well, not exactly true: It signals the state of one of its outputs to the ESP32, which runs Cornelius Munz’ simply wonderful Legoino (https://github.com/corneliusmunz/legoino) software, which then provides bidirectional access to PUp devices, i.e., the Technic hub and the PUp remote. The PUp remote is only used for moving the trolley into its starting position and then telling the hub to listen to what the ESP is telling it to do. It can also be used to simulate light events etc. A note on the PUp environment: The tacho motor has a very high rotational resolution on the built-in encoders – way more than the TC encoders, but the principle is exactly the same: With the TC elements, you actually learn how that works; with PUp it is an icon in the app – or some code in Legoino. Nevertheless, the high precision, along with the built-in ramping routine, the speed is going up/down in a very controlled fashion, and results in absolute smooth trolley motion. Software Computer hardware controlling the interface A may be a modern Win11 machine, a semi-vintage machine running Win98 or the like, or a true vintage machine, e.g., an IBM XT, I am using frequently for such experiments. This >35 years range of computers smoothly operating the interface A became possible after Alex paved the road by partly disassembling the original TC Logo software from 1986-89 for PC’s running DOS and creating two new versions: One that does I/O via the parallel port LPT1 (TCLogo_p) and one that does I/O via the serial port COM1 (TCLogo_s). Both DOS executables are provided on his Bricksafe pages (https://bricksafe.com/pages/alexGSofNZ/interface-a-tc-logo). The original TC Logo for IBM PCs running DOS uses a LEGO parallel interface ISA card (#9771) with its own address for I/O. In this EB thread, there is a little documentation on the efforts of Alex and me regarding running TCLogo on modern computers: Why all these efforts? Simply because people like Alex and Evan and most probably many others like to run original vintage LEGO electronic hardware with the original LEGO vintage software. That’s all there is. Running the software alone on a modern computer is not an issue; there are many (DOS) emulators out there, some tailored towards playing original vintage games, others to actually mimic the functionality of a vintage computer. However, modern PCs/laptops don’t have any “true” serial (RS232) or parallel ports anymore – they do almost everything via USB. Nor do they have any means of providing 8-bit ISA bus functionality – at least not at an affordable price – if at all. I am pursuing another route: I want to run QuickBasic 4.5 / QBasic 1.1 in an emulator environment, and write my own BASIC code on a Win11 machine. Then transfer the program to the XT and run the robot arm from that computer. The DOSBox-X emulator is perfectly suited for this task, as it also provides access to COM ports on the host computer (laptop) as per configuration file: serial1 = directserial realport:COM1 COM ports are “created” using e.g. an USB2Serial or USB2TTL adapter; they are showing up as such in device manager. Why not using the XT directly for program development? For one, an XT with 256 kByte memory cannot run QuickBasic 4.5 but surely compiled QuickBasic com/exe files. QBasic 1.1 in turn runs on a 256kByte XT, but cannot compile files; it runs them directly. Furthermore, a laptop is mobile, an XT is not. A modern laptop is quite fast – an XT is not. A modern laptop has a flicker free display, an XT has not … yeah, we got “softer” over the years … and older for sure … The last thing required to operate interface A is a fast enough serial to parallel “converter” to operate interface A through an USB channel into DOSBox-X and further into QuickBasic. This is a very simple task for any Arduino device; even an Arduino Nano can do that. I made such an “interface”: Serial to 8bit parallel, 6 output, 2 input lines, as shown again here: And finally the program codes, most probably full of bugs, but they run smoothly so far; my Bricksafe page is here: https://bricksafe.com/pages/Toastie; direct download links: QuickBasic 4.5/QBasic 1.1 program (9750 control/robot arm program): https://bricksafe.com/files/Toastie/lego-interface-a---9750---9771---tclogo/tc-meets-pup/Q9750_9.BAS Legoino (C++) source code for the trolley (Technic hub + tacho motor + PUp remote): https://bricksafe.com/files/Toastie/lego-interface-a---9750---9771---tclogo/tc-meets-pup/DactaArm_V2.ino Arduino Nano serial to parallel code (C++): https://bricksafe.com/files/Toastie/lego-interface-a---9750---9771---tclogo/program-files-/9750_Parallel2Serial_Interface.ino I am very happy to provide more info on the programs, but I guess I am the only one doing this weird stuff in BASIC … and I just keep it here for future reference. Updates will also go here. All the best, Thorsten
  2. Dear All, the Crocodile (#10277) made me change my mind: Before knowing about the set, “no more trains” due to “no more space” on my layout was directing me to other LEGO related activities – mostly concerned with improving things on the layout. Which is – hmmm – nice but … So 10277 was announced and it was 2 minutes after it appeared on the German S@H website that I ordered it. It arrived 2 days later and was built the very evening. Folks on EB and elsewhere reported way earlier on improvements – I copied that and added my own ideas. So the Croc was there, now it needed an appropriate display – with no space on the layout … Solution: Mount some track to the wall (https://www.eurobricks.com/forum/index.php?/forums/topic/179240-mod-10277-and-on-and-on-another-crocodile-mod-%E2%80%A6/). Used my cell phone to make it go back and forth, thought about automation. And then Cornelius Munz’ Legoino software, which allows connecting to and control PoweredUp (PUp) servers (my understanding is: currently the 2I/O and the Boost hub) got me all excited. The hardware platform supported is the ESP32 line of devices. Several solutions have been already presented here on EB in the Mindstorms forum and elsewhere, sorry for not providing references here. My take on learning that ESP32 boards can connect and control PUp hubs was: They cost less than 10 € a piece, have ample of memory and – coming from the “3(+) inputs/3(+) outputs” world of LEGO intelligent bricks (RCX, SCOUT, NXT, EV3) as well as PUp (4 Control+/6 Spike) – there are almost “uncountable” I/O pins on these boards. Make it 20+, depending on the board. In conclusion: One dedicated ESP32 board for one single PUp hub is hardly affecting my LEGO budget … and no cell phone or tablet device is required at all. And here we go. The idea is: The Crocodile goes back and forth on elevated track mounted to the sloped ceiling of my room. See above link. The endpoints are defined using sensors, otherwise timing errors may add up – and a crash at about 1.5 m height may result in severe damage … There should be a defined acceleration and deceleration phase – and not just full blast ahead and full stop at the distant and close terminal. One possible solution is: 4 sensors are detecting the position of the Croc: Endpoint right, endpoint left, deceleration points in between. This is what I have implemented in terms of a stretch of track consisting of curved and straight tracks to show the Croc’s abilities, and a C/C++ program using a jOYiT ESP32 nodeMCU (with 30 pin GPIO exposure), four line-tracking TCRT5000 based sensors from keyes; looking upward from the track sleepers, the Arduino IDE, the ESP32 libraries/programmers for the IDE, Cornelius’ Legoino libraries to access the 2I/O hub of the Croc, a small 128x64 OLED display from jOYiT to show the status and what is happening, the Adafruit libraries for the display, and four push buttons: Go left, go right, start/stop, emergency. Solution/workflow: Power-up ESP32. Wait for Croc’s 2I/O hub to be turned on. When not at “initial” Start/Stop position (i.e. at right sensor), use the Left/Right buttons to locate the Start/Stop position; pressing the buttons move the Crocodile at low speed as long as they are pressed. When the Start/Stop position is reached (i.e., the right detector fires), both buttons are disabled and only the Start/Stop button is enabled – the Emergency Stop button remains always enabled. Press Start/Stop once: Make one return trip. Press twice: Do that indefinitely. The button “surface” shown on the display lets you know the mode: Open circle around Start/Stop: Loop forever; inverse colors (white background/black letters): Loop only once. Emergency button: Full stop (issued 4 times to be sure) and return control to Left/Right manual control buttons until Start/Stop position is reached again. The OLED display further always shows the battery level and the BLE signal strength. That’s it. Here are a couple of photographs (video may follow – but I guess you guys are getting the idea from the images). Crocodile and Controller … it says “Turn on Crocodile” and scans the 2.4GHz radio signals in the room – when pushing the PUp hub’s on/off button, Legoino connects to the hub with the correct ID. The controller’s front panel. Left to right: 128x64 OLED display using I2C communication using only 2 GPIOs of the ESP32 board!), button “Go left”, button “Go right”, button “Emergency”, button “Start/Stop”. The LEDs below the buttons, left to right: “PWM applied when going left”, “PWM applied when going right”, “Emergency (or attention)”, “Running”. The brightness of the left/right LEDs are controlled by GPIOs configured for PWM mode. Top left: Display shows “Locate Start Position”, this means Crocodile’s right rail guard is not aligned with the right stop sensor. Pressing the button "Left" or "Right" slowly move the Crocodile. Top right: Rail guard aligned with the left stop sensor: The display changes to “Start/Stop”. The red “ramp” is for safety reasons only; so far not used once. Upon letting the Crocodile moving onto the ramp at full speed, it slides up and the driving wheel lose contact with the rails. Bottom left: Pressing "Start/Stop" fires the run sequence: Accelerate to max speed with given time intervals, when the left "slow down sensor" fires, decelerate to minimum speed and then stop when the left stop sensor fires. Wait for two seconds, accelerate and do the same thing with the right sensors. Stop at right stop sensor when Start/Stop button is pressed only once, repeat the sequence indefinitely when pressed twice. Bottom right: The LEDs brightness as well as the display values show the current PWM power applied to the motor. Close-up of the sensors used (top) and the Croc's rail guard triggering the sensor. Couple of images showing the brick-built case. Bottom right: I glued a 2x2 tile onto the ESP32 – this secures its position when assembled. Some soldering and mounting details. The sensors need 3 wires: 3.3V, ground, and signal. There is an 8 wire cable hiding behind the track: An USB power supply delivers 5V/GND to the ESP’s "Vin" pin. The ESP in turn delivers 3.3V/GND to the sensors. 4 wires are used for the 4 sensor signal lines. TO-DO: The acceleration and deceleration phases are programmed as a “ramping” routine with defined power step size (5% PWM) and dwell time per step (300 ms). Minimum "moving" power is 25% PWM as the Croc stalls otherwise. Maximum power is 80% PWM. This is OK but not “cool”. Cool would be to program the 2I/O hub upon startup with acceleration and deceleration profiles. The firmware/LWP3.0 protocol allows to do that – but this feature is currently not implemented in Legoino. Secondly, using the LPW “speed” instead of “power” LPW commands would invoke the PID controlled motor operation. I did that already with my VB6 code – works beautifully well: At speed “5” the Croc negotiates the curves and straights at almost constant – well – speed. This is not possible with “power 5” – it just does not move at all. This works of course only with PUp motors with internal rotation sensor – the PUp L-motor in the Croc features that. But again: This is not implemented in Legoino yet. Will be available at some time in the future though! Happy to share code, but this is a (very) “tailored” project. Best wishes, Thorsten.