Hello again,I have some questions about using the hitechnic IR link with the driver suite.I have looked at the sample program and it is very helpful, however...1. I am not sure how to choose which channel of the PF system I will be controlling.2. There appear to be a few different modes I can use... Which one is the best/simplest?3. Slightly unrelated... what is the best way to ensure the servo motor always runs at a specific speed, e.g. 1 rotation every 2 seconds? Is there a nice function for it or shall I make my own proportional algorithm?

Hello again,I have some questions about using the hitechnic IR link with the driver suite.I have looked at the sample program and it is very helpful, however...1. I am not sure how to choose which channel of the PF system I will be controlling.2. There appear to be a few different modes I can use... Which one is the best/simplest?3. Slightly unrelated... what is the best way to ensure the servo motor always runs at a specific speed, e.g. 1 rotation every 2 seconds?

Whew! That was a lot of typing! (kidding. That was a lot of copying/pasting).

3. If by "servo motor" you mean the PF motors (they're just plain old motors, not servo motors), there isn't really a way to do that with the IRLink. You can get it close, but not always at the same speed. That requires a computer reading a encoder attached to the motor, and depending on that feedback it can adjust the speed to cope with any forces applied to the motor. That's the system that RobotC uses for the NXT motors.

P.S. (for anyone who likes weird facts) My post count is now at exactly 8-bits if you start counting at 1!

_________________A.K.A. inxt-generationSelf-proclaimed genius, and future world dominator.My Brickshelf Folder"Don't they teach recreational mathematics anymore?" - The Tenth DoctorBow down to Nikola Tesla, King of the Geek Gods.

Tue Jun 12, 2012 6:01 pm

sqiddster

Rookie

Joined: Mon Jun 11, 2012 9:28 pmPosts: 37

Re: Hitechnic IR link questions

NeXT-Generation wrote:

snip

Thanks! That's quite the list of commands, I'll look into that!

When I said 'servo motor', I was indeed referring to an NXT servo motor. The question wasn't really related to my previous ones, I should have made that more clear, sorry.

Also, I am OK with 'roughly' one every two seconds. No need for atomic precision

Great community here!

EDIT: I had a look at your color sorter program (very cool bot BTW) and I tried to recreate some code for my own means. However I get an assortment of errors when I try this:

Did you include the driver? Xander's 3rd party RobotC driver is what those commands are from. I've attached the appropriate header file. Place it in RobotC's "includes" folder, and put this line of code after your #pragmas.

_________________A.K.A. inxt-generationSelf-proclaimed genius, and future world dominator.My Brickshelf Folder"Don't they teach recreational mathematics anymore?" - The Tenth DoctorBow down to Nikola Tesla, King of the Geek Gods.

I'd rather you didn't post loose files from my suite, they'll end up being out of date and also missing some prerequisites (like common.h). It is better to post the link to where you can download them. (see my signature).

The PFMotor() API was made so you wouldn't have to worry about modes and things. It operates pretty much the same way as the normal way you control an NXT motor.

The different modes exist to allow you either:

Continuously (every second or so) tell the motor to keep moving at speed X

Tell the motor once to move at speed X and it will run until the batteries are dead or until you tell it to stop

Obviously the first one is great because if your robot should stop transmitting, the motors will stop after a second or so. The second one is great if you don't want to continuously send updates.

There are other modes too but I didn't think they were all that useful, so I didn't implement them. If you're feeling so inclined, you can check out the PDF with technical details here: [LINK].

I forgot to #include... Wow... noobish mistake!Thanks Xander, that makes it a bit easier to understand.

I'll give it another try this afternoon!

EDIT: still not sure if there is a function to make an NXT motor go at a constant rate in terms of revolutions per second. I have a fair idea of how to do this manually however I want to make sure I'm not missing a simple way to do it.

Who is online

Users browsing this forum: No registered users and 2 guests

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum