speed control clarification?

Berny

Member
I pulled the following from a 2004 thread:

"The method you are after is the same as that used by robots for obstacle avoidance. It is called "vector forces". Draw your robot's outline on a peice of paper and consider the forces that your motor/wheels apply individually. Draw these as vectors. Then do the same for your controller.
It now becomes a case of trigonometry. (it's that funny stuff that didn't make sense at school involving triangles and degrees). You will then end up with a set of equations that involve trig functions and numbers between 0 & 1.
The poor old PICAXE can't do any of that, so back to the drawing board.
Start building up a set of values in a grid as you have already suggested.
You only actually need 3 or 4 steps for good control.
Break each stick position into areas that contribute an amount of demand for each motor. For example, pushing the stick 1/4 to the right (no forward or back component) needs to add 1/4 drive to the left motor and subtract 1/4 drive from the right. Robot turns right on the spot at 1/4 speed. Then move the stick half way forward as well as the 1/4 right. Forward/backward movements adds equal amounts to each motor so now add half demand to each motor. This results in the left motor having +1/4 from the left right stick plus +1/2 from the forward/back stick = +3/4. The right motor has -1/4 from the left/right stick plus +1/2 from the forward/back stick = +1/4. Net result is move forward whilst turning to the right.
Now you know what to do with respect to motor speed demand for each stick position it is a question of converting to PICAXE code.
Be aware that positions such as FULL forward and FULL left can result in more than 100% demand. You need to put limits on the calculations.
The method I have used is to have a seperate PICAXE for each drive. Both channels receive the radio signal and present the resultant demand as a pulsout to a regular RC speed controller. This allows me to include sensor inputs as well so that I can switch between RC and fully automomous or even combinations."

I made a spreadsheet of the upper right quadrant of the stick movement and got the values below. My interpretation of the above indicates a problem with my spreadsheet values. Can someone clarify my understanding please:confused:
L=left mtr R=right mtr

F/W STICK POSITION
1.00 | L+1.25 R+.75 | L+1.5 R+.5 | L+1.75 R+.25 | L+2 R0
0.75 | L+1 R+.5 | L+1.25 R+.25 | L+1.5 R0 | L+1.75 R-.25
0.50 | L+.75 R+.25 | L+1 R0 | L+1.25 R-.25 | L+1.5 R-.5
0.25 | L+.5 R0 | L+.75 R-.25 | L+1 R-.5 | L+1.25 R-.75
0.00 0.25 | 0.5 | 0.75 | 1.00 L/R STICK POSITION
| L+.25 R-.25 | L+.5 R-.5 | L+.75 R-.75 | L+1 R-1 TURNS IN PLACE RIGHT

Sorry about the primitive text usage, I don't really know what would have been more appropriate here and probably don't know how to "create" that:eek:
 

BeanieBots

Moderator
Vector forces is all about polar to rectangular conversion.
Many scientific have this as a built in function.
I'm not 100% sure what your issue is.

Alternatively, if you do not want full proportional speed control, then it's as simple as "if object is to the left, then increas left hand drive and decrease right hand drive". Of course, it's the opposite for an object on the right.
 

Berny

Member
I am attempting to plot motor speed demand based on my interpretation of the original text and my question was really if the numbers in my example are correct based on the original text. My interpretation of the original text was that the demand could be exceeded in FULL forward and FULL left yet my example indicates an issue at FULL right and 1/4 forward (L+1.25 R-.75) where L+1.25 is 125% demand. At Full forward and FULL right, the left motor is at 200%.:confused:
 

BeanieBots

Moderator
It all depends on how/where you scale in the first place.
You can either use smaller scaling to start with or simply limit the final speed demand using the MAX operator.

At the end of the day it all depends on how you want your bot to respond.
Most people want max possible forward speed at stick full foward rather than one side has the ability to go faster (while the other goes slower) when a turn is applied.
 

Berny

Member
OK then. My assumption is that my numbers are correct and that they need to be scaled back. That's what I will do ... Thanks:)
 

BeanieBots

Moderator
Or do a bit of both.
Scale back to get more control over mid ranges but still allow a certain level of greater than MAX and then 'clip' using the MAX function to maintain full speed with stick full forward and central.
 

Berny

Member
Thanks for the tip. I will do as you suggest. I appreciate the help. There is so much to learn here! Great forum:D
 
Top