Jump to content

Recommended Posts

Posted

Hi, 
I couldn't find a topic I needed so I started a new one. 

In the controls of the 42100 (Liebherr R 9800 Excavator) there is a step / function in which you calibrate the motors/program.
It looks like the program moves the arm (and other sections) and then stops when there is to much resistance.
That way the controles/hub knows when to stop the motors. Even when you try to move the arm farther with the controls. 

I want to program that calibration or safety measure in my own programming. 
I have parts in my MOC that are restricted in their movements but the motors don't stop when there is resistance. 

I looked up some instructions about the Powered-Up Programming Blocks but I can't find a way to program this. 

Who can help me? 
 

Posted (edited)

Welcome. I recommend Pybricks instead of the PU App.

Coding in Python is free. After flashing the firmware you can use Pybricks Code from your browser. It's always possible to go back to the LEGO firmware. Code samples, tutorials and coding help you can find on Pybricks.com

The function you are looking for is called run_untill_stalled
https://docs.pybricks.com/en/latest/pupdevices/motor.html?highlight=stall#pybricks.pupdevices.Motor.run_until_stalled

 

Edited by Berthil
Posted

Thanks Berthil. 

So the 'run_untill_stalled' is not available in the Power up app? 

I have never coded but I see Pybricks has blocks so it's worth a try I think. 
How can I go back to the LEGO firmware? 

 

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