![]() |
Arduino PWM output
I just got my Arduino Uno and I'm trying to learn how to use it so couple of questions. Can the Arduino support reverse PWM or can it only output values from 0-255 so only one direction? Would the PWM output be compatible with Jaguars, Victors and the VEX motor controllers? Would this be only in one direction?
I know that the RobotOpen shield gives ability to use the digital side car but is it worth the price? |
Re: Arduino PWM output
To figure out if the analogWrite() function's default frequency and range of duty cycles is compatible with the Jaguars or Victors, you will need to read the data sheet and compare to what the Arduino documentation says. There's also the robotopen project, which seems to have done work with this.
If I had to guess, I would say no, the analogWrite() function will not be compatible with the Jaguars. Why? The code I've seen to control a hobby servo from the same port you can control a Jaguar from sets up the port the same way, and hobby servos do not actually use "PWM". They use pulse-position modulation, which is different. So what I can suggest, if you need something to happen quickly, is looking for the Arduino Servo library and using that to generate the signal to feed the Jaguar. For future reference, please know that "PWM" is often used to (some would say incorrectly) refer to about three different things: 1) pulse-width modulation (PWM), where the duty cycle of a fixed frequency signal is varied (what the analogWrite() function does); 2) pulse-position modulation (PPM), which has a fixed-time pulse separated by variable time pulses for the values (750µs to 2400µs, used in the VEX controllers and by hobby servos, and other various motor controllers); 3) pulse-length modulation (PLM, other), used in simple IR remote controls and usually proprietary thingies. Not very common. Usually a dead time of 600µs followed by a 1 (1200µs) or 0 (600µs), repeat as necessary. |
Re: Arduino PWM output
The standard Arduino PWM will likely not work with Victors. Check out the myservo.write() function in the Arduino Servo Library. The Arduino software should have a servo example which should work with the Victors.
|
Re: Arduino PWM output
The same PWM code that controls a servo for Arduino will work to drive a speed controller. Disconnect the power (red) lead of a std pwm cable, just connect the white (signal) and ground.
Motor is off when servo receives the same signal as 'centering' a servo (90 degrees) 'Zero degrees' is full reverse to the motor, 180 degrees full forward. Signal should look like this: ![]() Another very good explanation is here:http://team358.org/files/electrical/PWMGenerator.pdf |
Re: Arduino PWM output
Quote:
|
Re: Arduino PWM output
Quote:
Code:
Servo jag; |
Re: Arduino PWM output
Quote:
Quote:
Using the Servo library will give you the full range of control over a Victor. We have developed testing platforms which feed Arduinos an analog input to drive a Victor; no recalibration was necessary, but the code had to be tweaked a little. You will have to either recalibrate the Jaguar or adjust the methods found in the Servo library to achieve a full range of control. Quote:
|
Re: Arduino PWM output
At least for running Victors, you'll need a Signal Driver or create equivalent functionality, using a FET or similar. Not sure if Jaguars have the same requirement.
|
Re: Arduino PWM output
As stated above, a RobotOpen Shield is all about building a more complete control system that uses wifi to send wireless commands.
You can definitely control both Victors and Jaguars using an Arduino straight out of the box. This robot and this robot were created before we invented RobotOpen. They both use Arduino as the basis for their control system. The complete code used can be downloaded here. |
Re: Arduino PWM output
Quote:
|
Re: Arduino PWM output
Quote:
Yes, I2C can be used with a an Arduino. The cRIO has no direct I2C output, but there are I2C ports on the DSC. |
Re: Arduino PWM output
Quote:
Here is the relevant shield on sparkfun: http://www.sparkfun.com/products/9026 |
Re: Arduino PWM output
1 Attachment(s)
Quote:
We just had to use the transaction method of the I2C class. relevant part of our code: Code:
UINT8 valuesGotten[2] = {0, 0}; |
Re: Arduino PWM output
Quote:
Both RobotOpen and the Ethernet Shield are a little bit expensive for personal use. If our team needs it next year, I guess we could use them. But using just the Ethernet Shield might be another possibility because we have our custom java dashboard so if we want, we might decide to ditch the CRIO and FRC system for our practice bots. |
Re: Arduino PWM output
If you read the datasheet for Victors, you'll notice that they accept a "servo" PWM signal. Hence why you must use the servo library for Arduino.
|
| All times are GMT -5. The time now is 06:28. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi