A new release of the Driver Suite has been uploaded to Source Forge.
Changes:
- A driver for the new HiTechnic Magnetic Sensor has been added, together with an example program for normal use and for with the Sensor MUX.
- Added a driver to send and receive messages to and from an RCX using the IR Link. You can also control motors and make it play sounds. More functionality will be added in future releases.
- Simplified functionality to control PF motors using the IR Link. You can now control a motor by using a single function, PFMotor(), without having to resend the command continuously. This is part of the HTIRL-NG driver. The normal HTIRL driver will be phased out in the next release.
- Added support for the new Lego E-Meter. You can now use your NXT as a multimeter.
- The Mindsensors MSDIST driver now configures itself, you no longer need to specify which Sharp IR module is connected to it.
- The Mindsensors NXTCam can now be configured in line tracking mode.
Thank you’s:
- John Hansen for providing me with the technical info for the Lego E-Meter
- David Cosimano for sending me one.
- Thorsten Benter for sending me an RCX, IR Tower and USB-Serial converter so that I could write the IR Link RCX driver.
- Gus Jansson for testing the Magnetic Sensor driver and finding some bugs in it.
Without the help from these folks this would’ve been a rather small update.
You can download it from the usual spot: [LINK].
Xander,
I like the new PF Single Pin Output mode. Is it possible to control two motors using this method like the older PFcomboPwmMode would? There is a small delay in the PFmotors when you have to control two or more motors. I have set up eight motors on four receivers and the time delay is quite noticable.
I would like to use the new function to drive a two motor driven robot and the delay will cause the robot to vear slightly when it starts. Right now I would have to use the older function to control it, which isn’t a big deal.
Maybe I am missing something too.
The PF Single Pin Output mode only allows you to control one motor at a time, so I am tied to what I can do with that. The alternative is to hack the driver and reduce the number of transmissions done. That would reduce the amount of lag.
I’ve got a very simple way to start both motors at the same time and yet still take advantage of the no time out limitation…
Start both motors in “PFcomboPwmMode” mode and immediately turn it over to “PFMotor” mode. It works well, but the delays due to the number of tranmissions are a bit high.
void TwoPFMotor(int Receiver, ePWMMotorCommand SpeedA, ePWMMotorCommand SpeedB)
{
switch(Receiver)
{
case 1:
PFcomboPwmMode(HTIRL, 0, SpeedA, SpeedB);
PFMotor(pfmotor_S1_C1_A, SpeedA);
PFMotor(pfmotor_S1_C1_B, SpeedB);
break;
case 2:
PFcomboPwmMode(HTIRL, 1, SpeedA, SpeedB);
PFMotor(pfmotor_S1_C2_A, SpeedA);
PFMotor(pfmotor_S1_C2_B, SpeedB);
break;
case 3:
PFcomboPwmMode(HTIRL, 2, SpeedA, SpeedB);
PFMotor(pfmotor_S1_C3_A, SpeedA);
PFMotor(pfmotor_S1_C3_B, SpeedB);
break;
case 4:
PFcomboPwmMode(HTIRL, 3, SpeedA, SpeedB);
PFMotor(pfmotor_S1_C4_A, SpeedA);
PFMotor(pfmotor_S1_C4_B, SpeedB);
break;
default:
break;
}
}
And I am not sure, but I think what you call “motorA” and “motorB” in these two functions are inconsistent. And the receiver numbers are inconsistent too. I prefer the “1,2,3,4” more than the “0,1,2,3” for obvious reasons.
Good job, and thanks for setting up the new mode. I likey!
@Chris, I thought of that but you said you needed something that was fast since you have so many motors to control. As for the channel numbering, the low level functions use 0-3 and the higher level ones use 1-4.
Perhaps in the next release I can make the number of transmissions configurable. This will allow you to cut down the number to maybe 1 or two instead of the 5 with the channel dependent delay in between each transmission. Then a function like the above could be made sensor port generic and would be fast enough to be usable. I have a couple of ideas already, just leave it with me.
I am glad you like it 🙂 Keep it coming with the suggestions and feedback.
– Xander