![]() |
Controlling robot with arduino
Hi,
I am trying to control one of our old robots with arduino. But I really don't know where to begin. Arduino UNO has 6 PWM pins to which I can connect the victors. But I am not sure how I can control with joysticks. Could you please give me some clue? |
Re: Controlling robot with arduino
It is doable, but requires much more effort than its worth.
First, you'd need to get an Arduino Ethernet Shield to connect the Arduino to an ip network. You'd then need to write a client application that controls the robot, along with sending the joystick button states, axis values, and other data to the arduino, over the network. (Not as easy as it sounds) You'd also need to write a program for the arduino that SAFELY gets the values from the computer (joystick and control mode: disabled or enabled), and uses them to set the values of victors/spikes/solenoids/etc... Be sure to implement important safety features like having the robot automatically disable when communication is lost, not driving out of control, etc. It's a long process, and can be a great learning experience. IF you're looking for a quick and easy way to get an old robot running, this is not the way to do it. Feel free to contact me if you want more details or have any questions. |
Re: Controlling robot with arduino
First off, this is a great project! I would definitely suggest you do this. It's not anything that hasn't been done before so you should find plenty of information in a quick Google search (remember there is nothing really different between the FRC robot and a robot someone made in their workshop using RC car components - the building blocks are the same. You may want to look at ArduRover and ArduPilot.
There are actually some products readily available to help, such as this shield that interfaces with the digital sidecar <http://www.andymark.com/product-p/am-2258.htm> I assume you will simply be replicating what the FRC control system does on this old robot, so I would suggest to first list out all the motors, motor controllers, sensors, spike relays and the method which they are controlled in software (PID loop, PWM, Meccanum drive, tank drive, etc.) This will help you build a plan for the pins and the coding. From there on out, you will be tackling each subsystem: drive, manipulator/shooter/scoring/collecting device, and any other features of the robot in code. I'd focus on getting it controlled one motor controller at a time and work up to more complex loops as your skill increases. Are you using pneumatics? |
Re: Controlling robot with arduino
An Arduino Motor Shield will help, too.
Arduino site: http://arduino.cc/en/Main/ArduinoMotorShieldR3 Ladyada tutorial: http://www.ladyada.net/make/mshield/ Sparkfun's version: https://www.sparkfun.com/products/9815 |
Re: Controlling robot with arduino
This is not a hard challenge! Check out our RobotOpen driver station app...
www.robotopen.biz Our HTML5 app will allow you to read USB gamepads and directly control your Arduino board. It offers two way communications, data logging, live parameters and a host of other features. Free open-source download. We have shields as well if you'd like to interface with an existing digital sidecar or pneumatics bumper. |
Re: Controlling robot with arduino
Quote:
|
Re: Controlling robot with arduino
Quote:
|
Re: Controlling robot with arduino
Quote:
|
Re: Controlling robot with arduino
There is a USB Host shield for the Arduino. There are 3rd party library's available that would allow a wireless PlayStation 3 controler to work with the arduino. This would give a minimal blue tooth connection to the arduino for control.
|
Re: Controlling robot with arduino
Quote:
|
Re: Controlling robot with arduino
Like I stated above, you only need our RobotOpen Control Shield if you want to continue using your digital Sidecar.
Some features will be lost of course, but in general our driver station app will perform as expected using just an Ethernet enabled Arduino. |
Re: Controlling robot with arduino
You can do this cheaply and easily... you just have to think outside the cRio/FRC "box" a bit. I currently have a small "fleet" of vehicles running using Victor 888 controllers and CIM motors attached to Arduino Unos. It works great, and is quite easy to do... I've etched custom shields to attach the speed control pins and joystick (or bluetooth) connections, but you could do this easily enough using a breadboard, and then solder it up onto some perfboard/protoboard. I did have to recalibrate the Victors, as the Arduino was giving me slightly longer pulses than expected, but that is really easy to do... just push the "calibration" button on the Victor and move the joystick full circle to give "max" and "min" signals to the Victor, then let go of the stick.
Here's some code for controlling Victors on Pin8 and Pin9 using "joystick" mode, from a joystick connected to A2 and A3. The code will also print the values to your serial monitor. The downside is that it requires a joystick to be wired to your uno/robot at all times. (Which, in the application we have, where the driver is sitting on the vehicle... works great!) Code:
#include <Servo.h> //include the Servo library for controlling the Victor speed controlsBy the way, you can get BlueBots Pro for $1.65... definitely worth it to support the developer considering that you'll replace about $1,000 of robot control equipment with a $30 Arduino, $10 bluetooth dongle and an Android phone that you may already own. Code:
#include <Servo.h>Jason |
Re: Controlling robot with arduino
Highly recommend the Romeo robotic controller board. It supports XBee devices, so all you need is this device as a remote controller. All up, Romeo, controller, 2 - Xbees and battery sets will be $175.
|
Re: Controlling robot with arduino
6 weeks ago I saw AndyMark had the Arduino kit for $130 and now they have sold out. Could this possibly replace the CRio?
|
Re: Controlling robot with arduino
I have just purchase one of this arduino from AnyMark and I have done all the programming and I am ready to test it on a robot that we have design and pour our personal money. My question is how can you attached a solenoid? Would you hook it on the relay ports on the sidecard? or would you use a spike to operate the solenid, we are using 12V solenoids. Also I though about using this cheap relays that we use at my school for simple projects but the coil is rated at 12VDC as well and as far as I know the sidecard can put out a max of 5V.
|
Re: Controlling robot with arduino
Quote:
You can wire a Spike to the DIO outputs and use that to control your solenoid. See here for previous attempts at doing this. Control Spike using Arduino Alternately you can use our RobotOpen Solenoid Shield which directly interfaces with the KOP pneumatics bumper and gives you control of 8 solenoid outputs. The Solenoid shield stacks under the control shield and is addressable using the same RobotOpen interface and libraries. RobotOpen Solenoid Shield |
Re: Controlling robot with arduino
EDIT: Woops, didn't notice that post up there ^
|
Re: Controlling robot with arduino
Thank you for your response and we are going to look into the solenoid shield it seem like a good investment. Also I have an other question is there a way to monitor the battery usage on the robot throw the arduino. I know that the cRio uses the first slot to monitor the battery of the robot. I have search and the only thing that I have found is a component call voltwatch but it connects to the battery and it displays the voltage on a display that the device has.
-Thank you |
Re: Controlling robot with arduino
Quote:
Well, technically it will be higher than that when the battery is fully charged, becuase the battery will be at about 13.3V. In any case, you can use one of the analog inputs on the Arduino to measure the voltage from the voltage divider. Use serial.Println to display the analog reading, and compare it to the voltage you measure... this gives you a conversion factor to turn the raw ADC voltage reading into a true battery voltage reading. Jason |
Re: Controlling robot with arduino
I understand how to wire it on the arduino but i am having some problems on the programming an its logic so far following the example from the library I have
ROAnalog analogZero(0);// Analog Channel 0 declaring which analog input to use and RODashboard.publish("Analog0", analogZero.read()); // Display on dashboard but were is the logic of the conversion going to go. Is it on the enable loop and if it is do I use a "int read();" |
Re: Controlling robot with arduino
http://youtu.be/jde3CIXQ8Jw
![]() I picked up the relay board off of eBay, this was prior to 221 developing the solenoid shield. If I did it today, I would just by the shield. Code:
#include <SPI.h> |
Re: Controlling robot with arduino
Is there a way to use the 2009/2010 wireless setup to run with the Arduino? I have follow the instructions from those years but I cant get it ti work I am using a lynksys E2000 router and a WGA600N game adapter any help would be appreciated
-Thank you |
| All times are GMT -5. The time now is 22:05. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi