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

netduino controlled toy car


  • Please log in to reply
15 replies to this topic

#1 Miha Markic

Miha Markic

    Advanced Member

  • Members
  • PipPipPip
  • 74 posts
  • LocationNova Gorica, Slovenia

Posted 26 January 2011 - 07:32 PM

Here is the first drive of my netduino controlled ex-remote controlled toy car. Nothing fancy, it just drives in straight line until it detects an obstacle in front - it stops softly. I am using Sharp infrared sensor for obstacle detection, a L293D H-bridge, a protoshield and a small breadboard.



I'll make it much more interesting over time.

Miha Markic, Microsoft MVP C#
Righthand .net consulting and software development
http://blog.rthand.com/


#2 renatoa

renatoa

    Advanced Member

  • Members
  • PipPipPip
  • 36 posts
  • LocationRomania

Posted 26 January 2011 - 07:49 PM

Here is the first drive of my netduino controlled ex-remote controlled toy car. Nothing fancy, it just drives in straight line until it detects an obstacle in front - it stops softly. I am using Sharp infrared sensor for obstacle detection, a L293D H-bridge, a protoshield and a small breadboard.



I'll make it much more interesting over time.


Do you generate PPM pulses? How?

#3 Miha Markic

Miha Markic

    Advanced Member

  • Members
  • PipPipPip
  • 74 posts
  • LocationNova Gorica, Slovenia

Posted 26 January 2011 - 10:12 PM

Do you generate PPM pulses? How?


You mean PWM? Netduino has 4 PWM ports: D5, D6, D9 and D10. Currently I am using only D5 and D6 to control a single motor.
Here is the code snippet:
PWM pwm = new PWM(Pins.GPIO_PIN_D6);
pwm.SetPulse(100, 40); // 100 is period, 40 is duration

Miha Markic, Microsoft MVP C#
Righthand .net consulting and software development
http://blog.rthand.com/


#4 renatoa

renatoa

    Advanced Member

  • Members
  • PipPipPip
  • 36 posts
  • LocationRomania

Posted 27 January 2011 - 06:44 AM

Ah, you control motors directly... and no servo. No, I don't mean PWN, PPM is close, but different, pulse width change each pulse.

#5 Mark H

Mark H

    Advanced Member

  • Members
  • PipPipPip
  • 70 posts
  • LocationPerth, Western Australia

Posted 27 January 2011 - 06:50 AM

renatoa, PPM is Pulse Position Modulation, such as output from an R/C transmitter to an R/C receiver. This contains all of the servo pulses in one stream. PWM is Pulse Width Modulation, this is sent to each servo. PPM wouldn't get sent to a servo, because there is only one device to control - hence the PWM.

#6 Miha Markic

Miha Markic

    Advanced Member

  • Members
  • PipPipPip
  • 74 posts
  • LocationNova Gorica, Slovenia

Posted 27 January 2011 - 07:17 AM

Ah, you control motors directly... and no servo.
No, I don't mean PWN, PPM is close, but different, pulse width change each pulse.


Right, I control them directly through an H-bridge and those are DC motors, not servos.

Miha Markic, Microsoft MVP C#
Righthand .net consulting and software development
http://blog.rthand.com/


#7 Chris Seto

Chris Seto

    Advanced Member

  • Members
  • PipPipPip
  • 405 posts

Posted 27 January 2011 - 07:39 AM

A real Hobby grade ESC will require a PPM wave. An H bridge will not care between PPM or PWM, but PWM will give you more resolution since most PPM gens are limited to 1-2ms high periods.

#8 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 27 January 2011 - 08:48 AM

Is there interest in PPM support? That's another thing that could be added through the FIQ feature and native code (with a nice C# wrapper). Not sure about all the timing requirements, but it would be cool to investigate. Chris

#9 bill.french

bill.french

    Advanced Member

  • Members
  • PipPipPip
  • 260 posts
  • LocationPrinceton, NJ

Posted 27 January 2011 - 01:26 PM

A real Hobby grade ESC will require a PPM wave.


...really? Do you have an example of that. My understanding was that ESCs were no different than servos, as old speed controllers used to be servos. And on gas/nitro vehicles, they still are, as throttle is still servo controlled.

Or am i missing something?

#10 Chris Seto

Chris Seto

    Advanced Member

  • Members
  • PipPipPip
  • 405 posts

Posted 27 January 2011 - 04:50 PM

...really? Do you have an example of that. My understanding was that ESCs were no different than servos, as old speed controllers used to be servos. And on gas/nitro vehicles, they still are, as throttle is still servo controlled.

Or am i missing something?



Servos also require PPM waves, you can use an ESC and a servo interchangeably.

@CW: Yes, I'd like support for PPM, although the wave is quite easy to generate. See: http://www.fezzer.co...1/servo-driver/

#11 bill.french

bill.french

    Advanced Member

  • Members
  • PipPipPip
  • 260 posts
  • LocationPrinceton, NJ

Posted 27 January 2011 - 05:36 PM

Servos also require PPM waves, you can use an ESC and a servo interchangeably.

@CW: Yes, I'd like support for PPM, although the wave is quite easy to generate. See: http://www.fezzer.co...1/servo-driver/


..but that example uses PWM? I thought servos were controlled by sending a 1-2ms pulse within something like a 25ms frame? I thought ppm was used for multiplexing on the radio side?

#12 Chris Seto

Chris Seto

    Advanced Member

  • Members
  • PipPipPip
  • 405 posts

Posted 27 January 2011 - 05:41 PM

PPM can refer to both the signal that the TX transmits (which, by the way you can capture from it's trainer port and parse) or the individual signal that is pumped into servos/ESCs/etc. A standard Servo/ESC PPM wave is formed with a 20ms frame with a variable 1-2ms high period with a 1.5ms mid point. PPM is a form of PWM, because you are still modulating the width of the pulse, but it has a new name because now the width of that pulse maps to something (like a power setting on an ESC or the angle of a servo arm).

#13 bill.french

bill.french

    Advanced Member

  • Members
  • PipPipPip
  • 260 posts
  • LocationPrinceton, NJ

Posted 27 January 2011 - 06:04 PM

...but the second "p" in PPM is "position", right? You're not varying the position of the pulse within the frame to change the servo angle, just the width. I was trying to find a link to back my position, wiki says PWM: http://en.wikipedia....anism#RC_servos and PPM is something else: http://en.wikipedia....tion_modulation .. but there's lots of arduino stuff that says "PWM damages servos" ... but i imagine that's from using the wrong pulse/frame size.

#14 Chris Seto

Chris Seto

    Advanced Member

  • Members
  • PipPipPip
  • 405 posts

Posted 27 January 2011 - 08:28 PM

PWM damages servos


This makes my head hurt :)

PPM is a type of PWM. You are still controlling the width of the pulse.

The signals sent to the servo can be called PPM or PWM, however one must note that it's not a typical PWM signal due to the existence of the special frame size, as well as the specialized high period timings.

And yes, you can destroy a servo with an over/under loaded PPM wave just as you can destroy an airplane by pulling the throttle out, then dropping the flaps/gear and yanking the elevator full back.

The point is, you can destroy just about anything by using normal controls in the wrong way.

#15 renatoa

renatoa

    Advanced Member

  • Members
  • PipPipPip
  • 36 posts
  • LocationRomania

Posted 28 January 2011 - 04:42 PM

Is there interest in PPM support? That's another thing that could be added through the FIQ feature and native code (with a nice C# wrapper). Not sure about all the timing requirements, but it would be cool to investigate.

Chris


PPM to drive a single servo / ESC can be done right now with SetPulse, because the pulses are repetitive.
My special interest, why I bought Netduino, is to have a class able to generate on a GPIO the whole 8/9 channels frame, as output by a RC Tx, where each pulse has a different width than the previous, and a microsecond accuracy is required (1-2msec pulse width range should be available as a 10 bit value).

#16 Chris Seto

Chris Seto

    Advanced Member

  • Members
  • PipPipPip
  • 405 posts

Posted 28 January 2011 - 06:38 PM

I also have a driver for my FPGA shield which can support up approximately one crapload of servos :) More on this when that shield gets released...




1 user(s) are reading this topic

0 members, 1 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.