NXC - motors synchronization

Discussion specific to NXT-G, NXC, NBC, RobotC, Lejos, and more.
psorek
Posts: 13
Joined: 12 Feb 2012, 07:50

Re: NXC - motors synchronization

Post by psorek »

I didn't have many time for trying this since last post, but now i am sure I know how. Thanks for help!
psorek
Posts: 13
Joined: 12 Feb 2012, 07:50

Re: NXC - motors synchronization

Post by psorek »

Yeah, it works!
I have next question: How to make motors stop more smoothly, but with using RotateMotor() function? I don't want OnFwd() and Float ().

i am not sure, but it can be something with PID what is it and how works?
afanofosc
Site Admin
Posts: 1256
Joined: 26 Sep 2010, 19:36
Location: Nashville, TN
Contact:

Re: NXC - motors synchronization

Post by afanofosc »

There are many options and there have been many threads on these forums about exactly how to move motors. A standard API function may not exactly suit your needs. I think I posted a custom routine here in another thread that included ramp up and ramp down support but otherwise acted a lot like RotateMotor. It might work well for you. You could use the PID version of RotateMotor to see if adjusting the P, I, and D values make the routine stop more smoothly. Of course, a lower power level will make it stop more smoothly as well. That's one reason why trying the custom routine I posted that supports ramping up and ramping down might work for you also, since it ramps down 0 power as it reaches the target angle.

You'll need to just experiment with PID values and other motor control routines to see what works best - or roll your own.

John Hansen
Multi-platform LEGO MINDSTORMS programming
http://bricxcc.sourceforge.net/
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests