Segoway for EV3

This is where you talk about the EV3 software itself, installation issues, and programming talk.

Moderators: roger, gloomyandy, skoehler

Segoway for EV3

Postby krchilders » Tue Apr 08, 2014 4:12 pm

I have tried for days to get the Segoway class to work on the EV3. I copied it over from the NXT classes and modified it to use GyroscopeAdaptor with a HiTehnicGyro. I also looked at the BallBot code in ev3classes and it looks the same as what I have except that BallBot uses Gyroscope although I have no idea how that works as it is an empty interface in the ev3classes. What I am finding is that the execution time of the balance loop on the EV3 looks to be much slower than on the NXT so the robot just falls over. I also took the GyroBoy code in the Lego education software to Lejos Java. No luck there either.

By the way, does the BallBot class actually work?

Does running off the SD card slow things down? if so is there a plan to at some point actually replace the EV3 firmware similar to the NXT.

For the GyroBoy I used all of the EV3 sensors and motors as per the build instructions.
For the EV3Segoway I used NXT motors and the HiTechnicGyro on a robot very similar to the one in the third addition of Maximum Lego NXT. Only difference is the mounting of the brick.

Am I just trying to get to far ahead of the development of lejos for the EV3?

Sorry there are a lot of questions buried in here. I'm just trying to see if I should stop banging my head against the wall for now and move on to other less tricky EV3 projects. :?
krchilders
New User
 
Posts: 11
Joined: Tue Mar 18, 2014 10:49 pm

Re: Segoway for EV3

Postby gloomyandy » Tue Apr 08, 2014 8:04 pm

The Segoway code worked fine for me when I tried it some time ago (using the Lego gyro).
https://www.youtube.com/watch?v=jgc-9GFOKgM
Ignore all of the extra motors and the 3 NXTs. This is basically an EV3 running the Segoway code. All of the rest of the stuff is there to add extra weight to the robot. I was working with some folks at Oracle for a demo at JavaOne and they had a very heavy robot that I was basically simulating by adding every bit of Lego I could find. Without all of that extra weight the robot was very stable.

The control loop was considerably faster than on the NXT. All of this was with an older version of leJOS not with the current version. I have no idea if recent changes have caused issues, but if you are unable to track down what is going wrong then perhaps you should try some simpler projects first?
User avatar
gloomyandy
leJOS Team Member
 
Posts: 4072
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: Segoway for EV3

Postby krchilders » Tue Apr 08, 2014 10:02 pm

Just so I'm clear you used 2 EV3 large motors and the EV3 gyro?

if I may ask how did you implement the gyro interface. The NXT code uses GyroSensor in the call to Segoway and Gyroscope in the Segoway constructor and was based on the HiTechnicGyro? Doesn't seem to me that this is needed for the EV3GyroSensor. According to the Wiki, lejos 0.5.0 took away a lot of the sensor backward compatibility so maybe you used an earlier version.

Also, in order to use the EV3 motors as unregulated I am using "EncoderMotor left = new NXTMotor(MotorPort.B);" per the Wiki.

I have begun to work on simpler projects while this gets sorted out.

Thx!
krchilders
New User
 
Posts: 11
Joined: Tue Mar 18, 2014 10:49 pm

Re: Segoway for EV3

Postby gloomyandy » Tue Apr 08, 2014 10:35 pm

Yes two large motors and the EV3 gyro. As I said I used an older version of leJOS. But it really is not that hard to convert the code to use the new sensor interfaces (after all it is only a single value being read). Yes you need to use an unregulated motor, but again it is pretty simple to convert the code.
User avatar
gloomyandy
leJOS Team Member
 
Posts: 4072
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: Segoway for EV3

Postby krchilders » Sat Apr 12, 2014 1:02 am

I finally got it to work on the EV3. I had not implemented the calls to the sample provider for the gyro very efficiently. I found that the K factors in the original Segoway code were not very stable. When I switched to the ones that are used in the Lego Education software Gyro Boy it was very stable. Thanks for the help. :)
krchilders
New User
 
Posts: 11
Joined: Tue Mar 18, 2014 10:49 pm


Return to EV3 Software

Who is online

Users browsing this forum: Baidu [Spider], Yahoo [Bot] and 0 guests

cron
more stuff