View Full Version : Robot steering help needed!
01-01-2003, 09:45 AM
I am charged with coming up with code to help our robot steer smoothly during competitions. I am new to programming a robot yet I have visited parallax and innovation first websites for information.
Anyone have any examples of code that could help steer a robot? I am particularly interested in code that uses sensors. I am learning rather rapidly and should be able to pick up on most examples offered.
Also, are there any online tutorials that could team the programming language used for the Basic Stamp and FIRST? If so, please let me know!
01-01-2003, 10:20 AM
What kind of steering? Skid, swerve, ackerman?
01-01-2003, 11:28 AM
Thanks for your response! I am interested in keeping the robot strait so I guess swerving control. I was thinking of code that would readjust itself automatically when sensing the robot varying from a strait vector. Any ideas?
01-01-2003, 12:00 PM
you could use the gyro chip to sense the angular acceleration of the robot.... mount the sensor so there will be a readout when the robot turns. Then write the code that checks the stick inputs, and corrects the motor outputs if for some reason hte robot is not doing what the operator intended it to do.
Be careful..... Say you are pushing against another robot, you do not want to modify the speed of a motor..... this could lead to situations where you can have a "Steering assist On/off" button on the UI....
Unless you are going incredibly fast, the driver *should* be able to correct for misdirections of the robot.
01-01-2003, 06:31 PM
Before we can help too awfully much you have to have an idea of the type of robot you will be controlling (As sanddrag first stated) One of the most difficult will be the swerve steering, the simplest would be skid steering like a tank, the latter is already pretty much completed for you already in the standard code and on the IFI website. As for learning PBasic, the best tool is the emulator that RBayer wrote (White Papers) or an actual controller (The edu bot will also do this too)
Keep posting for more answers to specific questions.
01-01-2003, 11:43 PM
For extremely simple skid (tank-like) steering and two joysticks, you'd use the joystick values for p1_y and p2_y (changes depending on which ports the joysticks are connected to, so there's also p3_y and p4_y) for input. I think by default they're already read in, so you don't need to deal with that. But don't forget to adjust values because of the different orientation of wheels on opposite sides.
Then look at the very bottom line of the default code for a SEROUT command (convenient example located above it), and substitute p1_y and p2_y for the corresponding PWMs your motors are plugged into.
I'd suggest also putting in a snippet of code (at least temporarily) to kill the motors when the trigger is being held down in case something goes haywire.
vBulletin® v3.6.4, Copyright ©2000-2018, Jelsoft Enterprises Ltd.