![]() |
Re: Arduino Micro with Talon SR
Quote:
Quote:
|
Re: Arduino Micro with Talon SR
Quote:
The obvious answer is just to only send it "forward" commands, using pulse widths between 1.5 and 2.0 milliseconds. Never give it anything less than 1.5 milliseconds, and it will never go in reverse. |
Re: Arduino Micro with Talon SR
Quote:
Quote:
Now, if you only need +/- 90 steps instead of +/- 500, then using servo.writeMicroseconds has no advantage. |
Re: Arduino Micro with Talon SR
Quote:
|
Re: Arduino Micro with Talon SR
Quote:
|
Re: Arduino Micro with Talon SR
Quote:
|
Re: Arduino Micro with Talon SR
You can also specify the servo min and max pulse widths in the attach call:
Servo driveServo; driveServo.attach(3, 1000, 2000); // TALON // widths are in micro-seconds Then use servo.Write() 0 is reverse, 90 is stop, and 180 is full forward. I would still calibrate the Talon (or other motor controller) to ensure it goes full speed. Write an arduino sketch that starts at neutral and waits for a character to arrive from the serial port. Then have it switch to servo to full speed forward, wait for another character and then go full reverse. After waiting for another character, go to neutral. Use Serial.Print to tell the user whats going on and prompt for a character. If you use the serial port monitor in the arduino IDE, you will have to click the "Send" button after each key. One other thing: I put a 330 ohm resistor in series with the white wire driving the PWM input on the Talon so it doesn't try to drive too much current through its input opto-isolator. |
Re: Arduino Micro with Talon SR
Quote:
|
Re: Arduino Micro with Talon SR
Quote:
Code:
driveServo.attach(3, 670, 2330); // Jaguar |
Re: Arduino Micro with Talon SR
Quote:
Thanks! |
Re: Arduino Micro with Talon SR
Quote:
|
Re: Arduino Micro with Talon SR
Quote:
I'm fully aware of the need to program for integers in some cases. I even wrote a fully integer semi-swerve drive inverse kinematics a few years ago. My semi-swerve platform was about 1/3 FRC scale, with a 0-180 degree maximum steering angle steered by servos, and 25mm 1000rpm gear motors for drive, and yes, it was controlled with an Arduino. Unfortunately, the only hard drive that the code was on has since died. The key was that I wrote a hypoti(x,y) subroutine that calculated an integer hypotenuse using max(x, y) and the ratio 256 * min(x,y) / max(x,y) (where x and y were preprocessed to be non-negative), and an atan2id(y,x) that returned atan2(y,x) in degrees based on the same ratio, whether abs(x) or abs(y) was larger, and the two input signs. IIRC, the atan2id() routine had two separate cubic fits to cover the span from 0 to 45 degrees, that broke based on whether 2*min(x,y)/max(x,y) was 0 or 1 (that is, at about 28.8 degrees). |
Re: Arduino Micro with Talon SR
Quote:
|
Re: Arduino Micro with Talon SR
Quote:
|
Re: Arduino Micro with Talon SR
Quote:
|
| All times are GMT -5. The time now is 02:13. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi