Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

Hobby Grade RC Car Control Suite


  • Please log in to reply
44 replies to this topic

#1 Chris Seto

Chris Seto

    Advanced Member

  • Members
  • PipPipPip
  • 405 posts

Posted 23 August 2010 - 02:21 PM

Here is a little software package first coded for the FEZ Domino, now ported to the Netduino. Basically, it's a series of drivers that allow you to control a hobby grade RC car. I am using this set of driver on my Traxxas XL-5 based robot, so the speedcontrol config files are geared toward that ESC in this release. You may need to calibrate your ESC to work with these drivers, unless you modify the timings in TRAXXAS_XL5.cs Link: http://files.chrisseto.com/1Vu The following drivers are included: * PPM Decoder (For decoding signals from the RX) * Servo API * ESC API Program.cs demonstrates proper use of the various drivers. Please note that ESC reversing is still a work in progress. I need to call Traxxas today to find out what's up with it. Also note that you should always do your tests on a stand before allowing the car to drive around on it's own. It may sound like an obvious thing, but my car has taken off several times at full throttle due to me not following this rule. :rolleyes: At any rate, enjoy!

#2 greg

greg

    Advanced Member

  • Members
  • PipPipPip
  • 169 posts
  • LocationChicago, IL

Posted 23 August 2010 - 02:44 PM

Here is a little software package first coded for the FEZ Domino, now ported to the Netduino. Basically, it's a series of drivers that allow you to control a hobby grade RC car. I am using this set of driver on my Traxxas XL-5 based robot, so the speedcontrol config files are geared toward that ESC in this release. You may need to calibrate your ESC to work with these drivers, unless you modify the timings in TRAXXAS_XL5.cs

Link: http://files.chrisseto.com/1Vu

The following drivers are included:
* PPM Decoder (For decoding signals from the RX)
* Servo API
* ESC API

Program.cs demonstrates proper use of the various drivers.

Please note that ESC reversing is still a work in progress. I need to call Traxxas today to find out what's up with it.

Also note that you should always do your tests on a stand before allowing the car to drive around on it's own. It may sound like an obvious thing, but my car has taken off several times at full throttle due to me not following this rule. :rolleyes:

At any rate, enjoy!


Ah Chris - you're doing something I'm planning! I wanted to build a waypoint based robot that would be able to be overridden by "home" control wirelessly - and also feedback information via the sensor suite. So I was planning on something similar to yours but adding in some XBee modules for remote data, plus a bit of a sensor suite beyond the IMU (for navigation).

We should come up with a race that's not just about navigation but also includes "tasks" along the race route -- points for completing the tasks and time - so it'd be about speed, accuracy and control. Let the robot be pre-programmed with waypoints but have to stop at one or more locations, switch over to manual control and have the operator perform a task, then switch it back on to autonomous control to continue. Hmmm.

-G

#3 Chris Seto

Chris Seto

    Advanced Member

  • Members
  • PipPipPip
  • 405 posts

Posted 23 August 2010 - 03:54 PM

Hi Greg, That makes 4 of us doing the same thing then, hahaha. Yeah, mine's shtick is that it's gonna run the course really fast. I know the Stampede Xl-5 will go really fast even with the weight of the electronics on it, so I'm going to see just how far I can push it in terms of speed. There will be a gyro to prevent rollovers and over-acceleration. I am using a 9DoF Razor IMU. What are you using?

#4 greg

greg

    Advanced Member

  • Members
  • PipPipPip
  • 169 posts
  • LocationChicago, IL

Posted 23 August 2010 - 04:01 PM

Hi Greg,

That makes 4 of us doing the same thing then, hahaha.

Yeah, mine's shtick is that it's gonna run the course really fast. I know the Stampede Xl-5 will go really fast even with the weight of the electronics on it, so I'm going to see just how far I can push it in terms of speed. There will be a gyro to prevent rollovers and over-acceleration.

I am using a 9DoF Razor IMU. What are you using?


Same one I was eyeballing. It's simple, it's got everything, and it communicates cleanly via serial. Besides, I love SparkFun. :) They've mooched a LOT of money off me the past few weeks.

#5 Chris Seto

Chris Seto

    Advanced Member

  • Members
  • PipPipPip
  • 405 posts

Posted 23 August 2010 - 04:03 PM

Me too, they are profiting like crazy. I know Nate from an engineering conference he used to go to and he said that they were increasing in profit by 100% a year :blink:

#6 greg

greg

    Advanced Member

  • Members
  • PipPipPip
  • 169 posts
  • LocationChicago, IL

Posted 23 August 2010 - 05:26 PM

Me too, they are profiting like crazy. I know Nate from an engineering conference he used to go to and he said that they were increasing in profit by 100% a year :blink:


I can easily see why - they are price competitive with others, they have good documentation, they have a "fun" website, and they come up with breakout boards for everything that makes our lives SOOOO much easier!

#7 greg

greg

    Advanced Member

  • Members
  • PipPipPip
  • 169 posts
  • LocationChicago, IL

Posted 23 August 2010 - 07:11 PM

I can easily see why - they are price competitive with others, they have good documentation, they have a "fun" website, and they come up with breakout boards for everything that makes our lives SOOOO much easier!


Chris what made you select the Traxxas? I've been evaluating a couple of chassis and the Stampede is one but I've been leaning a bit towards the Team Associated RC10 kits after talking to a few folks who are involved in the "RC scene".

-G

#8 Chris Seto

Chris Seto

    Advanced Member

  • Members
  • PipPipPip
  • 405 posts

Posted 23 August 2010 - 11:37 PM

Hi Greg, I did a ton of research before I bought the Traxxas. The main reasons are as follows: * It's big * It has high ground clearance * The mounting posts are nearly level and are equal distance apart * Plenty of power * Plenty of room to beef up the shocks * It's very affordable ($174 with shipping with coupon code from Tower Hobbies) I would highly suggest avoiding any smaller cars, like the RC10 (I even looked at that one) More info on this project is available on my blog: http://www.chrisseto.com

#9 Szymon

Szymon

    Advanced Member

  • Members
  • PipPipPip
  • 108 posts
  • LocationPoland, Krakow

Posted 24 August 2010 - 10:25 AM

Chris, The project looks super cool! Please keep posting about your progress. I'm busy now with some other things but would like to follow along and build one later too.

#10 Chris Seto

Chris Seto

    Advanced Member

  • Members
  • PipPipPip
  • 405 posts

Posted 24 August 2010 - 12:29 PM

Thanks! The project's name is RWAR. there's already a thread for it here, so I'll start posting there soon. At any rate, there is going to be a MAJOR update coming later today to the drivers. I figured out the whole reversing/braking thing which was giving Hai and I headaches. I also dramatically simplified the ESC driver.

#11 greg

greg

    Advanced Member

  • Members
  • PipPipPip
  • 169 posts
  • LocationChicago, IL

Posted 24 August 2010 - 04:30 PM

Hi Greg, I did a ton of research before I bought the Traxxas. The main reasons are as follows:

* It's big
* It has high ground clearance
* The mounting posts are nearly level and are equal distance apart
* Plenty of power
* Plenty of room to beef up the shocks
* It's very affordable ($174 with shipping with coupon code from Tower Hobbies)

I would highly suggest avoiding any smaller cars, like the RC10 (I even looked at that one)

More info on this project is available on my blog: http://www.chrisseto.com


Yeah after doing more research the SC10 (or RC10) from TA isn't the optimal chassis to build upon - plus all the ancillary costs with a TA frame.

I'm looking at the Stampede VXL right now rather than the "normal" Stampede -- you can get them on eBay used for a reasonable price and since I'll be tearing the darn thing down for the most part used isn't a big deal. Plus since it's already got brushless motors you just need to upgrade the pinions and swap in LiPo batteries for MORE POWER! And we all like that. :)

-G

#12 Chris Seto

Chris Seto

    Advanced Member

  • Members
  • PipPipPip
  • 405 posts

Posted 24 August 2010 - 11:58 PM

Hi Greg, One thing I will note is that there is an inherent safety issue with using these high pwered trucks -- getting a VXL isn't going to lessen that factor any. Not to scare you away (I want to see other people doing this!!), but you need to make sure you have the proper facilities to test a high powered truck like this. In my case, I have a plexiglas stand that I CNC'd to fit the truck. Even though the stand holds it pretty tightly, I accidentally ramped the throttle up so fast last night that the truck leaped out of the stand, caught the wall, and flung itself at me. Luckily, in this process, the control board's master power got tripped so the ESC stopped, but if you get a VXL you will need to be even more cautious. The good news is that I have finally perfected the drivers, so you may not have to deal with that stuff, as long as you go by the driver set I supply. I'll be posting them later tonight.

#13 greg

greg

    Advanced Member

  • Members
  • PipPipPip
  • 169 posts
  • LocationChicago, IL

Posted 25 August 2010 - 12:02 AM

Hi Greg,

One thing I will note is that there is an inherent safety issue with using these high pwered trucks -- getting a VXL isn't going to lessen that factor any.

Not to scare you away (I want to see other people doing this!!), but you need to make sure you have the proper facilities to test a high powered truck like this. In my case, I have a plexiglas stand that I CNC'd to fit the truck. Even though the stand holds it pretty tightly, I accidentally ramped the throttle up so fast last night that the truck leaped out of the stand, caught the wall, and flung itself at me. Luckily, in this process, the control board's master power got tripped so the ESC stopped, but if you get a VXL you will need to be even more cautious.

The good news is that I have finally perfected the drivers, so you may not have to deal with that stuff, as long as you go by the driver set I supply. I'll be posting them later tonight.


Hah - well I have a pair of clamps already waiting for the VXL.

Although I just had a thought, I think I'll rig up a couple of bungie cords and attach carabiners which I will then hook around the rear axles (smaller carabiners). Should be a good set of chocks in case things go awry.

I've worked with RC before, gas powered even, so I'm aware of the danger-factor. Of course having it make decisions on it's own rather than me doing the stupid stunt will be a tad different.

BTW - if you are concerned an easy fix is to just remove the rear wheels while you're in development. You'll be able to do all your coding and not have to worry about high speed autonomous projectiles roaming around your house.

#14 Chris Seto

Chris Seto

    Advanced Member

  • Members
  • PipPipPip
  • 405 posts

Posted 25 August 2010 - 12:11 AM

New drivers version is online. Use the link in the first post.

#15 Hai Nguyen

Hai Nguyen

    Advanced Member

  • Members
  • PipPipPip
  • 54 posts

Posted 28 August 2010 - 04:15 AM

Expert,

using System;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using ElectricSpeedController_API;
using PPM_Decoder_API;
using SecretLabs.NETMF.Hardware.Netduino;
using Servo_API;

namespace RCCS_Netduino
{
	public class Program
	{  
		private const int speedLimit = 100;
        private static SpeedController esc  =  new SpeedController(Pins.GPIO_PIN_D9, new TRAXXAS_XL5()); 
		public static void Main()
		{              
            while (true)
            {
                esc.Throttle = 0;
                Thread.Sleep(100);
                esc.DriveMode = SpeedController.DriveModes.Forward;
                esc.Throttle = speedLimit;
                Thread.Sleep(5000);

                esc.Throttle = 0;
                Thread.Sleep(100);
                esc.DriveMode = SpeedController.DriveModes.Reverse;

                esc.Throttle = speedLimit;
                Thread.Sleep(5000);
            }

		}

	}
}

When use Chris's driver with the ESC (White/Black) hooks up pin D9,GND respectively. With the test code above runing, I use multimeter to measure voltage on signal wire (white) (see screenshot), I can see voltage ramps up and down between 0.16<-> 0.32. However the motor is not moving.

Do you know why that happen? Why voltage on the signal wire is too low?

Thanks!

Attached Files



#16 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 28 August 2010 - 04:23 AM

When use your driver with the ESC (White/Black) hooks up pin D9,GND respectively. With the test code above runing, I use multimeter to measure voltage on signal wire (white) (see screenshot), I can see voltage ramps up and down between 16<->32. however the motor is not moving.

Do you see any problem?


I have to ask, but I'm assuming you already have this taken care of... I don't see any power going to your servo. Should that third wire on the plug be attached to the 3V3 or 5V power header (or a larger power source)?

Chris

#17 Chris Seto

Chris Seto

    Advanced Member

  • Members
  • PipPipPip
  • 405 posts

Posted 28 August 2010 - 04:27 AM

I have to ask, but I'm assuming you already have this taken care of... I don't see any power going to your servo. Should that third wire on the plug be attached to the 3V3 or 5V power header (or a larger power source)?

Chris

Power to the servo comes from the ESC's 6VDC SMPS (battery eliminator circuit or BEC). The BEC is designed for the kinds of loads the servo will put on it. The servo tends to draw large amounts of current, so it will always be kept far away from the control electronics, which are on their own power supply.

#18 Chris Seto

Chris Seto

    Advanced Member

  • Members
  • PipPipPip
  • 405 posts

Posted 28 August 2010 - 04:35 AM

Expert,

using System;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using ElectricSpeedController_API;
using PPM_Decoder_API;
using SecretLabs.NETMF.Hardware.Netduino;
using Servo_API;

namespace RCCS_Netduino
{
	public class Program
	{  
		private const int speedLimit = 100;
        private static SpeedController esc  =  new SpeedController(Pins.GPIO_PIN_D9, new TRAXXAS_XL5()); 
		public static void Main()
		{              
            while (true)
            {
                esc.Throttle = 0;
                Thread.Sleep(100);
                esc.DriveMode = SpeedController.DriveModes.Forward;
                esc.Throttle = speedLimit;
                Thread.Sleep(5000);

                esc.Throttle = 0;
                Thread.Sleep(100);
                esc.DriveMode = SpeedController.DriveModes.Reverse;

                esc.Throttle = speedLimit;
                Thread.Sleep(5000);
            }

		}

	}
}

When use Chris's driver with the ESC (White/Black) hooks up pin D9,GND respectively. With the test code above runing, I use multimeter to measure voltage on signal wire (white) (see screenshot), I can see voltage ramps up and down between 0.16<-> 0.32. However the motor is not moving.

Do you know why that happen? Why voltage on the signal wire is too low?

Thanks!


Hi Hai,

the voltage of that signal line will "vary" due ot the changing pulse wave. the longer the wave stays high, the more voltage the multimeter will "detect". In reality, measuring the voltage is not a valid way to measure the signal timings. That's the kind of thing that you need an O-Scope to do :)

#19 Hai Nguyen

Hai Nguyen

    Advanced Member

  • Members
  • PipPipPip
  • 54 posts

Posted 28 August 2010 - 04:36 AM

I have to ask, but I'm assuming you already have this taken care of... I don't see any power going to your servo. Should that third wire on the plug be attached to the 3V3 or 5V power header (or a larger power source)?

Chris



Well, to simplify this test, I am not dealing with the servo at this point, red(midle pin) is an 6VDC/out. My understanding is I should be able control ESC/motor with out using that wire?

#20 Hai Nguyen

Hai Nguyen

    Advanced Member

  • Members
  • PipPipPip
  • 54 posts

Posted 28 August 2010 - 04:37 AM

Hi Hai,

the voltage of that signal line will "vary" due ot the changing pulse wave. the longer the wave stays high, the more voltage the multimeter will "detect". In reality, measuring the voltage is not a valid way to measure the signal timings. That's the kind of thing that you need an O-Scope to do :)


Chris, ah that makes sense :-)
thanks for the explanation.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.