HectorMB

Eurobricks Citizen
  • Content Count

    272
  • Joined

  • Last visited

About HectorMB

Spam Prevention

  • What is favorite LEGO theme? (we need this info to prevent spam)
    technic
  • Which LEGO set did you recently purchase or build?
    42100

Contact Methods

  • Website URL
    https://rebrickable.com/users/HectorMB/mocs/

Profile Information

  • Gender
    Male
  • Location
    Switzerland
  • Interests
    Learn about basics and advanced skills for developing my own MOCs and enjoying from constructing other's MOCs.

Extra

  • Country
    Switzerland

Recent Profile Visitors

1032 profile views
  1. Thanks again! I'm not experienced with the language and I might have missed something. What intrigued me in first place was that the Mindstorms app has indeed an option to make a program including control via a ps4 controller, although I didn't try it (Yet). So, it might be that it can be done but going through a PC, tablet or smartphone (which at the end would make the role of the hardware such LMS-ESP32). So, I'm pretty sure that Anton is right and the only way to do this is with an intermediate hardware... Which can be the LMS-ESP32. :). It still intimidates me as I never jumped into something similar, but I guess there's always a first time! :D ps: a LMS-ESP32 is on the way...
  2. Thanks, it looks que interesting indeed. Nevertheless, i guess the main limitation, which makes the LMS-ESP32 necessary, it's because of the technic hubs. Nevertheless, given that the TLG MINDSTORMS app already allows the connection to a ps4 controller, the Mindstorms hubs should be able to connect without any add-on, right?
  3. Hello there! I did a little search but unproductive, so i leave the question here: is possible communication between hubs (with Pybricks firmware) and ps4 controller? If not, there's any plan to add this feature in the future? Thanks!!!
  4. Thanks! Using the new firmware it's pretty stable now. I'm doing now some test so each unit is indeed sending and receiving information (will see if I make it work!). But pretty happy now! Thanks a lot for the support!
  5. Thanks @Zerobricks! Regarding the 3- or 4-gears... How can I select one or the other? In some cases it doesn't even allow me to change gear, being fixed at gear 1.
  6. So, I tested one of my units in a que simple model with a four sequential gearbox. It was physically limited at the end and at the beginning of the gears. In first place I didn't manage to use the 4 gears but just 3. Moreover, when I shut down the model, the motor made a couple of turns with a lot of power which, literally, broke down few pieces that we're limiting the motor. I don't know if the motor was damaged itself. I read somewhere else that someone experienced something similar, but I cannot find it right now. I used the default profile and did not change any parameter. Any comment/solution?
  7. Thanks, I will take a look there! :) I'm just a beginner and, not educated into programing languages, and I just learnt by reading here and there ;). As you asked, I leave you a picture of the project itself, in case it helps: This is the program I run in the "Master" hub (The one located at the base) from pybricks.hubs import InventorHub from pybricks.pupdevices import Motor, ColorSensor, UltrasonicSensor, ColorDistanceSensor from pybricks.parameters import Button, Color, Direction, Port, Side, Stop from pybricks.robotics import DriveBase from pybricks.tools import wait, StopWatch from pybricks.experimental import Broadcast from umath import asin, acos, atan, degrees radio = Broadcast(topics=["INPUT"]) hub = InventorHub() BaseA = Motor(Port.A, Direction.COUNTERCLOCKWISE, ([1, 20], [12,60])) BaseB = Motor(Port.B, Direction.CLOCKWISE, ([1, 20], [12,60])) BaseC = Motor(Port.C, Direction.CLOCKWISE, ([1, 20], [12,60])) BaseD = Motor(Port.D, Direction.COUNTERCLOCKWISE, ([1, 20], [12,60])) Sensor = ColorDistanceSensor(Port.E) radio = Broadcast(topics=["INPUT"]) CalClaw = 0 info2=int(0) info6=int(0) print("Calibrate base? (Yes=LEFT, No=RIGHT)") pressed = [] while not any(pressed): wait (10) pressed = hub.buttons.pressed() if Button.LEFT in pressed: calibration = 0 BaseA.run(10) BaseB.run(10) BaseC.run(10) BaseD.run(10) dist=0 while calibration < 1: dist= Sensor.distance() print(dist) if dist < 50 : wait(200) BaseA.brake() BaseB.brake() BaseC.brake() BaseD.brake() wait(1000) BaseA.run_angle(10, -72, Stop.HOLD, wait=False) BaseB.run_angle(10, -72, Stop.HOLD, wait=False) BaseC.run_angle(10, -72, Stop.HOLD, wait=False) BaseD.run_angle(10, -72) BaseA.reset_angle(0) BaseB.reset_angle(0) BaseC.reset_angle(0) BaseD.reset_angle(0) wait(1000) calibration =1 hub.light.blink(Color.GREEN, [500, 500]) wait(3000) if Button.RIGHT in pressed or calibration == 1: info1=int(0) while CalClaw == 0: print("Close Claw (0 to 5000, Close: Neg, Open: Pos):") Adjust=int(input()) info2=int(0) info3=int(0) info4=int(0) info5=int(0) info = Adjust, info2, info3, info4, info5 radio.send("INPUT", info) if Adjust == 0: CalClaw = 1 print("Claw Calibrated (and closed)") while True: print("Distance in coordinates, X:") X=int(input()) print("Y:") Y=int(input()) print("Z:") Z=int(input()) if X == 999: print("Claw (5000= Open; 0= Close):") info1 = int(input()) print("Wrist Torsion (Pos=Clockwise; Neg=Counterwise):") info2 = int(input()) print("Wrist Vertical (Pos= Up; Neg=Down):") info3 = int(input()) print("Elbow (Pos=Up; Neg= Down):") info4 = int(input()) print("Shoulder Vertical(Pos= Forwards; Neg= Backward):") info5=int(input()) print("Shoulder rotation(Pos=Right; Neg= Left):") info6=int(input()) info = info1, info2, info3, info4, info5 radio.send("INPUT", info) wait(100) if 0 < X < 999: A = 24.6 B = 20.3 f1=3.9 f2=8.6 Dist=pow(pow(X,2)+pow(Y,2),0.5) info6=degrees(atan(Y/X)) H=pow(pow(Dist,2)+pow((f2+Z),2),0.5) h1 = (pow(A,2)-pow(B,2)-pow(H,2))/(-2*H) h2=H-h1 C=pow(pow(A,2)-pow(h2,2), 0.5) a=degrees(asin(C/A)) a1=degrees(acos(Dist/H)) info5=(90-(a+a1))*0.7 g=degrees(asin(C/B)) g1=degrees(asin(Dist/H)) info3=180-(g+g1) b=180-(a+g) info4=(b-90)*0.80 info = info1, info2, info3, info4, info5 print("Claw:", info1) print("Wrist Torsion:", info2) print("Wrist Vertical:", info3) print("Elbow:", info4) print("Shoulder Vertical:", info5) print("Shoulder Rotation:", info6) wait(100) radio.send("INPUT", info) #if info : RInfo6 = info6*0.835 BaseA.run_target(20, RInfo6, wait=False) BaseB.run_target(20, RInfo6, wait=False) BaseC.run_target(20, RInfo6, wait=False) BaseD.run_target(20, RInfo6) if X == 0 and Y == 0: print("Claw (5000= Open; 0= Close):") info1 = int(input()) info = info1, info2, info3, info4, info5 radio.send("INPUT", info) wait(100) print(info) wait(100) This is the one that gives me more problems (see below), which is the one on top, and that controls the claw, the wrist rotation and the wrist vertical movement. from pybricks.hubs import InventorHub from pybricks.pupdevices import Motor, ColorSensor, ColorDistanceSensor, UltrasonicSensor from pybricks.parameters import Button, Color, Direction, Port, Side, Stop from pybricks.robotics import DriveBase from pybricks.tools import wait, StopWatch from pybricks.experimental import Broadcast from usys import stdin from uselect import poll from umath import sin, cos, tan, asin, acos, atan, degrees radio = Broadcast(topics=["INPUT"]) hub = InventorHub() WristVertical = Motor(Port.A, Direction.CLOCKWISE, [[16, 20], [1,8], [8, 60]]) WristTorsion = Motor(Port.B, Direction.COUNTERCLOCKWISE, [[8, 24], [8, 60]]) Claw = Motor(Port.C) ElbowR = Motor(Port.E, Direction.COUNTERCLOCKWISE, (1,60)) ElbowL = Motor(Port.D, Direction.COUNTERCLOCKWISE, (1,60)) Sensor = ColorDistanceSensor(Port.F) CalClaw = 0 CalibrationElbow=0 CalibrationWrist = 0 print("Calibrate Elbow? (Yes=LEFT, No=RIGHT)") pressed = [] while not any(pressed): wait (10) pressed = hub.buttons.pressed() if Button.LEFT in pressed: Tilt=int(hub.imu.tilt()[0]) if Tilt > 1: ElbowR.run(-5) ElbowL.run(-5) if Tilt < 1: ElbowR.run(+5) ElbowL.run(+5) while CalibrationElbow == 0: Tilt=int(hub.imu.tilt()[0]) print(Tilt) wait(100) if Tilt == 0 : wait(500) ElbowR.brake() ElbowL.brake() ElbowR.reset_angle(0) ElbowL.reset_angle(0) CalibrationElbow =1 wait(1000) Tilt=int(hub.imu.tilt()[0]) print("Elbow calibrated") print(Tilt) hub.light.blink(Color.GREEN, [500, 500]) wait(3000) hub.light.off() while CalibrationWrist == 0: WristTorsion.run(20) color = Sensor.color() if color == Color.YELLOW : wait(150) WristTorsion.stop() print("Torsion Calibrated") wait(1000) CalibrationWrist = 1 hub.light.blink(Color.GREEN, [500, 500]) WristTorsion.run_angle(20,180) WristTorsion.reset_angle(0) wait(3000) while CalibrationWrist == 1 : WristVertical.run(-10) dist = Sensor.distance() print(dist) if dist == 90 : WristVertical.stop() print("Vertical calibrated") hub.light.blink(Color.GREEN, [500, 500]) wait(3000) WristVertical.run_angle(20, 60) WristVertical.reset_angle() CalibrationWrist = 2 if Button.RIGHT in pressed : print("Calibration skipped") CalibrationWrist = 2 CalibrationElbow = 1 while CalClaw == 0: info = radio.receive("INPUT") if info: info1 = info[0] if info1 == 0: Claw.reset_angle(0) print("Claw calibrated (and closed)") CalClaw = 1 Claw.run_target(500, info1) while CalibrationWrist==2 and CalibrationElbow==1 and CalClaw==1: info = radio.receive("INPUT") if info: info1 = info[0] info2 = info[1] info3 = info[2] info4 = info[3] Claw.run_target(500, info1, wait=False) WristTorsion.run_target(40, info2, wait=False) WristVertical.run_target(20, info3, wait=False) ElbowR.run_target(10, info4, wait=False) ElbowL.run_target(10, info4) This other one fails, but way less often (the one in the middle): from pybricks.hubs import InventorHub from pybricks.pupdevices import Motor, ColorSensor, UltrasonicSensor from pybricks.parameters import Button, Color, Direction, Port, Side, Stop from pybricks.robotics import DriveBase from pybricks.tools import wait, StopWatch from pybricks.experimental import Broadcast hub = InventorHub() radio = Broadcast(topics=["INPUT"]) Shoulder1R = Motor(Port.A, Direction.CLOCKWISE, ([1, 24], [12,140])) Shoulder2R = Motor(Port.B, Direction.CLOCKWISE, ([1, 24], [12,140])) Shoulder1L = Motor(Port.C, Direction.COUNTERCLOCKWISE, ([1, 24], [12,140])) Shoulder2L = Motor(Port.D, Direction.COUNTERCLOCKWISE, ([1, 24], [12,140])) print("Calibrate Shoulder? (Yes=1, No=0)") pressed = [] while not any(pressed): wait (10) pressed = hub.buttons.pressed() if Button.LEFT in pressed: Tilt=int(hub.imu.tilt()[0]) if Tilt > 1: Shoulder1R.run(-2) Shoulder2R.run(-2) Shoulder1L.run(-2) Shoulder2L.run(-2) if Tilt < 1: Shoulder1R.run(2) Shoulder2R.run(2) Shoulder1L.run(2) Shoulder2L.run(2) CalibrationShoulder = 0 while CalibrationShoulder < 1: Tilt=int(hub.imu.tilt()[0]) print(Tilt) if Tilt == 0 : wait(2000) Shoulder1R.brake() Shoulder2R.brake() Shoulder1L.brake() Shoulder2L.brake() Shoulder1R.reset_angle(0) Shoulder2R.reset_angle(0) Shoulder1L.reset_angle(0) Shoulder2L.reset_angle(0) CalibrationShoulder =1 hub.light.blink(Color.GREEN, [500, 500]) wait(3000) print("Calibration completed") if Button.RIGHT in pressed : CalibrationShoulder = 1 print("Calibration skipped") while CalibrationShoulder == 1: info = radio.receive("INPUT") wait(100) if info : Angle = info[4] Shoulder1R.run_target(1000,Angle,wait=False) Shoulder2R.run_target(1000,Angle,wait=False) Shoulder1L.run_target(1000,Angle,wait=False) Shoulder2L.run_target(1000,Angle) In sum, the problem is that quite often, the programs just stop. No message is given. They just stop working. Also, the program of the master hub -which is the only one that is in communication with the PC- is often also stopped and the connection shut. Honestly, I have no idea what to do. I would prefer to stay with pybricks and because how much I am learning. Moving to official Lego app, although is a possibity, I would prefer rather not to go.
  8. Also, I noticed that when I try to measure de load of a motor, it gives me an error indicating that there's not such attribute... Any idea?
  9. Pybricks! :) I have been making some tests today, and indeed, the main problem, rather than connection, is that, somehow, the programs stops randomly (but always when no operation is underway). Often, when there's no input for 1-2 minutes...
  10. For some time, I'm having problems when running the programs of 3 Mindstorms hubs simultaneously. In particular, I lose connection or the programs stops by their own frequently. I keep the PC connected to one of them which broadcasts to the others. O have to check the BT version, which I'm afraid can be 4.2. Has someone else experience similar issues? Any ideas?
  11. To say that this is the biggest conventional crawler crane in the world is just a joke. Probably, regarding it's functions it's interesting, but for this price tag you don't expect such thing.
  12. Many thanks @lcvisser! I thought how I could approximate the trigonometric functions. I also though that, if I manage to do the broadcast hub communication, I can run the program and calculations in a Mindstorms hub, and then transmit the results to the other hubs. It remains the issue that broadcasting is not very timely precise, which may be an issue... Again, thanks for the help!
  13. Hi all, Does anyone knows if it's possible to install the firmware of the 88016 Mindstorms hub into a 88012 Technic hub? It would allow to program a "standard" technic hub to perform hub-to-hub communication (among other features). Best and many thanks in advance!