4WD AGV

5 years 11 months ago #29532983 by cory944
4WD AGV was created by cory944
Dear Roboteq support team,

Here I'm trying to make a new project. This time It requires an AGV to be four wheel driven. We will use 2 fbl2360, each controller will be connected to 2 motors giving a total of 4 motors. My question is, will it be possible to use mixed mode for the 4 motors? move 2 left motors as "one" and move 2 right motors as "one" to turn left/right ? If so, can I use CANOpen to share "steering data" between 2 controllers? I'd rather use RoboCAN to share data between controllers but I will be using a couple of CANOpen sensors too, so I have no other choice to use CANOpen instead. Do you think turning radius would be the same than 2 motors in mixed mode?

Thanks in advanced.

Regards,
Victor.

Please Log in or Create an account to join the conversation.

5 years 11 months ago - 5 years 11 months ago #29532984 by cory944
Replied by cory944 on topic 4WD AGV
Any help will be appreciated.

Please Log in or Create an account to join the conversation.

5 years 11 months ago #29532985 by blake
Replied by blake on topic 4WD AGV
Hi Victor,

Yes this is definitely doable. We do this often using RoboCAN, I have not done it using CANOpen but it shouldn't be any different from an algorithm perspective.

Below is the MicroBasic script used to do this via RoboCAN. You will simply need to modify to use CANOpen instead. The main point is the mixing algorithm.
' This script is provided "as-is", without warranty of any kind,
' expressed or implied, including but not limited to the warranties of
' merchatability, fitness for a particular purpose and
' noninfringemement. In no event shall Roboteq be liable for any claim,
' damages or other liability, arising from the use of the software.



option explicit

' Mixed mode using two separate controllers
' Script is written for use in any single channel controller.
' Script must be loaded and executed in controller that will serve as Master on a RoboCAN network.
' Second controller will act a Slave. Master node id=1, Slave node id=2
' Script is provided for demonstration purposes, as-is without warranty.

dim Pulse1Present as integer ' Raw pulse 1 value
dim Pulse2Present as integer ' Raw pulse 2 value
dim Throttle as integer ' Throttle Command
dim Steering as integer ' Seering Command
dim LeftMotor as integer ' Left Motor Command
dim RightMotor as integer ' Right Motor Command

dim CANAlive as integer ' Alive Robocan nodes

Top:

' Read list of alive RoboCAN nodes
CANAlive = getvalue(_ICL, 2)

' Uncomment below for RC mode
'Pulse1Present = getvalue(_PI, 1) ' Check if Radio is on by reading raw pulse value
'Pulse2Present = getvalue(_PI, 2)

'if (Pulse1Present > 0 and Pulse2Present > 0 and CANAlive 1) ' Check that both channels have a signal and slave node is alive
' Capture RC joystick value after scaling and conversion
'	Throttle = getvalue(_PIC, 1) ' Throttle on pulse input 1
'	Steering = getvalue(_PIC, 2) ' Steering on pulse input 2
'else
'	Throttle = 0 ' Radio if off, all commands at 0
'	Steering = 0
'end if

' Analog command mode
' WARNING there are no safety. If joystick is missing, motors will runaway
if (CANAlive = 1) ' Check that slave node is alive
	Throttle = getvalue(_AIC, 1) ' Throttle on analog input 1
	Steering = getvalue(_AIC, 2) ' Steering on analog input 2
else
	Throttle = 0 
	Steering = 0
end if

' Compute Simple mixed mode algorithm
LeftMotor = Throttle + Steering
RightMotor = Throttle - Steering

' Cap commands to +/-1000
If LeftMotor > 1000 then LeftMotor = 1000
If LeftMotor < -1000 then LeftMotor = -1000
If RightMotor > 1000 then RightMotor = 1000
If RightMotor < -1000 then RightMotor = -1000

' Apply Left Command to local motors
SetCommand(_G, 1, LeftMotor) 'Send command to local motor ch1
SetCommand(_G, 2, LeftMotor) 'Send command to local motor ch2

' Send Right Command to Slave, node 2 on RoboCAN network
SetCANCommand(2, _G, 1, RightMotor) 'Send command to slave motor ch1
SetCANCommand(2, _G, 2, RightMotor) 'Send command to slave motor ch2

wait(10) ' Repeat loop every 10ms / 100Hz
goto top
The following user(s) said Thank You: cory944

Please Log in or Create an account to join the conversation.

5 years 11 months ago #29532987 by cory944
Replied by cory944 on topic 4WD AGV
THANK YOU VERY MUCH BLAKE

As always excellent customer service!
The following user(s) said Thank You: blake

Please Log in or Create an account to join the conversation.

Moderators: tonysantoni
Time to create page: 0.059 seconds