officinerobotiche / uNAV.X

Project MPLABX for drive uNAV on dsPIC33
http://rnext.it/project/unav/
MIT License
9 stars 2 forks source link

Speed reversion over a limit #25

Closed Myzhar closed 9 years ago

Myzhar commented 9 years ago

This is an amazing bug: if I increase the speed of the robot, at a certain point the wheels start spinning at the same speed, but in the opposite direction!

I could reach this point modifying the "constraint" values in the "yaml" file

@katodo @rbonghi

Myzhar commented 9 years ago

Solved in commit 5aa14abec61babafce87590dce257978943fa86b

katodo commented 9 years ago

with negative speed ( and configuration of example_robot node ) I've a similar problem with a negative velocity, after -1.4 motor jump to a excessive speed.

rbonghi commented 9 years ago

This bug is in velocity(void) function https://github.com/officinerobotiche/uNAV.X/blob/develop/src/control/motors_PID.c#L249 I think the error is on cast variable.

Myzhar commented 9 years ago

After the recent changes this problem came out again. It happens when my robot overcomes the speed of 1.1m/sec as setpoint (impossible since my physic limit is about 0.8 m/sec)

Considering a wheel radius of about 0.035 m when we have a rotation speed of 32.767 rad/sec, the linear speed is about 1.15m/sec... The inversion speed!

The problem is not present using the PID Tuner, so there is an overflow issue converting from m/sec to rad/sec.

We must set a saturation point for setpoint major than 32.767 rad/sec.

What I cannot understand is that the saturation is present... but does not work as expected...

rbonghi commented 9 years ago

This issue is the same of #40 .