it makes more sense in the non-abridged version of “burning the candle at both ends of the day”, which in the old days meant it was before dawn when you got up to go to work and after twilight by the time you got home. Of course this time of year the people living way north kind of experience that effect implicitly anyway.
Um, Eddie you forgot “actually Jim” lol
That makes a lot more sense now, thanks.
“Actually jim”, LOL,
I tried to implement the code you recomended:
#0 P1500 cr
#0 P2000 T10000 cr
(pause for 10 seconds)
#0 P1000 T15000 cr
(pause for 15 seconds)
in this way with Arduino:
void setup()
{
Serial.begin(9600);
}
void loop()
{
Serial.println("#0 P1500");
Serial.println("#0 P2000 T10000");
delay(10000);
Serial.println("#0 P1000 T15000");
delay(15000);
}
But it does not work as I expect! the speed of motors in different turning in the loop are different, but my power source is not a battery to say that it falls down.
Well, all of my effort to lean ssc 32 is for my aim is to study Kalman filtering, where my KF code is ready, but I can’t command motors with ssc 32 so that the robot passes a square of 50cm, again and again.
considering the Arduino structure as I provided above, how do you code it? may be you know how to do it right?
Thank you!!!
Not you too! Doh!
Actually arash, that was my first incorrect code. This is the corrected code.
#0 P1500 cr
#0 P2000 cr
(pause for 10 seconds)
#0 P1000 cr
(pause for 15 seconds)
Well, I found out where I was wrong: for ssc 32 and arduino to work right, we have to set a common ground between them, what I did not set first!
no everything seems logical.
only, I still don’t know how I can command the ssc32, to stop a motor, say, in 0 position, can you code the command? )
Isn’t the “#0 P1500 cr”
command intented to say stop. More or less? You may have to fudge it a little to one side or the other if it is not exact. I don’t know what you mean by in the 0 position. If by this you want the motor to stop at a specific location, I don’t believe the servos have this capability.
If you want to turn the pulses off that are going to the servo, I believe you could issue the command “#0L”. I am not sure if this would stop your servo or not.
Now that you have some of the basics working, you should look through the SSC-32 and experiment. For example instead of going from full speed forward to full speed reverse, maybe you want to ramp up and down to the speed. You can do that with the Time parameter that Robot Dude had in his earlier code. Although Actually you may not want that slow of a ramp… You could also do it in your own code and output several descrete commands with different pulse values.
Good Luck.
Kurt
Well, when I issue “#0 P1500 cr”, the motor connected on the 0 position of the SSC 32 does not stop, and continue to turn very slow. I would like to stop the motor completely and don’t know the command. who knows? )
instead of 1500 try 1495 or 1505. the problem is there is a slight difference between what the ssc-32 considers 1500ms and what the servo considers 1500ms… it is a tolerance thing and analogous to needing a servo offset adjustment to get a servo to line up at 0 degrees exactly. in fact you could probably use the servo offset adjustment capability of the ssc-32 to do just that… make it so that 1500 is actually dead stop. how to do this is documented in the users manual I linked near the start of the thread for reference.
It’s actually the Motor controller that is the culprit. The motor controller can be off by enough to prevent 1500 from stopping the motor completely.
In an effort to redeem myself for incorrect answers in this thread… Here is how you determine and insert the offset to make 1500 stop the motor.
First connect the motor controller to two outputs on the SSC-32 and set it up for independent (non mixing) mode. Connect it to the serial port and open the LynxTerm program.
Type ver in the window and look for the version number to be returned. Then type the following.
#0 P1500 cr
The one motor should slow. Then type the following.
#0 P1510 cr
If the motor speeds up and then goes in the other direction, just change the value in either direction till it stops completely. Note, to make this easier you can click the slider on the right once, then use the up and down arrows on the keypad to find the stop pulse required for the motor controller. Make sure the channel is set to 00.
So if the motor stopped at 1535 the “offset” would be 35.
Now click Registers at the bottom of the screen. Then click default, then click read. Click the offset slider once. Then use the arrow keys to make the offset = 35. Then click Enable Initial pulse offset, then click Write. Now close the Registers box, and type into the terminal window
#0 P1500
and the motor will be stopped. Adjusting this value should allow symmetrical control of the speed and direction of the motor. Now do the same thing for the other motor. The offset should be exactly the same. 8) HTH