Cosmik42

Control all your Powered Up & Power Function (SBrick) devices with a single software

Recommended Posts

11 minutes ago, Didicas said:

When I start now the train starts driving and stops immediately.

Ok, so you have fixed the first problem.

 

12 minutes ago, Didicas said:

"Unknown train on Section 2, nothing done".

2 reasons why you have issues:
 - 3 sections for 2 trains can be problematic. Try with 1 train first.
 - Unfortunately I was never able to have WeDo 1.0 work properly with SBrick. First ensure a super fresh battery. The number 4 when no train is here is too low. It should much higher. Ultimately I recommend you use WeDo 2.0 hubs if you can. 

Share this post


Link to post
Share on other sites

Okay, I will continue testing with one train hopefully next weekend.

I use a transformator and no battery to be sure that the sbricks have never a low voltage level.

The motion sensor are working well, I have never wrong values, always 0 if the train passes, always 4 or 5 if there is no train.

Obviously the software expects a train also in case of 4.

Is there any possibility for example by C# coding to tell the software that 0 means a train is passing and higher than 2 no train is passing?

Because I have no idea how to get higher values...

Share this post


Link to post
Share on other sites

Hi Cosmik42, Thank you a lot for the new version 1.4

I just tested it wit a real LEGO train in my office: It works perfect! Even the COM port delivers information sent from an Ardiuno at the tracks.

Next step will be a limitation to the MAC adresses of my hardware to avoid interference with BT devises in my neighborhood. :thumbup:

Share this post


Link to post
Share on other sites
37 minutes ago, Giottist said:

Next step will be a limitation to the MAC adresses of my hardware to avoid interference with BT devises in my neighborhood.

This is mostly what 1.4 implements!

Share this post


Link to post
Share on other sites
20 hours ago, Cosmik42 said:

I confirm this is fixed. Will release in 1.4!

Thank you. I've tested the Boost hub and can confirm that the ports now are detected and work as expected.

Some further diaganosis from me regarding the EV3 behaviour;

  1. I have three EV3s (don't ask!) and they are all exhibiting the same behaviour.
  2. they are all run firmware version 1.09H
  3. If I plug a touch sensor into port 4, it successfully detects the sensor being pressed if I then
  • plug a second touch sensor into port 1, it detects it (shows it in the log)  and recognises it being pushed but no longer recognises port 4's sensor being pushed.
  • remove the second sensor from port 1 and plug it into port 2. It detects it (shows it in the log)  and recognises it being pushed but no longer recognises port 4's sensor being pushed.
  • remove the second sensor from port 2 and plug it into port 3. It detects it (shows it in the log)  and recognises it being pushed but no longer recognises port 4's sensor being pushed.
  1. (Dang this should be #4) If I start again, reconnecting to the EV3 and plug the first sensor into port 1, it successfully detects the sensor being pressed. If I then
  • plug a second touch sensor into port 2, it does not detect it (and does not shows the detection in the log). It does not detect the sensor in port 2 being pushed but does detect the sensor in port 1 being pushed. If I unplug the sensor in port 1 it will then detect the sensor in port 2, including when it is pushed but when the sensor is plugged into port 1 again, the port 2 sensor stops being detected.
  • remove the second sensor from port 2 and plug it into port 3. it does not detect it (and does not shows the detection in the log). It does not detect the sensor in port 3 being pushed but does detect the sensor in port 1 being pushed. If I unplug the sensor in port 1 it will then detect the sensor in port 3, including when it is pushed but when the sensor is plugged into port 1 again, the port 3 sensor stops being detected.
  • remove the second sensor from port 3 and plug it into port 4. it does not detect it (and does not shows the detection in the log). It does not detect the sensor in port 4 being pushed but does detect the sensor in port 1 being pushed.  If I unplug the sensor in port 1 it will then detect the sensor in port 4, including when it is pushed but when the sensor is plugged into port 1 again, the port 4 sensor stops being detected.

So it looks like the EV3 is only picking up input from the lowest numbered port. I don't know whether or not this diagnosis is of any help.

Regards,

David

Edited by djm
amended diagnosis description for step #4

Share this post


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

So it looks like the EV3 is only picking up input from the lowest numbered port. I don't know whether or not this diagnosis is of any help.

This was SUPER useful! I only have a single sensor, so you playing around totally put me on the right track.

Given what you describe, I believe I have found the source of the issue.
Will send you a private build for you to test.

Share this post


Link to post
Share on other sites

I have a little bit time today, so I made a test with one train like recommanded.

Scenario: 1 trains and 3 sections (0,1,2) and without any switch. To detect the end of my sections I am using 3 wedo 1.0 motion sensors which are linked with several sbricks. The train is runnung with a powered up hub.

My sensors are showing always a distance value of about 4. If a train is passing the sensors the value goes down to 0 for a short moment. Afterwards they show again the value about 4.

The first train has the start position in sector 0.

I defined the path 0, 1, 2 , 0.

Now the train drives continuisly from one section to next one. That´s what I expext because in this scenario there can be no collusion with another train.

I get the messages below...

...
HUB NO.1 - Allowed to move to Section 1
HUB NO.1 has cleared section Section 1
Event #1 triggered - SBrick R on port C has a distance below 4
Event discarded - Unknown train on Section 0, nothing done
Event #3 triggered - SBrick V on port C has a distance below 4
Event #2 triggered - SBrick H  on port B has a distance below 4
Event discarded - Unknown train on Section 2, nothing done
HUB NO.1 has cleared section Section 2
HUB NO.1 - Allowed to move to Section 2
Event #1 triggered - SBrick R on port C has a distance below 4
Event discarded - Unknown train on Section 0, nothing done
Event #3 triggered - SBrick V on port C has a distance below 4
Event #2 triggered - SBrick H  on port B has a distance below 4
Event discarded - Unknown train on Section 1, nothing done
HUB NO.1 - Allowed to move to Section 0
...

I try now to understand what the messages are meaning...

Obviously the programs recognice always in the other two sections an unknown train. Is the reason for this because the distance avalue is below 4? Is value 4 a fix limit value?
Below 4 means a train is passing the sensor, higher than 4 means no train is passing the sensor?
Is there any possibility to set the limit value on a defined level? In my case is 0 if the train is passing and about 4 if there is no train.
With my sensors the maximum value is always 5, I never saw a higher value => ???

Next to this I read somewhere in the forum that I have to define something manuelly in case of using sbricks, but I do not find this anymore. May be this is the reason why it´s not working.

In the block of every section there is a window "configure" and excute "customer code". Is this an option to define what shall happen at which event?

May be I have strange question, but the reason could be also that I am still trying to understand how it works.

Thank you in advance for your help to understand how the software works and to get my trainings running with a self drive mode.

 

Share this post


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

With my sensors the maximum value is always 5, I never saw a higher value => ???

Hi Didicas,

So the fact that you have 4 all the time is the main issue here. The program believes a train is passing by when the value is below 5. So basicaly the program is confused because sensor triggers where he believes no train should be at. I could try to create a custom build to validate this theory with you. Will write you on PM.

Share this post


Link to post
Share on other sites

V1.5 is out -  08/21/19
----------------------------
- Control+ Hub - Implementation complete, including new L + XL Technic motors
- Fix a bug with EV3 preventing the use of more than one sensor at a time
- Fix a UI bug related to the Section part of the Self-Driving Module. That section now properly redraws after window resize.

You can download the build here: https://www.dropbox.com/sh/o3i9653vwx755ps/AABfxfpL_4SeoBS4HyCVZLT_a?dl=1

69014338_10156090497951090_3648453398010

Edited by Cosmik42

Share this post


Link to post
Share on other sites

Simply a confirmation that I've tested the EV3 with multiple sensors and it works as desired with version 1.5.

Caveat for anyone plugging the NXT touch sensor into the EV3. From what I've seen, the reading for an NXT sensor shows a high raw data value for when not pressed and a low raw data value when pressed. The EV3 sensor shows a low raw data value when not pressed and a high raw data value when pressed. Code accordingly!

Regards,

David

Share this post


Link to post
Share on other sites

Hi Cosmik42,

I've just got my first control+ hub and it works fine with PAB. Just a humble question: How much effort it costs to enable the angle encoder in the new L and XL motor an in the Boost medium motor? This is useful for turntables, moveable bridges, complicated switches and so on to let the motor turn only for a preprogrammed amount. (Hmm, or open and close the valve for pneumatic drives :wink: )

Share this post


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

How much effort it costs to enable the angle encoder in the new L and XL motor an in the Boost medium motor?

Are you talking about supporting this?

Tilt-Sensor.png

Share this post


Link to post
Share on other sites

Hi Cosmik42, Please with your experience working on this project, Please can you create library for C# that at minimum will support WeDo 2.0.  WeDo 2.0 is very convenient for kids that learn C# and plus has rechargeable battery.  There is no such C# library on this planet as of now.  Thank You Very Much in advance for your time and consideration

Share this post


Link to post
Share on other sites
8 minutes ago, Speedy said:

Hi Cosmik42, Please with your experience working on this project, Please can you create library for C# that at minimum will support WeDo 2.0.  WeDo 2.0 is very convenient for kids that learn C# and plus has rechargeable battery.  There is no such C# library on this planet as of now.  Thank You Very Much in advance for your time and consideration

Actually lego has one! That's how I started this project! 

https://education.lego.com/en-us/support/wedo-2/developer-kits

It is specifically for WeDo 2.0 and is in C#!

Share this post


Link to post
Share on other sites
23 hours ago, Cosmik42 said:

Actually lego has one! That's how I started this project! 

https://education.lego.com/en-us/support/wedo-2/developer-kits

It is specifically for WeDo 2.0 and is in C#!

Please can you provide short sample using the "WeDo 2.0 Developer Kits", C# , and Visual Studio, on how to (e.g.) read WeDo 2.0 distance sensor and turn WeDo 2.0 motor on/off.  Also if possible, the same sample, when sensor is connected to one WeDo 2.0 hub, and motor is connected to another WeDo 2.0 hub (at same time).  If this is beyond this thread, please let me know and I will open another. Thank You!

Share this post


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

Please can you provide short sample using the "WeDo 2.0 Developer Kits", C# , and Visual Studio, on how to (e.g.) read WeDo 2.0 distance sensor and turn WeDo 2.0 motor on/off.  Also if possible, the same sample, when sensor is connected to one WeDo 2.0 hub, and motor is connected to another WeDo 2.0 hub (at same time).  If this is beyond this thread, please let me know and I will open another. Thank You!

Sorry Speedy, I looked at this SDK 7-8 months ago, have not opened it since and will not have the time to do this for you. I encourage you to downlowd the SDK, start it up and start playing with it. It is fairly well documented.

Share this post


Link to post
Share on other sites
On 8/22/2019 at 10:49 PM, Giottist said:

No, Im talking about the new L, XL and Boost motor with includes angle encoders.

 

On 8/22/2019 at 10:50 PM, Cosmik42 said:

Oh did not know about the feature. No idea yet then. Will let you know.

 

In the 42099 Off roader the L motor is used for steering. During startup of the app/model this function is calibrated by moving the position to the maximum possible right & left positions. Does anybody know how those positions are detected? Is it by comparing comparing the rate of rotation to the applied power? Or could it be by torque encoding?

Could you incorporate such a calibration routine into the control of these motors?

Share this post


Link to post
Share on other sites

Hi Cosmic42,

I am currently using SBrick and WEDO 1 for distance sensoring.
As V1.5 is available I ordered the new control+ hub and the new powered up color + distance sensors 88807 in order to replace the old sensors step by step.

Unfortunately my testing failed with the new devices.

I connect one control+ hub and two distance sensors.

New Hub Found of type POWERED_UP_HUB
Hub Technic Hub is connected!
Port Connected: B of type BOOST_DISTANCE
Port Connected: D of type BOOST_DISTANCE

Are they realy BOOST_DISTANCE or is this already wrong?

In any case after starting they show color red and distance 15. This is only changing if I touch with my finger the sensor, already in a distance of 1 cm nothing happens (1cm = currently the distance where the train is passing).
After I am touching the distance changes from 15 to 1 and stays at 1 even if I remove my finger.
If I touch the second sensor then the second sensor changes from 15 to 1 and only then the first sensor changes from 1 to 15. Again these values stay after removing the finger.

I have to touch again the first sensor for any changes and so on...

What is going wrong?

Thank you for your support.

 

New remark:

Is there anybody who has already tested the train software with the control+ hub together with the sensor 88807?

Is it working fine for other users? Do I have to do something special to get it okay?

Or is it better to use the distance sensor 45304 wedo 2 together with the control+ hub?

But of course I want to avoid to buy again other sensors as I already brought several 88807.

 

Edited by Didicas
Adding a remark

Share this post


Link to post
Share on other sites

Dear all

Is there anybody who can provide me his experiance with the new control+ hub and distance sensors?

With the new color and distance sensor 88807 I have the problem mentioned in my last post.  

Is there anybody who is already using the distance sensor 45304 successful connected to the new control+ hub?

What are you using already successful? I use until now only the SBricks together with sensor 9583 successful. Now I need some more sensors in my train project and I like to avoid to buy many devices which will not help me.

Thank you very much for your feedback! 

 

New remark:

I tested the color and distance sensor 88807 in the same way but now with the powered up train hub. With this hub I had the same problem like with the control+ hub.

Is anybody using one of the two powered up hubs together with the wedo 2 sensor 45304? Hopefully they are working?

Edited by Didicas
Adding a remark

Share this post


Link to post
Share on other sites

I've recently purchased a couple of Color & Distance sensors (88007) to mount under my trains for plate/tile color detection to automate my layout and for shows.

This setup works consistently using the PoweredUp mobile app, but when porting the exact same logic to The Brick Automation Project the color detection of white and yellow pieces drops below the threshold, causing the program to miss the triggers.

Red is detected with very high certainty 100% of the time.

Tested under different light setups and surfaces.

Any tips? 

Share this post


Link to post
Share on other sites
7 hours ago, Nivst said:

I've recently purchased a couple of Color & Distance sensors (88007) to mount under my trains for plate/tile color detection to automate my layout and for shows.

This setup works consistently using the PoweredUp mobile app, but when porting the exact same logic to The Brick Automation Project the color detection of white and yellow pieces drops below the threshold, causing the program to miss the triggers.

Red is detected with very high certainty 100% of the time.

Tested under different light setups and surfaces.

Any tips? 

I also have problems with the sensor 88807 and the automation project software.

I was not able to test the sensors with the powered up App, because the control+ hub is not connecting with my mobile phone S7. I do not know why, may be to old. When I brought the sensors I got in the lego shop the information that the sensors are not yet working with the powered up App, so I am woundering that you are able to use them. Is there a new app version? 

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.