Recommended Posts

2 hours ago, Lok24 said:

That's my favoured idea, yes

Ok, maybe monitor it only when you press the remote button to change speed up. Have an array with the initial theoretical 100 speeds.

When you press the remote button up, get speed before, get speed after, if difference is less than a given threshold you reached maximum load speed, so recalculate the array of speeds.

Now this will only decrease speeds. We have to find a way to increase speeds, in case you decouple the wagons. Maybe, when you are in step 100, you allow for a 101 step which is current 100 speed plus the step speed… if speed increases above a threshold, recalculate with new maximum.

Now this is all nice theory, but speed increases will take time, most probably much more than the time it takes to get speeds before and after… so the “get speed after” must be done with some sort of delay, which will have to be tuned somehow. Using a StopWatch object in the main loop might be a possible solution for this.

I foresee lots of programming fun!

Whatever you do, please tell us how it worked!

Share this post


Link to post
Share on other sites
5 minutes ago, vascolp said:

Now this is all nice theory, but speed increases will take time, most probably much more than the time it takes to get speeds before and after… so the “get speed after” must be done with some sort of delay, which will have to be tuned somehow. Using a StopWatch object in the main loop might be a possible solution for this.

That's the problem. I have routines in my program, which raise an event when time ist over

6 minutes ago, vascolp said:

I foresee lots of programming fun!

Yes ..... ;-)

 

Share this post


Link to post
Share on other sites
6 hours ago, legOtaku_official said:

I was wondering if there is any example code for making the City Hub play a custom MP3?

Without any speaker?

Suppose not.

Share this post


Link to post
Share on other sites
2 hours ago, Lok24 said:

Without any speaker?

Suppose not.

Could you have a sensor in a port detect a coloured tile and send a BLE signal to a laptop to play a sound, similar to BAP?

Share this post


Link to post
Share on other sites

Are there any 3rd party hubs that pybricks can work with?  Mainly, I want to find a hub that is rechargeable.  In stock would be cool too!  PUP hubs have been unavailable from Lego for awhile now.

Looks like we have Buwizz, PfBrick, and Sbrick Plus, but it seems that each one of those companies decided to come up with their own proprietary software for their hubs?  

Share this post


Link to post
Share on other sites
4 minutes ago, Arlo said:

Mainly, I want to find a hub that is rechargeable.

SPIKE/MINDSTORMS.

Share this post


Link to post
Share on other sites
2 minutes ago, Arlo said:

PUP hubs have been unavailable from Lego for awhile now.

Yes, but on Bricklink they are always available, and much cheaper.

Spike Hubs are rechargeable.

For others  I use rechargeable batteries, which are much easier to handle..

 

Share this post


Link to post
Share on other sites

Hi, Is pybricks able to reliably drive two motors with mutually locked output shafts in closed loop modes (I am mostly interested in constant angular velocity)? Won't it cause oscillations in regulation loops? Has anybody tested it in application like RC car?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.