## 4wd/4ws vehicle traction control

Typically: "How do I... ", "How can I... " questions
shac12
Posts: 9
Joined: 06 Jul 2019, 13:21

### 4wd/4ws vehicle traction control

Hi,

I have a 4wd/4ws vehicle in VREP that i am attempting to perform traction control upon. My method of traction control involves knowing the vehicles body acceleration, the angular velocity of each wheel and a measure of the load that wheel is experiencing. The body acceleration i will obtain using the accelerometer sensor and the wheel velocity I can get using sim.getObjectVelocity(wheelH). The issue lies in obtaining the measure of load upon the wheel.

This measure of load is analogous to the amount of current sent to a motor. My traction control approach is to compare the wheel speed to the amount of current being sent to the wheel. In a slip situation, the wheel will have a high velocity yet not much load. I have included my scene and all the relevant functions I am using. A lot of it is ROS communication which is not relevant and can be commented out. Just looking for a way to obtain the load on the wheel. even if that is the friction force between the wheel and the surface I can convert that to torque using the radius of the wheel and then convert the torque to current. Any help is appreciated thanks.

UGV_PureWheels.ttt is the scene that I am working with.
https://unsw-my.sharepoint.com/:f:/g/pe ... w?e=ViP0nL

Regards,
Sharif

coppelia
Posts: 7396
Joined: 14 Dec 2012, 00:25

### Re: 4wd/4ws vehicle traction control

Hello Sharif,

you can check the force/torque a joint applies via sim.getJointForce. Or did I misunderstand something?

Cheers

shac12
Posts: 9
Joined: 06 Jul 2019, 13:21

### Re: 4wd/4ws vehicle traction control

Hi coppelia,

Thanks for the quick reply. I have been doing that but the values are really low and do not match the torque values I am applying into the wheel itself. I have an external controller that is applying a torque to the wheels using this section of the code. I want to measure the reaction that is actually experienced by the wheel. The values that are being returned by sim.getjointforce() are very small in comparison to the torque that is being applied earlier in the wheel actuate function. Unless the surface has a very small coefficient of friction (which it doesn't as I've specified it in the material properties of the wheel and ground surface to be 1) then the values are impossibly low.

Code: Select all

function wheel_actuate()
local E = simGetStringSignal(("motE" .. mot_num))
if E then
sim.addForceAndTorque(wheelH, {0, 0, 0}, {0, (tonumber(E) * 10.0), 0})
end
forceOrTorque = sim.getJointForce(rolljointH)
if forceOrTorque then
local temp = tostring(forceOrTorque)
simSetStringSignal("torq" .. mot_num, temp)
--print("experiencing     " .. forceOrTorque .. " nm to joint_" .. mot_num)
end
end
Kind Regards,
Sharif

coppelia
Posts: 7396
Joined: 14 Dec 2012, 00:25

### Re: 4wd/4ws vehicle traction control

Difficult to say why this is. What do the other physics engines in V-REP say?
If you have little load on your joints, then the torque will be small. Same when the maximum velocity is reached, then the exerted torque will be close to zero.

Try maybe with a few simple examples where a fixed revolute joint is rotating with a simple mass.

Cheers

shac12
Posts: 9
Joined: 06 Jul 2019, 13:21

### Re: 4wd/4ws vehicle traction control

Hi coppelia,

I ended up not using that value as it wasnt representative of what was going on. I used the getcontactinfo function and summed all the values in that to obtain the tangential force and then multiplied by the wheel radius to get torque. For anyone else having the same issue, have a look here.

viewtopic.php?p=31580#p31580

Kind Regards,
Sharif