A note about the most recent changes in programming.
The most intractable problem I've had to deal with on Rachi's chair is the problem of starting a turn-in-place with casters that carry 30% (or more when tilted) of the weight. As John has already said, too low motor compensation was a big part of the problem. Increasing it to the point of jerkiness helped, but not enough, and, of course, that's not a pleasant way to drive a chair.
So, I lowered motor resistance to where driving was comfortable and added some code to boost motor compensation when turning at low power - the boost decreases as power increases (ending at 10% total power). Again, this helped a lot to give a snappy turn-in-place
once the turn had started, but left another problem - I still had to move the stick too far left or right to get the casters to "unstick". The latest program solves this too.
I think that the source of the problem is this. Imagine that maximum speed is 100% (= 1000 Roboteq command value), but that maximum turn rate is just 20%. It takes a motor command of >50 Roboteq units to get these motors to barely start turning. For going forward or backwards that's just a stick 5% beyond the deadband (0.05*1000 = 50); in other words you start to move as soon as the stick is off center. But for turn in place, moving the stick that much wont do anything (0.05*1000*0.2 = 10) and the stick has to be moved left or right five times more, to >25% throw (0.25*1000*0.2 = 50). It's hard to know if you've moved the stick exactly 1/4 throw - move it a smidgen too little and the turn doesn't start, move it a bit more and the turn starts, but a smidgen too far and the turn may be too fast for maneuvering in a tight space. A clear symptom of this is that if the stick is just moved off center left or right the contactor clicks in, but the chair doesn't start to turn until the stick is moved quite a bit more and its hard to know how much more to move it. When going forward and back, however, the chair starts to move as soon as the contactor clicks. We want to get the same response for turning as for going forward and back; the chair should start to move as soon as the stick is off center.
To do this, I've added one more user setting (MinimumSteering). The logic is illustrated in the following simplified code (simplified by leaving out stuff that gets the sign right for forward vs. backward, left vs. right):
- Code: Select all
IF ((TotalM1+M2MotorCommands <= MinimumSteering) AND (Steering > 0) AND (Steering < (MinimumSteering-Throttle))) THEN
Steering = MinimumSteering-Throttle
END IF
This doesn't do anything unless both total motor command and Steering are low. If they are, it resets Steering from its low value to a higher value. That higher value isn't a fixed MinimumSteering, but (MinimumSteering-Throttle) because Throttle above 0 will also get the motors moving. In Rachele's chair MinimumSteering = 50 isn't enough, but setting MinimumSteering = 100 does the trick. (In the actual program, MinimumSteering can be set between 0 and 20, and the program multiplies this by ten; finer gradations are useless.)
I'm happy, and so are the volunteers who load her onto a van each weekday morning - no more wild swings as they get the chair lined up.