As programmer (also a student), i am messing around with a 1 Joystick Gradient control system for my school’s projectFirst Robot. I just recieved the 2004 EDU kit, but was unable to figure out how to use a joystick with it.
Through some research, i was able to determine that it would not be possible natively to get it connected correctly, so I was wondering if anyone else could help:
Based on the 2004EDU and the previous year’s joysticks, how would it be possible to force the joystick to use 2 PWMin ports? Would it be as simple as taking three of the (correct pins obvously) pins and attaching a male connector on the end for each direction, or would a specific converter be required?
with all things in FIRST, start with the directions.
The new edu controller is not designed to have a joystick connect to it directly. It is designed to have a Radio Control (model car or boat) receiver connected to its PWM inputs.
PWM stands for Pulse Width Modulated. When a command is received from the transmitter (based on where the joysticks are being pushed) a pulse is output on the PWM connectors that is somewhere between mostly on and mostly off. I dont know the exact timing off the top of my head.
If you wanted to make a joystick to PWM input circuit, you would have to use a microprocessor to read the analog values of the joystick, and convert that into a pulse width modulated signal.
Or there is a way to connect the joysick to the EDU controller, but its not what you would normally think of doing with a joystick - you could connect it to the analog inputs, supplying 5V from the analog input connector to the joystick, and using the output as a variable voltage.
This would be easier to do, and your RC software could then read the joystick inputs on the analog input ports. Normally those ports are used for other types of sensors, the yaw rate sensor, a potentiometer, a custom circuit…
The details on how to do that are in the 2004 EDU robot controller reference guide, page 9 - hooking a potentiometer to the analog inputs. The joystick contains two potentiometers inside, one for each axis
You could not connect a joystick to a PWM input, however you could connect it to the Analog and Digital Inputs.
You’ll have to build an adapter that takes the joystick input (a 15-pin male) and connects to the Analog/Digital Inputs on the edu-RC (PWMcable-type connectors).
There’s a white paper on ChiefDelphi that gives you the pinouts for a standard joystick.
DB15 Pins:
1,8,9,15: connect to any of the “analog +5v” pins on the edu controller.
4,5,12: Any ground on the edu controller.
3: analog 1 “sig”
6: analog 2 “sig”
add the following code to user_routines.c right after "void Default_Routine(void){ ":