Raspberry pi with talon

Has anyone used a raspberry pi to run a motor controller. If so how have you done the pwm.

If you wanted to do this for an FRC robot, well, you can’t because only the digital sidecar may connect directly to the PWM motor controllers. I don’t believe the RasPi has PWM support built in, but you could use the CPU to manually generate the PWM signal. Alternatively, you could get something like this which uses the i2c bus to control multiple PWM outputs: http://adafruit.com/products/815

EDIT: There is one PWM output, but that may or may not be enough for your needs.

I have not done so personally, but basically what you want to search for is how to control a servo with the raspberry pi. Servos and FRC MotorControllers are controlled the same way in code, they just each use different length Pulse Positions.

A quick Google search presented this.

It seems like a good tutorial. Although I’m sure you already did a Google search before posting on Chief.

An interesting tutorial on a software based PWM tutorial.

I have not had experience with it myself, however I do own a Pi and after my exams finish tomorrow I may play around with it a little bit!

I would suggest an arduino for this sort of thing. The raspberry pi really shouldn’t be used for this. It has a full stack for a reason, it is meant as a higher level device than an arduino or other micro controller. That being said, there is no reason why you can’t control a PWM with a pi, it just is a waste of the potential.

If the pi is also doing vision processing…

Using a pi for just a single Servo/PWM output may be overkill, but I doubt it is the entire application.

The pi can be a full cRIO replacement for a practice or smaller robot for teaching, etc.

Also, a pi and an Arduino are nearly the same price.

That’s what I was gonna say… if the computer only costs $35, who cares that you’re not using it’s full potential?

This robot will be used for a teaching tool and is a off season project. We will need to run 2 motor controllers along with multiple other features. We are just wondering how much processing power will 2 PWM take up.

You really shouldn’t be running a robot on a system with a non-real-time operating system. There is no guarantee that your motors would be prioritized over less important tasks, like image processing. Not having consistent control of motors isn’t just hard to control, it’s downright dangerous.

Yes, I have successfully driven motor controllers using the Raspberry Pi, but they were Jaguars, not Talons. The method works for anything controlled with a RC style PWM signal. I used the servoblaster drivers. These allow you to control up to 8 PWM channels simultaneously using the DIO pins. I started by creating a simple text based user interface using BASH scripting language. Then I moved to python, first controlling the motors with a joystick attached to the Pi, then using two Pi’s, one which would be on the robot and the other that acts as a control station. When I paused for build season, the control station could send commands to the robot over a wi-fi link.

I posted all of my code on the Raspberry Pi forums. Once you are registered, you can find it by reviewing my posts using this link.

Also, if you go to my youtube channel, linked in my signature, you will find videos demonstrating the various stages of the development of the system.

The goal is to develop a robot control system as cheaply as possible. I would ultimately like to be able to sit in my study and drive a teleoperated robot, with live video, around my backyard using my home wi-fi network. Right before build season, I could run 8 PWM channels and stream video from the robot controller Pi, but could not get the driver’s station Pi to display the streamed video, (though I could display it on my desktop, laptop, Nexus 7, and smart phone).

toddf. thanks for your help. we are working on a very similar project as you are. This will be very help to start out.