I have done a search on this forum and have come up empty handed.
I need a skid steering algorithm to control two independent motor controllers as one would use a single Sabertooth 2X10 motor controller with the skid steering function.
Not completely sure what you mean by skid steer algorithm, but if you mean converting throttle and steering control of a differential bot with two separate motor controllers, that is relatively simple math. I will have to search for some examples though. If anyone else has one please post.
Your response is exactly what I am looking for. I hate to reinvent the wheel and if examples are available I would really appreciate being able to see them.
That is somewhat of a broad request. You may need to be more specific as to what will be used to control the motor controller (microcontroller, servo controller, PC, etc), and the type of motor control action that is desired.
I need a skid steering algorithm to implement the BS2 code to control two independent motor controllers (HB25s) as one would use a single Sabertooth 2X10 motor controller with the built-in skid steering function (channel 1 controls the forward\backward motion of the rover in the mixed mode and channel 2 controls the turning motion of the rover in the mixed mode).
In other words, I want to be able to use a speed value (joystick y axis)and a turn value (joystick x axis) and have those mixed to the two motors, rather than using two individual motor speeds. This is exactly how the Sabertooth motor controllers work to provide skid steering with two servo pwm inputs.
[code]’ Pulse value sent to servos
Dim Left_Servo_Val As Integer
Dim Right_Servo_Val As Integer
’ Your servos center values
Dim Right_Center As Integer
Dim Left_Center As Integer
’
Dim Left_Servo As Integer
Dim Right_Servo As Integer
’ Input from radio
Dim X_Stick As Integer
Dim Y_Stick As Integer
Sub Main()
’ You must find your servos true centers before
’ this code will work properly. These are my servos values.
Right_Center = 1380
Left_Center = 1380
Do
X_Stick = PulseIn(12,1) ’ X is Steer
Y_Stick = PulseIn(11,1) ’ Y is forward reverse
'X_Stick = 1380 ’ For testing
'Y_Stick = 1380 ’ For testing
’ Add the Y value
Right_Servo = Y_Stick
left_Servo = Y_Stick
’ Add the X steer value
If X_Stick > Right_Center Then
X_Stick = X_Stick - Right_Center
Left_Servo = Left_Servo + (X_Stick \ 2)
Right_Servo = Right_Servo - (X_Stick \ 2)
Else 'If X_Stick < Left_Center Then
X_Stick = Left_Center - X_Stick
Right_Servo = Right_Servo - (X_Stick \ 2)
Left_Servo = Left_Servo + (X_Stick \ 2)
End If
Left_Servo_Val = left_Servo
’ ********This is for servo bots, remove otherwise
’ Invert Right servos value
If Right_Servo > Right_Center Then
Right_Servo = Right_Servo - Right_Center
Right_Servo_Val = Right_Center - Right_Servo
Else 'If Right_Servo < Right_Center Then
Right_Servo = Right_Center - Right_Servo
Right_Servo_Val = Right_Center + Right_Servo
End If
’ ********This is for servo bots, remove otherwise
Well, not really that specific. Now one knows the “algorithm” code will have to fit BS2 programming specs, that the BS2 output will have to be compatable with the operating specs of a HB25 motor controller, and that the input to the BS2 will be from joysticks (assumed to be standard analog pot based). To me an “algorithm” is just a mathmatical relationship between two or more variables, which is pretty wide open.
; This program mixes two servo signals to produce sum and difference signals. The signals can
; be mixed with each other or into each other as described below. Input signals are pulse
; trains repeated at 20 to 25ms intervals. Each pulse is nominally 1.5ms +/- 0.5ms.
; Pulses are represented in the program by signed integers representing the pulse width
; deviation from the neutral pulse width in processor clock cycles (fosc/4).
; If r is the mixing ratio, a number from 0 to 1, and ChN is the signed deviation of channel N
; from the neutral pulse width, then;
; Mixing Y with X, a proportion of ChY is bi-directionally mixed with ChX
; ChA = (ChX + r * ChY) / (1 + r)
; ChB = (ChX - r * ChY) / (1 + r)
; Mixing Y into X, a proportion of ChY is uni-directionally mixed into ChX
; ChA = (ChX + r * ChY) / (1 + r)
; ChB = ChY
; If R is an integer from 1 to 8 representing the proportion of mix with 8 being a mixing ratio
; of 1, then the relations are as follows;
; Mixing Y with X ChA = (8 * ChX + R * ChY) / (8 + R)
; ChB = (8 * ChX - R * ChY) / (8 + R)
; Mixing Y into X ChA = (8 * ChX + R * ChY) / (8 + R)
; ChB = ChY
Heh np. I’m a bit miffed that I couldn’t find my notes. I was very interested in this subject a long time ago, and I had several pages of notes… Good luck with your project.
skid steering algorithm is what I have been looking for since last year, just didn’t think to search it in these terms lol…
Now, can someone translate some of this so I can figure it out/make it work on arduino ?