Reversing motorcommands

2 years 1 month ago - 2 years 1 month ago #29533591 by Erik
Reversing motorcommands was created by Erik
My robot uses an flb-2360 (firmware 1.8d) in closed loop speed postition mode, mixed mode3 steering.

For manual control mode i use an rc-transmitter...i want the robot to drive reverse while my rc-sticks operate the same way..(the front side of the robot has a lawnmower-strimmer and the back side has the mouth of a large vacuumcleaner)

Now i tried to invert the motordirection by script (which operates on a pulse-in3 signal from a switch on the rc-receiver)

top:
if(getvalue(_PI,3) < 1400) 'vacuummode off = lawnmower mode on
setcommand(_DRES, 4) 'turn off vacuummotor

setconfig(_MDIR, 1, 0) 'motor direction 1=inverted 0=non-inverted
setconfig(_MDIR, 2, 1) 'motor direction 1=inverted 0=non-inverted



else 'vacuummode on = lawnmowermode off
setcommand(_DSET, 4) 'vacuummotor on

setconfig(_MDIR, 1, 1) 'motor direction 1=inverted 0=non-inverted
setconfig(_MDIR, 2, 1) 'motor direction 1=inverted 0=non-inverted



end if

goto top




The problem is that the controller swaps the motorcommands after this script is executed..the steeringstick of the transmitter becomes throttle and throttle becomes steering.



How can i fix this? Or is this a bug in the software (again, remember that firmware 1.7 was written for me because i had similar issues).

Is it possible to write a script that inverts the Pulse-in 1 signal (which i use for throttle) as soon as the controller gets this signal on the pulse-in port?


When i invert the pulse-in1 (connected to motorcommand1) on my rc-transmitter-settings it works fine but i want it to invert by a switch....how can i do that?

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

2 years 1 month ago #29533599 by Gabriel_Isko
Replied by Gabriel_Isko on topic Reversing motorcommands
I'll have to test the behavior of inverting the direction of the motor direction while in mixed mode, however I would recommend inverting the polarity of your pulse input instead. This should let you accomplish what you are going for.

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

Time to create page: 0.102 seconds