simulate a differential with 2 motors

Discussion specific to projects ideas and support.
Post Reply
littletim979
Posts: 20
Joined: 24 Dec 2011, 21:18

simulate a differential with 2 motors

Post by littletim979 »

I want to build a robot that workd similary to this one: http://www.nxtprograms.com/NXT2/race_car/index.html you'll notice that it has 2 motors in the back and a steering motor in the front, when steering the 2 back motors turn at different speeds, simulating a differential, the only problem is that they have it pre programmed and it only goes three directions, left, right, straight, no "in between" so it's very jerky and unrealistic. i want to program a robot that would be controlled by a remote control and would have an "in between". how would i program the changing motor speeds?
My Blog: MindstormsPodcast.wordpress.com/
mattallen37
Posts: 1818
Joined: 02 Oct 2010, 02:19
Location: Michigan USA
Contact:

Re: simulate a differential with 2 motors

Post by mattallen37 »

Feed the steering value into an offset for the drive motors. Add the offset to one motor, and subtract it from the other. You will need to multiply or divide the steering value, based on your robot's physical design.
Matt
http://mattallen37.wordpress.com/

I'm all for gun control... that's why I use both hands when shooting ;)
aswin0
Posts: 201
Joined: 29 Sep 2010, 06:58

Re: simulate a differential with 2 motors

Post by aswin0 »

You will have to get speed ratio as a function of steering angle. This is how to get this done.

Draw your car and fill in dimensions. studs or cm doesn't matter. Just be consequent. Front wheels in an angle. Draw lines through each of the axis. They will come together in one point. If not investigate Ackerman steering. Find formula that calculates speed ratio of the back wheels starting with motor encoder of the front steer. Follow these steps.
1 translate encoder to steering angle.
2 calculate radius of the turning circle for each of the wheels use steering angle, length and with of the wheel base.
3 the speed ratio between any pair of wheels is given by the deviding their radius.
4 set wheel speed according to speed ratio.



Image
My blog: nxttime.wordpress.com
pepijndevos
Posts: 175
Joined: 28 Dec 2011, 13:07
Location: Gelderland, Netherlands
Contact:

Re: simulate a differential with 2 motors

Post by pepijndevos »

This might be helpful:


-- Pepijn
http://studl.es Mindstorms Building Instructions
littletim979
Posts: 20
Joined: 24 Dec 2011, 21:18

Re: simulate a differential with 2 motors

Post by littletim979 »

What i was really looking for was a equation to take the posision of the first motor and convert it to two motor speeds
My Blog: MindstormsPodcast.wordpress.com/
aswin0
Posts: 201
Joined: 29 Sep 2010, 06:58

Re: simulate a differential with 2 motors

Post by aswin0 »

We can't give you the equation. It all depends on the geometry of your car. But above I explained how to get the equation. But if you post a drawing I'll help you further.
My blog: nxttime.wordpress.com
hassenplug
Posts: 346
Joined: 27 Sep 2010, 03:05
Contact:

Re: simulate a differential with 2 motors

Post by hassenplug »

The simple solution would be something like what Matt said. Given the speed you want the motors to go (average), take the steering value, multiply it by some constant, and add it for one motor, subtract it for the other.

To find the exact constant, do the stuff aswin0 was explaining. Or guess.

If you number is too small, the robot won't turn well. If it's too large, it will try to turn too sharp.

Steve
---> Link to lots of MINDSTORMS stuff under my picture --->
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests