![]() |
Driver Station Usb
This year we were only able to use usb-hid joysticks attached to the DS, (as well as the 8 io and 4 analog). but my team would like to make our own pseudo joystick, using a microcontroller like an arduino. Would a usb-serial device (an FTDI chip) be able to be used on the driver station? :) or would i have to do something like AvrUsb on the mcu? :(
|
Re: Driver Station Usb
[Explanation of USB device classes]
The USB specification contains several predefined "classes" of devices, each of which has a corresponding protocol of commands that are sent between the USB host (in this case the DS) and the USB device (the joystick). HID (Human Interface Device) is one such device class, CDC (Communication Device Class, the class most commonly used for USB-serial devices like FTDI chips) is another. These classes allow USB hosts to use generic drivers for devices that are connected to them, instead of requiring a driver for each specific device. The designers of the FIRST control system like this because it means that they only need one driver to be able to interface with almost every USB joystick (there are some exceptions, such as the Xbox controllers, which have been noted previously). Because each device class has its own unique set of commands, a device that does not implement the HID class will not be able to work as a joystick. It will not be identified to the host as a HID device, and even if the host could be tricked somehow, the device would not know how to respond to the commands being sent. As a side note, the USB commands are also at a lower level than the serial data sent through a USB-serial device, which is itself encapsulated in USB data packets, so it's not simply a matter of sending the right serial data over a USB-serial device. [What your microcontroller needs to do] In order to be used as a USB HID device, your microcontroller will either have to be connected 1) to another chip that formats the data into the format of HID packets, such as maybe taking apart an old joystick and wiring the various buttons and potentiometers to digital and analog outputs, respectively, on your microcontroller, or 2) directly to the USB bus, such as in the AVR USB design. [My recommendations] I do not have any experience with AVR USB, and if they already have code that implements the right sections of the HID class, that could be a very viable method. However, I have made attempts before to implement USB on other devices, and while it is possible, it's not fun to wade through the specification documents. If you use a microcontroller with digital and analog outputs, another option instead of wiring it to an old joystick is to simply wire it into the exposed analog and digital input headers on the side of the DS. This is what most teams use when adding their own custom controls. Good luck, --Ryan |
Re: Driver Station Usb
I would be very surprised if we have the same drivers station next year. So who knows what input will be avaliable.
|
Re: Driver Station Usb
is it possible to bitbang the io pins on the ds fast enough for ttl level serial?
we are building a touchscreen inteface to the driver station for autonomous mode, with liquidware's touchshield slide. if we could use the io pins then that could free up a lot of programming time |
Re: Driver Station Usb
Quote:
FTDI isn't the easiest way to go about this - http://www.ftdichip.com/Support/Know...icesappear.htm Many microcontrollers will have demo code that will do what you want. I know firsthand that code for PSoCs and PICs are available, and I'd be surprised if any USB-device capable uP didn't have it. |
Re: Driver Station Usb
Quote:
So in short, while it is possible, I believe you would be better off mapping the analog and digital inputs to the controls exposed on the touch screen, perhaps using digital potentiometers to output analog values if necessary. What kind of interface are you trying to develop on the touchscreen? --Ryan |
Re: Driver Station Usb
The screen would be used to determine the position and place the robot should travel to during the auto period. the screen would be powered before the match and the position would be saved to eeprom, so on the next power up it would report to the crio a cartesian point (or points if possible) with rotation. so it would have to be read before the robot is enabled
|
Re: Driver Station Usb
Quote:
As a side note, for other suggestions on how to rapidly set autonomous mode parameters, see this thread. Of course. none of this applies if you need this functionality during matches as well. --Ryan |
Re: Driver Station Usb
Though, im sure if i got it working for auto, then they'd want to use it for an operator control :ahh:, so an interface to the DS would be best.
what baud could be obtained through usb? HID is for the most part uni-directional, so an output pin could be used to signal auto / tele modes. and have it dynamically update the controls. Do you know of any cheap ethernet controllers for mcus? your last point could make it into a small dashborad :cool: Telemetry, speed and other statuses could be displayed, and have it for times not in a comp :yikes: |
Re: Driver Station Usb
Quote:
Quote:
One thing to consider though is that FIRST has been very particular in the past about what types of devices can plug into the control inputs of the DS/OI. They might not allow your interface to be both connected as a dashboard and as a controller. <Insert disclaimer that I've never been a robot inspector and that rules are subject to change without warning from year to year anyway> Quote:
--Ryan |
Re: Driver Station Usb
Well, does the lantronix xport have an output saying if an ethernet cord is plugged in?
if so, then the board could dedicate all processing time to the parsing of dashboard data and ignore the touchscreen (it would still get power from the DS though and the oled screen would be showing the data) or it could send the commands for auto then switch to a dashboard display and disable the touchscreen, the dashboard data has the game mode in it right? |
Re: Driver Station Usb
Quote:
Quote:
Just to clarify, though, you won't be able to send data back to the robot through the dashboard ethernet port (based on this year's rules/field setup), as the DS blocks all traffic besides the dashboard packets coming from the robot when it is in competition mode. I would also warn against trying to draw power from the DS. According to the information provided in the control system manual, the DS is only rated for 900 mA, total system current. I don't know what the exact specification on the exposed power pins are, but I'd be surprised if you could draw much more than 150 mA, since they're intended to be used primarily for pullup sources or similar. That may be enough to power a microcontroller by itself, but the driver for your display alone is going to draw considerably more than that. --Ryan |
Re: Driver Station Usb
Quote:
Quote:
Quote:
|
Re: Driver Station Usb
Quote:
Quote:
Quote:
Note, however, that the wall wart supplied in the KoP is only rated for 1000mA, so you'll have to make other arrangements to supply the needed power while developing the system. --Ryan |
Re: Driver Station Usb
well this is the screen that will be used
http://www.liquidware.com/shop/show/...chShield+Slide i don't know its power usage, (plus an xport ethernet, and arduino (atmega 168)), hopefully it not going to be too much |
Re: Driver Station Usb
One option would be to use the analog inputs - you might be able to produce two voltages proportional to the X and Y axis on the screen.
My favorite method is still to pretend to be a USB joystick. Quote:
The actual pins on the DS can safely handle 1 Amp each, so 2 should be fine. |
Re: Driver Station Usb
Quote:
take 3 analog pins 1 X 2 Y 3 Point # and update per point on screen Quote:
Quote:
|
Re: Driver Station Usb
****PLEASE NOTE: I have very little experience programming, so what I am about to say may not work, it is just an idea.****
I was just thinking, if you really want a touchscreen device, use an iPod touch or iPhone. With the release of OS 3.0, Apple opened up the possibility of utilizing the usb connector for outside devices. Maybe you could build a program for the iPod/iPhone to emulate a HID and get it to connect to the DS. |
Re: Driver Station Usb
Quote:
|
Re: Driver Station Usb
While i wait for everything to arrive (Slowwww mail :mad: ), i have almost finalized how its going to work (Ethernet pending)
3 Analog inputs on the driver station, #1 X input 100 points of resolution (Have to account for Electrical noise) #2 Y input 100 points #3 Point # 50 points (To reduce waypoint navigation math) 1 digital in #1 to signify point # change 1 Digital out #1 To signify robot received point 1 digital potentiometer to the arduino and driver station liquidware touchshield slide to arduino to digital potentiometer |
Re: Driver Station Usb
Quote:
Quote:
Code:
set valid data bit to 0Code:
if valid data pin is 1: |
Re: Driver Station Usb
Quote:
Code:
bool DsPoints[100][100]; |
Re: Driver Station Usb
Quote:
EDIT: If you do want to use a higher resolution digital pot, the AD5292 has 1024 steps. Still, digital pots aren't designed for this type of use. |
Re: Driver Station Usb
Quote:
|
Re: Driver Station Usb
Quote:
Your update rate is 50Hz (times per second), so you want to be sure that you can change at least that quick. Lets target 100-200 Hz for our filter. An RC filter's cutoff frequency is 1/ (2 * pi * R * C) . Play with this calculator http://www.muzique.com/schem/filter.htm to find good values. The default 10k and 0.1uF would probably work well. * This places the filter at about 160Hz. Make sure your DCM** signal is significantly quicker than that (2kHz? faster?) and you should be good to go! * If you double R, you can cut C in half. So, how do you choose a value? Basically, pick what you can get, and don't let R get too big (over 100k). ** People often say PWM (Pulse Width Modulated) when they mean DCM (Duty Cycle Modulated). I make sure my students know which one they really care about - do they care how long the pulse is, or do they care about the duty cycle? Put more clearly, if your base frequency changes what needs to stay the same? |
Re: Driver Station Usb
i have a large supply of resistors, but can only find 10 uf capacitors and larger
|
Re: Driver Station Usb
Quote:
Code:
ds->setDigitalOut(receivedPin, !ds->GetDigitalOut(receivedPin));--Ryan |
Re: Driver Station Usb
well i forgot that part, the hard part is going to be in calculateRoute though :rolleyes:
|
Re: Driver Station Usb
well i got the digital pots in the mail today (couldn't get low pass to work properly). first try on the arduino and it works! They are 10k 256 step pots
(Maxim ds1803). waiting for the screen now. |
Re: Driver Station Usb
Awesome! Let us know how the rest goes.
--Ryan |
Re: Driver Station Usb
simple test program for arduino which i am using for the pots right now
Code:
#include <Wire.h> |
Re: Driver Station Usb
here is the code for the arduino, the touchscreen has its own processor that talks over ttl serial to the arduino
the arduino takes the output from the screen to the DS io pins Code:
#include <Wire.h> |
Re: Driver Station Usb
1 Attachment(s)
digi pots on breadboard, just waiting to be soldered
|
Re: Driver Station Usb
1 Attachment(s)
now all thats missing is the screen and prototyping shield
The Pwm wires plug into the drivers station, which go to a db9 connector. the db9 is used so that the drivers dont have to unplug the PWMs to take it out of the box for strategy planning. because i would imagine that the pwms could get plugged in incorrectly and fry the screen :( |
Re: Driver Station Usb
The Pwm cords go to the driverstation, the serial port to the screen
(and i just noticed how far away from USB I've gotten, the title is definatly incorrect) The parts are definatly shipped :D |
| All times are GMT -5. The time now is 02:41. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi