Award
Congratulations Rich, for answering the question and has received an EZ-Credit award! Share what you have learned and create a tutorial to help others by clicking here.

Controlling Motor Speed In Speech Recognition Contol Panel?

Assistance Requested

Help Richard R with their question and receive $10 of EZ-Credit to get more robots and parts from our store. The following information was provided about their previous efforts searching tutorials for a resolution.

Richard R claims to have checked these sources:
 
#1

Hello, so I have set up a sabertooth 2 x 12 dual (using serial) motor controller with a Movement Panel and speech recognition to control my robot... So far so good... works great... However using the commands... forward, reverse, left and right speech commands only drive the motors at full speed (no matter what number I put in the command as a speed parameter)... So forward(100,2000) moves the robot forward for 2 seconds at the same speed as does forward(255,2000).... In other words I want to use the voice commands forward slow and forward fast, but I can get the speed to change under voice control... Any ideas what I am doing wrong?

I have found a few conversations, tutorials and activities that may help with your question. Take a look at these links. I've sorted them by what I believe to be most relevant but that is not always the case as I'm still learning.


Also, consider reviewing the Learn section for informative lessons and activities. Check it out!


#2

Do EZ-Script commands (in a script) i.e. Forward(50,2000) move the sabertooth slower?

A solution could be to use the SendSerial() commands for different speeds. But this is EZ-Robot, it should be easy Smile Hopefully DJ can shed more light on it as, to me at least, it seems it could be an issue with the movement commands and the sabertooth rather than anything else.

#3

Thanks for responding Rich... Nope, no matter what value I enter in the forward command the Sabertooth powers the motors at full speed... So Forward(255) is the same as forward(50) or even just forward()... all the same...

#4

I'd guess (and bear in mind this is only a guess - wait for confirmation or denial) that it's due to the fact the Sabertooth doesn't use PWM for speed control where as all of the others do.

Another solution I thought of on my way home from work was to use a custom Movement Panel with script commands to set the sabertooth to the correct values depending on speed and direction. I haven't looked at writing the code for it or the calculations and variables required but it shouldn't be difficult.

Although wait for DJ (or someone else for that matter) to confirm or deny my suspicions before marking as solved or even getting too involved in any kind of coding - there may very well be a simple solution.

#5

The sabertooth (non R/C version) supports different control methos... Input modes: Analog, R/C, simplified serial, packetized serial... If you're right Richard I am wondering if another Movement Panel in ez builder could be adapted to use with the sabertooth other than serial?

#6

@rryerson i use the sabertooth for LeXI's drive drain and arms. you adjust the value on the sabertooth commands ex:

say("robot, move forward at half speed"Winky
forward(255, 500) ** the 500 is the speed ** play around with different values to determine the speed you like.

#7

Thanks XL, but isn't the 255 the speed and the 500 the time parameter? So Forward(255,500) is supposed to move the robot forward at full speed for half a second? My problem is I want the control the "throttle" as it were of my robot via voice command...

#8

@XL-Robots - I learnt something new there, usually Forward() is Forward(speed, ms). So to make sure I have it right, where the ms usually is it's actually the sabertooth speed? What about the first number?

@rryerson - I assume DJ has already investigated all other avenues for the sabertooth control and none worked but it is possible I suppose. I haven't ever read anything about the other control methods so haven't a clue. However, my point was that scripts can be used with thee SendSerial() command to work the Sabertooth in simple serial mode. This is psudo code, I haven't a clue of the proper code but something like;

Code:

SendSerial(D0, 9600, 255)
SendSerial(D0, 9600, 127)



Which is full speed ahead on both motors. Change the 255 and 127 for lower values (not too low, it'll send it backwards) for slower speeds so;

Code:

SendSerial(D0, 9600, $motor1)
SendSerial(D0, 9600, $motor2)



Where $motor1 and $motor2 are calculated from the speed control on the custom Movement Panel.

#9

Rich, your serial commands do work... Just have to figure out the values... XL when I use forward(255,500), my robot moves forward at full speed for half a second...

#10

Thanks Rich... you serial suggestions worked like a charm. I have complete control of speed now... Going to convert most of my voice commands to serial... awesome thanks... Winky