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.

Giosax.net

Member Since 01 Oct 2012
Offline Last Active Jun 16 2015 06:04 PM
-----

Posts I've Made

In Topic: NP2 & Accelerometer ADXL345

23 October 2013 - 09:04 AM

Hi all,

 

problem solved! ;)


In Topic: Netduino ESC driver

16 September 2013 - 02:07 PM

Hi All, :rolleyes:

 

I try to use this drive code for my ESC (Mistery FM30A) and netuduino 2 plus, but I have some question because this code work on MF 4.1... :(
I need the confirm for this changes in MF 4.2:
 

 

MF 4.1 Code: (Costructor)

/// <summary>
/// Create the PWM pin, set it low and configure
/// timing settings
/// </summary>
/// <param name="pin"></param>
public SpeedController(Cpu.Pin pin, SpeedControllers escModel)
{
  // Set up the PWM port
  esc = new PWM((Cpu.Pin)pin);

  // Bind the ESC settings
  this.escModel = escModel;

  // Pull the throttle all the way out
  Throttle = 0;

  // Arm the ESC
  Thread.Sleep(escModel.armPeriod);
}

... ... ....

 

public static void Main()
  {
  SpeedController xl5 = new SpeedController(Pins.GPIO_PIN_D9, new TRAXXAS_XL5());

... ...

MF 4.2 Code:

public SpeedController(Cpu.PWMChannel pin, SpeedControllers escModel){   // Set up the PWM port   esc = new PWM(pin, 20000, 1500, PWM.ScaleFactor.Microseconds, false);   // Bind the ESC settings   this.escModel = escModel;   // Pull the throttle all the way out   Throttle = 0;   // Arm the ESC   Thread.Sleep(escModel.armPeriod);}... ... ... public static void Main(){   SpeedController xl5 = new SpeedController(PWMChannels.PWM_PIN_D9, new TRAXXAS_XL5());.....

?

?

?

?

?

?

 

MF 4.1 Code:

public void disengage(){    esc.SetDutyCycle(0);}......// Step the wave up or down// I absolutely hate doing it this way, but really, there's no other better way. if (value < currentThrottle){   for (int set = currentThrottle; set >= value; set--)   {       // Set the pulse       esc.SetPulse(20000, (uint)map(set, 0, 100, range[0], range[1]));       Thread.Sleep(rampIterationPause);   }}else{   for (int set = currentThrottle; set <= value; set++)   {       esc.SetPulse(20000, (uint)map(set, 0, 100, range[0], range[1]));       Thread.Sleep(rampIterationPause);   }}

MF 4.2 code

public void disengage(){    esc.Duration = 0;}......// Step the wave up or down// I absolutely hate doing it this way, but really, there's no other better way. if (value < currentThrottle){   for (int set = currentThrottle; set >= value; set--)   {       // Set the pulse       esc.Duration = (uint)map(set, 0, 100, range[0], range[1]);       Thread.Sleep(rampIterationPause);   }}else{   for (int set = currentThrottle; set <= value; set++)   {       esesc.Duration = (uint)map(set, 0, 100, range[0], range[1]);        Thread.Sleep(rampIterationPause);   }}

Could you confirm me this change?!  :) ;)

 

Thxxxxxxx

Gianni


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.