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

Recommended Posts

Posted (edited)
Posted

Thanks @Jim and @JintaiZ, glad you liked them!

I've made a YouTube playlist and a second video showing how to create a Micropython program using the current version of the Robot Inventor app. Have edited the first post to include both. The code for each program will be in the video description.

As I do more videos, I'll just add them as replies in this thread.

  • 1 month later...
Posted

Hey Shah I am programming a 51515, M.V.P for the past few days I have been attempting to code a program for the 51515 that detects when the wheels are starting to drift off course and correct them. Do you have any tips on this? I am stumped.

Posted
3 hours ago, Sam123 said:

Hey Shah I am programming a 51515, M.V.P for the past few days I have been attempting to code a program for the 51515 that detects when the wheels are starting to drift off course and correct them. Do you have any tips on this? I am stumped.

Sorry, don't have any ideas off the top of my head. Perhaps you can try going through the tutorials at https://primelessons.org/en/Lessons.html

  • 2 weeks later...
Posted

Thank you for the tutorial!

Do you know how to start 4 motors at the same time? 

Unfortunately I just found the "motor_pair" to control 2 motors..

motor_pair = MotorPair('A', 'B')
 

Posted

I wonder what would happen if you made a "super" variable.

motor_pair = MotorPair('A', 'B')

motor_pair2 = MotorPair('C, 'D')

my_motors = motor_pair + motor_pair2

 

 

Posted

Thank you! I tried with the "super" variable but unfortunately it does not work. (TypeError)

Actually I just want to code in Python that Gelo walks.. 

 

Posted

Can't you just add

, wait=False

like with the EV3 to start all motors in row?

 

In python for EV3 it's like;

motor_a.run(600, wait=False)

motor_b.run(600, wait=False)

motor_c.run(600, wait=False)

motor_d.run(600, wait=False)

If running for some angle; MotorA.run_angle(600, 90, wait=False) and then last motor , wait=True for the program to wait untill it's finished.

Posted

maybe the syntax is wrong.

 

my_motors = (motor_pair,motor_pair2)

 

Just vamping. It would be very cool to get  Gelo to walk. I saw a youtube where a builder made his own robot and got it to walk.

Posted
On 12/26/2020 at 6:38 PM, Gelo said:

Thank you! I tried with the "super" variable but unfortunately it does not work. (TypeError)

Actually I just want to code in Python that Gelo walks.. 

 

You can check out @David Lechner's post in this topic:

 

Posted (edited)
On 12/14/2020 at 5:23 PM, Sam123 said:

Hey Shah I am programming a 51515, M.V.P for the past few days I have been attempting to code a program for the 51515 that detects when the wheels are starting to drift off course and correct them. Do you have any tips on this? I am stumped.

How about using yaw?  I've only used word blocks, but I know you can access and test the yaw of the 6-axis accelerometer in the P-brick.  You could set yaw to zero when it starts going, and then continually test for yaw going out of range -5 to 5 (or whatever).  Figuring out how to adjust the motor speed to compensate is left as an exercise to the reader :)    ... Edited later: I was intrigued and tried it out.  Using word blocks it's even easier than I thought, by adapting Tricky's line-following code, like this: first Set yaw to zero, then inside a repeat loop or other loop Start moving 2x(0-yaw) ; then outside the loop again Stop moving.

Edited by sunspot
added code example
  • 3 weeks later...
Posted

I’m looking for angle sensors for mindstorms that I can read from python. Do you have some proposals of angle sensors (rotational) and some belonging python scipt?

i know that I can use the angle information from motors but the motor it self requires some force to rotate and I don´t want to use that in project.

Thank you very much

Posted
On 1/16/2021 at 12:56 PM, Pellewalle said:

I want a rotational sensor with very low friction and therefor I don’t want to use a motor as sensor.

@PellewalleBrainstorming a few ideas, maybe one of them might give you the seed of the solution to your problem.  These have various tradeoffs between bulk and precision, so I don't know if any works for you.  (1) The hub detects its own yaw.  If the thing you're rotating can include the hub itself, rotating on a low-friction turntable, you could read the yaw to use in your program.  (2) you could convert the rotation of what you want to rotate to linear motion using a pinion gear on the axle of rotation and a rack or set of tread links, or using a pulley or whatever rotational-to-translational mechanism you like, and then use the distance sensor. (3) the thing you rotate could include a multi-colored disk or platform and you could use the color sensor to determine which zone is close to it, if you only need a few discreet rotational zones, like a game spinner. (4) or the thing you rotate could be a colored beam and after you set it (without using the motor), you then use a motor to spin a separate beam with the color sensor on it, in a parallel plane with a colinear axle, use the color sensor to find the colored beam, and the motor's positional sensor to tell you the angle required to find the beam.

Posted

Hi, thank you for bringing in ideas.

I have built a test bench for a vehicle chassis. In this model I cannot use the hub itself since I need to measure rotation angle with high (0.5-1 degree) precision to be able to examine some technical things, like how much play/rattle/delay it is in the drive line.

I have found a angle sensor from mindsensors.com but I haven’t got any information from them conserning support for python. Maybe you have some proposal with this type of sensor?

1C317E58-7A91-4343-9EF4-6320B2D0B7BA.jpeg

Posted

eThank you @Coder Shah for the YouTube-Videos. 

But is there anything available like an old-school documentation (pdf?) regarding Python and Mindstorms 51515 ? 

The online-help is a piece of crap....  I hoped I could find pdf or windows-help-documents within the app-directory, but the only thing inside of it is a 500 MB big .exe-file.... hahaha. 

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...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...