Support for HiTechnic DC Motor and Servo Controller (Tetrix)

This is where you talk about the NXJ hardware related topics such as the brick, sensors, LEGO pieces, etc

Moderators: roger, 99jonathan, imaqine

Support for HiTechnic DC Motor and Servo Controller (Tetrix)

Postby zbuhman » Mon Aug 01, 2011 12:48 am

The specification sheets from HiTechnic about these devices:

http://www.multiupload.com/LDXKA0EKJI
http://www.multiupload.com/XXAEQWKI12

I know nothing about how I2C devices work, but apparently that information is enough to create a working implementation. These are included in standard Tetrix sets, and are therefore relatively well widespread, and creating drivers for these should be worthwhile I think.

Thanks.
zbuhman
New User
 
Posts: 22
Joined: Mon Aug 01, 2011 12:34 am
Location: Nebraska, USA

Re: Support for HiTechnic DC Motor and Servo Controller (Tet

Postby zbuhman » Tue Aug 02, 2011 1:53 pm

These NXC drivers work for me:

http://mattallen37.wordpress.com/2011/0 ... c-drivers/

I can't seem to figure out how to write this in lejos.
zbuhman
New User
 
Posts: 22
Joined: Mon Aug 01, 2011 12:34 am
Location: Nebraska, USA

Re: Support for HiTechnic DC Motor and Servo Controller (Tet

Postby skoehler » Tue Aug 02, 2011 2:15 pm

I have some code. Hopefully, I'll be able to add it before the release of leJOS 0.9.1.
skoehler
leJOS Team Member
 
Posts: 1110
Joined: Thu Oct 30, 2008 4:54 pm

Re: Support for HiTechnic DC Motor and Servo Controller (Tet

Postby zbuhman » Wed Aug 03, 2011 12:50 am

Oh, that would be great if you were to release your work.

I'm still absolutely clueless as to why my code isn't working.

http://paste.pocoo.org/show/451617/

Test:

http://paste.pocoo.org/show/451620/

sendData returns -3 every time (I just popped that servo stuff in there really quickly just to see if it wasn't just something wrong with the motor controller).

I've tried to follow both the relevant code in the SVN, like MServo/MSC, etc... and adapting it to what the servo documentation says and how the working NXC driver does it. I would imagine that I've missed something terribly important, because I haven't gotten a peep out of either controller in lejos.

Like the author of the NXC driver, I also don't have the encoders (sadly; but then again no need for a more complex driver).

No need to wait for a release; I wouldn't hesitate to grab your code the moment it hits the repository.

Thanks.
zbuhman
New User
 
Posts: 22
Joined: Mon Aug 01, 2011 12:34 am
Location: Nebraska, USA

Re: Support for HiTechnic DC Motor and Servo Controller (Tet

Postby zbuhman » Sun Oct 30, 2011 9:32 pm

I noticed the new Tetrix code in the repository; thank you kirkpthompson (and whoever else was responsible for making that happen). I'll definitely try that out next time I get a chance.
zbuhman
New User
 
Posts: 22
Joined: Mon Aug 01, 2011 12:34 am
Location: Nebraska, USA

Re: Support for HiTechnic DC Motor and Servo Controller (Tet

Postby kirkpthompson » Mon Oct 31, 2011 2:01 pm

You're welcome!

You need to know that if you are running 0.9, this code only works with an experimental firmware image (for the NXT brick) due to some I2C issues that were identified during the course of its development. We will work on making this available.

No testing (other than confirming that I2C worked with these controllers) was done with 0.85 so if you want to try these classes with that, let us know how it works out.

Best,
-K
Leg Godt!
User avatar
kirkpthompson
leJOS Team Member
 
Posts: 282
Joined: Wed Dec 05, 2007 1:27 am
Location: New Mexico, USA

Re: Support for HiTechnic DC Motor and Servo Controller (Tet

Postby nate » Thu Nov 03, 2011 12:22 am

kirkpthompson wrote:You're welcome!

You need to know that if you are running 0.9, this code only works with an experimental firmware image (for the NXT brick) due to some I2C issues that were identified during the course of its development. We will work on making this available.

No testing (other than confirming that I2C worked with these controllers) was done with 0.85 so if you want to try these classes with that, let us know how it works out.

Best,
-K


Kirk,

If I build from the head of the trunk, will I get the experimental firmware, or do I have to request that image from you? I've got an entire Tetrix kit as a mentor for the FIRST/FTC program, and I noticed the Tetrix code in the repository, and was planning on trying it out in the next few days.


Nate
nate
New User
 
Posts: 14
Joined: Sat Oct 29, 2011 11:40 pm

Re: Support for HiTechnic DC Motor and Servo Controller (Tet

Postby kirkpthompson » Thu Nov 03, 2011 1:19 pm

Hi Nate. Build the snaphot (run ant from \trunk\snapshot) and use this image: http://dl.dropbox.com/u/32153704/i2ctest5.bin to replace (make a backup) \trunk\snapshot\bin\lejos_nxt_rom.bin, then do the nxjflash.

Since I am the only one who has tested the TETRIX classes (that I know of), I would really appreciate some testing feedback. In particular, I have concerns with how the TetrixServo.setRange() method is laid out in the context of the functional behaviour of TetrixServo.setAngle(). Also, as always, please note that some of the classes/methods may change as I tweak on things.

Best,
-K
Leg Godt!
User avatar
kirkpthompson
leJOS Team Member
 
Posts: 282
Joined: Wed Dec 05, 2007 1:27 am
Location: New Mexico, USA

Re: Support for HiTechnic DC Motor and Servo Controller (Tet

Postby nate » Fri Nov 04, 2011 2:04 am

I am planning on getting to it on Saturday. Can you give me a quick pointer on the difference between the trunk and the snapshort portion of the repo? Also, how does one build their own version of the firmware?

(I'm on a MAC if that makes any difference, although I've got a Virtual WinXP box I can use). I'm not afraid of C, Java, Ant, Make or any of the build tools, as I'm a professional programmer by trade, and have done a fair bit of hacking on open-source projects in my life.)

[ I realize this might be a slight deviation from the Tetrix stuff, but am trying to figure out how to help myself and the project both. ]



Nate
nate
New User
 
Posts: 14
Joined: Sat Oct 29, 2011 11:40 pm

Re: Support for HiTechnic DC Motor and Servo Controller (Tet

Postby nate » Fri Nov 04, 2011 3:50 am

Well, I lied. I spent about 45 minutes coding up a quickie autonomous code that just ran the two motors forward and backwards and spun the robot, and it seems to work fine.

Note, for right now, all I have is 4 motors in a holonomic setup plus a dIMU gyro (which is really noisey), but I only did the test using two of the motors, so it really didn't go forward/backward very well, but it spins well. :)

One of my goals is to try and remotely control the robot via a joystick connected to my PC (which is how the FTC robots are controlled using RobotC), but I can't get Bluetooth pairing working in leJOS (yet).

But, for autonomous mode, it's working great for the very simple case. I'll try a more complex version on Saturday. Kudos, and thank you very much!


Nate
nate
New User
 
Posts: 14
Joined: Sat Oct 29, 2011 11:40 pm

Re: Support for HiTechnic DC Motor and Servo Controller (Tet

Postby nate » Sat Nov 05, 2011 4:19 am

nate wrote:Well, I lied. I spent about 45 minutes coding up a quickie autonomous code that just ran the two motors forward and backwards and spun the robot, and it seems to work fine.

Note, for right now, all I have is 4 motors in a holonomic setup ..


I won't have time to work on it due to having to leave town unexpectedly, but I did have a few minutes to try out all four motors (two Tetrix Motor Controllers). Using the example code things worked great.

My holonomic robots moves great using the code. Thanks again!


Nate
nate
New User
 
Posts: 14
Joined: Sat Oct 29, 2011 11:40 pm

Re: Support for HiTechnic DC Motor and Servo Controller (Tet

Postby poohsen » Mon Jan 23, 2012 9:39 pm

hi all,

@kirk: has this custom image already made it into the repository? I would really like to use a more recent release than 0.8.5 but 0.9.0 had that Tetrix issue and last time I tried to follow your instructions above I couldn't get that snapshot to run either. Is it worth trying with the current HEAD?

regards,
chris
poohsen
New User
 
Posts: 20
Joined: Sun Nov 20, 2011 1:47 pm

Re: Support for HiTechnic DC Motor and Servo Controller (Tet

Postby skoehler » Mon Jan 23, 2012 9:47 pm

The newest of the newest is available here:
http://lejos.svn.sourceforge.net/viewvc/lejos/trunk/snapshot/?view=tar

It includes all knows fixes.
skoehler
leJOS Team Member
 
Posts: 1110
Joined: Thu Oct 30, 2008 4:54 pm

Re: Support for HiTechnic DC Motor and Servo Controller (Tet

Postby poohsen » Mon Jan 23, 2012 10:55 pm

hi,

thanks for the link!
how stable is the HEAD in this project by the way? I suppose automated testing is difficult with the low-level stuff...

regards,
chris
poohsen
New User
 
Posts: 20
Joined: Sun Nov 20, 2011 1:47 pm

Re: Support for HiTechnic DC Motor and Servo Controller (Tet

Postby skoehler » Mon Jan 23, 2012 11:21 pm

poohsen wrote:how stable is the HEAD in this project by the way? I suppose automated testing is difficult with the low-level stuff...


There are no automated tests. However, you are lucky in the sense that we're preparing for 0.9.1 right now, and that things have been somewhat tested during the last few weeks to ensure that they are somewhat stable for 0.9.1.
skoehler
leJOS Team Member
 
Posts: 1110
Joined: Thu Oct 30, 2008 4:54 pm

Next

Return to NXJ Hardware

Who is online

Users browsing this forum: Google [Bot] and 0 guests

cron
more stuff