-
Posts
292 -
Joined
-
Last visited
Content Type
Profiles
Forums
Gallery
Everything posted by HectorMB
-
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?
-
Pybricks Q&A
HectorMB replied to Pybricks's topic in LEGO Technic, Mindstorms, Model Team and Scale Modeling
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. -
Pybricks Q&A
HectorMB replied to Pybricks's topic in LEGO Technic, Mindstorms, Model Team and Scale Modeling
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? -
Pybricks Q&A
HectorMB replied to Pybricks's topic in LEGO Technic, Mindstorms, Model Team and Scale Modeling
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... -
Pybricks Q&A
HectorMB replied to Pybricks's topic in LEGO Technic, Mindstorms, Model Team and Scale Modeling
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? -
42146 - Liebherr LR13000
HectorMB replied to Ngoc Nguyen's topic in LEGO Technic, Mindstorms, Model Team and Scale Modeling
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. -
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!
-
Many thanks for the comment, Thorsten! :) I have read about Legoino here and there, but I never knew what it was about really. It's of course a possible alternative for my project. The problem is that I have VERY limited experience with C++, therefore it would be quite challenging to learn almost from scratch on that sense. I don't have a lot of experience with Python neither, but it's way more friendly user environment. Nevertheless, I'm just starting my learning with Python... I went further exploring the alternatives I have (I'll post soon the Lego project I'm working), and ended with this: -broadcasting with Pybricks doesn't seem to be a real alternative. I cannot make it work in a proper way by now... :(. It remains as an alternative if I find a way to coordinate the different programs, but I also find that there's only a stopwatch function, not a real clock that would help me to, at least, launch all the programs simultaneously. -thanks to a video posted by Kbalage, I just learned about hidden blocks that are used for programming the Lego sets programs, that are normally hidden to the general use. I think that maybe in the program of the 42100 I might find some blocks that may allow me to use trigonometric functions... It maybe not, but it worth a try. Let's see if I manage to end up with a solution!
-
Hello everyone! I'm struggling with a rather complex project in which i need to coordinate several hubs (4). Given the current resources, I'm considering the following options: -Use broadcasting communication with Pybricks. Nevertheless, in my hands, it not quite stable and I am not 100% successfull in transmitting the information between technic hubs. Nevertheless, it is an option to explore. I could run one program for each hub, but, as long as they have to be launched from different tabs, I would need also to find a way to coordinate them (my first approach is to start all the programs at a certain time, the same for all the hubs, few seconds after the inputs are given). Does anyone have some experience to share with broadcasting between technic hubs? -Use the Lego tehnic app. As the project involved some calculations with trigonometric formulas -which are not included in the Lego app, unless I am mistaken, it remains one of my last options. Does anyone knows if it is possible to include trigonometric formulas in the Lego technic app? -Use of the Mindstorms App. This app indeed includes trigonometric formulas AND hub-to-hub communication, which makes the ideal choice for this project. Unfortunately, I just have one mindstorm hub, so I am wondering if there is any way to manage a technic hub with the Mindstorms app. Many thanks in advance!
-
Pybricks Q&A
HectorMB replied to Pybricks's topic in LEGO Technic, Mindstorms, Model Team and Scale Modeling
Hi all, I am working in a project that involves controlling 4 hubs; in a coordinated manner. The way that I found to do it is to run one program in one different tab, which allows me to connect to many different hubs. Now I am just begining, but I'm afraid that when the moment of making coordinated moves arrives, I will get tricky. So, now, I am considering to make -as stated before- a master hub, and the make hub to hub communication. Nevertheless, the way That I found was to do by broadcasting and I am not sure if that'll work when the coordination implies more than 2 hubs. Any idea? Many thanks (and whish me luck!) -
42146 - Liebherr LR13000
HectorMB replied to Ngoc Nguyen's topic in LEGO Technic, Mindstorms, Model Team and Scale Modeling
Yes, I got mine by the usual way: second hand. 180 eur that worth the set itself and all the new pieces. Although I was really surprised for how fun was the assembling process, I wouldn't never pay the RRP. The thing that intrigues me indeed is that we're getting closer and closer to the moment on which a set may cost similar to the separated parts. Nevertheless, as said before, let's see what's in the box. In my case, if the price comes because a lot of motors or hubs... I already have what I need, thanks. -
42146 - Liebherr LR13000
HectorMB replied to Ngoc Nguyen's topic in LEGO Technic, Mindstorms, Model Team and Scale Modeling
Nevertheless, is true that we all hard similar comments when the CAT D11 was about to be released... And at the end it was sold relatively well, I think. So... Wait for it. -
42146 - Liebherr LR13000
HectorMB replied to Ngoc Nguyen's topic in LEGO Technic, Mindstorms, Model Team and Scale Modeling
Besides me falling into the no-way-i-will-buy-this-set-for-even-half-of-the-RRP category, I'm just curious about how Lego has arrived to that point. Let's see what's inside the box! (Maybe a check for the 20 eur difference?) -
I got a couple of BuWizz 3 units and waited quite excited for their -delayed- release. When I finally put my hand into them, I couldn't but feel that they're not what the company said they should be. I even had a 3000-pieces-moc waiting to put them in. After my disappoinment, what I did was to decide what to do regarding the BuWizzs (give them some time to deliver what they promised, which turned out to be a really long time) and focus on what brought my really good moments, which was just Lego.
-
Well, I understand the situation even being 10 years younger. The only thing I would say it's to don't put in the same bag a really young company as BuWizz and Lego company, with decades of experience and which delivers proved high quality stuff. BuWizz was quite promising, but the development and the time after the initial release of the BuWizz 3 put them into question in many aspects to me, and I guess, to many people. Lego is an amazing (and really expensive) hobby which may give you many enjoyable times. BuWizz is a even more expensive piece that is an add-on to Lego, not even necessary. So, again, I understand your pain but I think is fair to judge reach aspect as it's deserved, and separately.
-
Well, you might be right, I don't know I think one thing is to send a private message asking for issues with BuWizz, and other thing is to discuss here, sharing opinions. Everyone is free to ask and not to answer, I guess Nevertheless, Zerobricks, if you're offended, I feel really sorry and I apologize. All this issue with BuWizz drive me REALLY mad about the company. And I feel frustrated and scammed.