I have an auton code that im perfecting for a competion tommorow why does it only run about 3 4ths of my code and then stop??
It is impossible to troubleshoot code without seeing it. If you post a screenshot of your code, and some additional information regarding the nature of your problem, we will be able to help you more.
Were i put the space is were it will no longer run when i ran it i had it connected
I’ve noticed that usually it stops if the motor is stalling, is “CLAW” able to close 100 deg?
Yes it can close all the way to 66 degrees
Have you tried maybe close claw and a wait time
i will try that 20 char
i figured it out thanks for your help
Here are some tips, I hope this helps.
You should use a motion command with a wait time, then a stop the motion command. Your problem with using a spin to an angle command to tell the motor to spin X degrees, is that the program will hang at that step continuing to try to drive the motor, waiting for the exact angle to be reached. If in the case of a claw, the angle is blocked by an object it will never reach its goal angle, and your program hang at that spin block.
Think of the motor as a separate computer , and the main brain has to tell it how to act. For each motor you should set its breaking method (hold/coast/break), its max torque percent (defaults to 50% but should be 100%), the velocity from -100 (reverse) to +100(forward) percent, and an enable command either forward/reverse or stopped.
It helps to make subroutines off to the side for “drive forward (1sec)” that you can call in your autonomous section, to make it easier to read.
When using joy stick controls, each of the 4 axis give the program a number of -100 to +100 to use as a sensor, to send out to a wheels velocity command. When a joystick is let go, it goes to “0” at the middle, and a motors velocity goes to 0 and it stops. you don’t have to use a Stop command , it will stop based on the velocity being “0” even though it is commanded to go Forward. If your robot is jerking or you see the wheels spin out , it is being told to move too fast, which may cause the bot to turn to the left or right a little and not go strait like you want.
Good luck.
@TNBrian
This topic was urgent 8 months ago, be careful when you reply to a topic that it’s still relevant.