simulate a differential with 2 motors
-
- Posts: 20
- Joined: 24 Dec 2011, 21:18
simulate a differential with 2 motors
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/
-
- Posts: 1818
- Joined: 02 Oct 2010, 02:19
- Location: Michigan USA
- Contact:
Re: simulate a differential with 2 motors
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
http://mattallen37.wordpress.com/
I'm all for gun control... that's why I use both hands when shooting
Re: simulate a differential with 2 motors
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.
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.
My blog: nxttime.wordpress.com
-
- Posts: 175
- Joined: 28 Dec 2011, 13:07
- Location: Gelderland, Netherlands
- Contact:
Re: simulate a differential with 2 motors
This might be helpful:
-- Pepijn
http://studl.es Mindstorms Building Instructions
http://studl.es Mindstorms Building Instructions
-
- Posts: 20
- Joined: 24 Dec 2011, 21:18
Re: simulate a differential with 2 motors
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/
Re: simulate a differential with 2 motors
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
-
- Posts: 346
- Joined: 27 Sep 2010, 03:05
- Contact:
Re: simulate a differential with 2 motors
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
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 --->
Who is online
Users browsing this forum: No registered users and 5 guests