<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.2" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>LeafLabs Garden &#187; Topic: A quadcopter with Maple</title>
		<link>http://forums.leaflabs.com/topic.php?id=2239</link>
		<description>A place to share, learn, and grow...</description>
		<language>en-US</language>
		<pubDate>Fri, 22 Jan 2016 00:18:12 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.2</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://forums.leaflabs.com/search.php</link>
		</textInput>
		<atom:link href="http://forums.leaflabs.com/rss.php?topic=2239" rel="self" type="application/rss+xml" />

		<item>
			<title>xchg.ca on "A quadcopter with Maple"</title>
			<link>http://forums.leaflabs.com/topic.php?id=2239#post-22164</link>
			<pubDate>Tue, 29 Jan 2013 19:45:18 +0000</pubDate>
			<dc:creator>xchg.ca</dc:creator>
			<guid isPermaLink="false">22164@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Looks great! I want to control ESC motors myslef! But having issues with Arming ESC, can you explain how to handle ESC ? IF you can share some code we would be really appreciated !
&#60;/p&#62;</description>
		</item>
		<item>
			<title>nully on "A quadcopter with Maple"</title>
			<link>http://forums.leaflabs.com/topic.php?id=2239#post-13114</link>
			<pubDate>Tue, 04 Sep 2012 01:27:27 +0000</pubDate>
			<dc:creator>nully</dc:creator>
			<guid isPermaLink="false">13114@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Wow, nice project!
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Anonymous on "A quadcopter with Maple"</title>
			<link>http://forums.leaflabs.com/topic.php?id=2239#post-12778</link>
			<pubDate>Tue, 21 Aug 2012 18:59:52 +0000</pubDate>
			<dc:creator>Anonymous</dc:creator>
			<guid isPermaLink="false">12778@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Hello It is a good project. Can I download MCoptero v1.0 code?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>xpomvid on "A quadcopter with Maple"</title>
			<link>http://forums.leaflabs.com/topic.php?id=2239#post-11962</link>
			<pubDate>Tue, 24 Jul 2012 02:40:36 +0000</pubDate>
			<dc:creator>xpomvid</dc:creator>
			<guid isPermaLink="false">11962@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;The PID control used:&#60;/p&#62;
&#60;p&#62;//variables de trabajo&#60;br /&#62;
unsigned long lastTimePitch, lastTimeRoll, lastTimeYaw, lastTimeAlt;&#60;br /&#62;
float lastErrPitch, lastAngPitch, derivPitch, lastDerivPitch, integralPitch;&#60;br /&#62;
float lastErrRoll, lastAngRoll, derivRoll, lastDerivRoll, integralRoll;&#60;br /&#62;
float lastErrYaw, lastAngYaw, derivYaw, lastDerivYaw, integralYaw;&#60;br /&#62;
float lastErrAlt, derivAlt, lastDerivAlt, integralAlt;&#60;br /&#62;
float factorIn=0.80 ; //1.00;  // factorIn amortigua el error. Rango 0.01-1.0 (0.01=suave, 1.0=fuerte)&#60;br /&#62;
uint8 outLimYaw=100, outLim=100, errMaxPitchRoll=25, errMaxYaw=60, errMaxAlt=2;&#60;br /&#62;
byte fcort=20;      //frecuencia de corte del filtro de paso bajo&#60;br /&#62;
float RC=1/(2*PI*fcort);&#60;br /&#62;
// fcort = 10 Hz -&#38;gt; RC = 15.9155e-3&#60;br /&#62;
// fcort = 15 Hz -&#38;gt; RC = 10.6103e-3&#60;br /&#62;
// fcort = 20 Hz -&#38;gt; RC =  7.9577e-3&#60;br /&#62;
// fcort = 25 Hz -&#38;gt; RC =  6.3662e-3&#60;br /&#62;
// fcort = 30 Hz -&#38;gt; RC =  5.3052e-3&#60;/p&#62;
&#60;p&#62;void ComputePIDPitch(void)&#60;br /&#62;
{&#60;br /&#62;
  unsigned long now = millis();&#60;br /&#62;
  float DT = (float)(now - lastTimePitch)/1000.00;&#60;/p&#62;
&#60;p&#62;  //Error pitch&#60;br /&#62;
  errorPitch=(AngPitch-SetpointPitch)*factorIn;&#60;br /&#62;
  errorPitch = constrain(errorPitch,-errMaxPitchRoll,errMaxPitchRoll); //Limita el valor max del error de pitch&#60;br /&#62;
  //componente proporcional&#60;br /&#62;
  OutputPitch = errorPitch * KpPitch;&#60;br /&#62;
  //componente derivativa con filtro paso-bajo&#60;br /&#62;
  derivPitch =(errorPitch - lastErrPitch) / DT;&#60;br /&#62;
  derivPitch=lastDerivPitch+(DT/(RC+DT))*(derivPitch - lastDerivPitch);&#60;br /&#62;
  //suma componenete derivativa&#60;br /&#62;
  OutputPitch+=KdPitch*derivPitch;&#60;br /&#62;
  //componente integral&#60;br /&#62;
  integralPitch+=KiPitch*errorPitch*DT;&#60;br /&#62;
  //limita integralPitch&#60;br /&#62;
  integralPitch=constrain(integralPitch,-outLim,outLim);&#60;br /&#62;
  //Salida y limitada&#60;br /&#62;
  OutputPitch += integralPitch;&#60;br /&#62;
  OutputPitch=constrain(OutputPitch,-outLim,outLim);&#60;br /&#62;
  //renueva estado&#60;br /&#62;
  lastErrPitch=errorPitch;&#60;br /&#62;
  lastAngPitch=AngPitch;&#60;br /&#62;
  lastDerivPitch=derivPitch;&#60;br /&#62;
  lastTimePitch = now;&#60;br /&#62;
}&#60;/p&#62;
&#60;p&#62;//----------------------------------------------------&#60;br /&#62;
void ComputePIDRoll(void)&#60;br /&#62;
{&#60;br /&#62;
  unsigned long now = millis();&#60;br /&#62;
  float DT = (float)(now - lastTimeRoll)/1000.00;&#60;/p&#62;
&#60;p&#62;  //Error roll&#60;br /&#62;
  errorRoll=(AngRoll-SetpointRoll)*factorIn;&#60;br /&#62;
  errorRoll = constrain(errorRoll,-errMaxPitchRoll,errMaxPitchRoll);    //Limita el valor max del error de roll&#60;br /&#62;
  //componente proporcional&#60;br /&#62;
  OutputRoll = errorRoll * KpRoll;&#60;br /&#62;
  //componente derivativa con filtro paso-bajo&#60;br /&#62;
  derivRoll = (errorRoll - lastErrRoll) / DT;&#60;br /&#62;
  derivRoll=lastDerivRoll+(DT/(RC+DT))*(derivRoll-lastDerivRoll);&#60;br /&#62;
  //suma componenete derivativa&#60;br /&#62;
  OutputRoll+=KdRoll*derivRoll;&#60;br /&#62;
  //componente integral&#60;br /&#62;
  integralRoll+=KiRoll*errorRoll*DT;&#60;br /&#62;
  //limita integralRoll&#60;br /&#62;
  integralRoll=constrain(integralRoll,-outLim,outLim);&#60;br /&#62;
  //Salida y limitada&#60;br /&#62;
  OutputRoll += integralRoll;&#60;br /&#62;
  OutputRoll=constrain(OutputRoll,-outLim,outLim);&#60;br /&#62;
  //renueva estado&#60;br /&#62;
  lastErrRoll=errorRoll;&#60;br /&#62;
  lastAngRoll=AngRoll;&#60;br /&#62;
  lastDerivRoll=derivRoll;&#60;br /&#62;
  lastTimeRoll = now;&#60;br /&#62;
}&#60;br /&#62;
//----------------------------------------------------&#60;br /&#62;
void ComputePIDYaw(void)&#60;br /&#62;
{&#60;br /&#62;
  /*How long since we last calculated*/&#60;br /&#62;
  unsigned long now = millis();&#60;br /&#62;
  float DT = (float)(now - lastTimeYaw)/1000.00;&#60;/p&#62;
&#60;p&#62;  //Error yaw&#60;br /&#62;
  errorYaw=(AngYaw-SetpointYaw)*factorIn;&#60;br /&#62;
  if (errorYaw &#38;gt; 180)  errorYaw -= 360;    // Normalizar a -180,180&#60;br /&#62;
  else if(errorYaw &#38;lt; -180)  errorYaw += 360;&#60;br /&#62;
  errorYaw = constrain(errorYaw,-errMaxYaw,errMaxYaw); // Limita el valor max del error de yaw&#60;br /&#62;
  //componente proporcional&#60;br /&#62;
  OutputYaw = errorYaw * KpYaw;&#60;br /&#62;
  //componente derivativa con filtro paso-bajo&#60;br /&#62;
  derivYaw = (errorYaw - lastErrYaw) / DT;&#60;br /&#62;
  derivYaw=lastDerivYaw+(DT/(RC+DT))*(derivYaw-lastDerivYaw);&#60;br /&#62;
  //suma componenete derivativa&#60;br /&#62;
  OutputYaw += KdYaw*derivYaw;&#60;br /&#62;
  //componente integral&#60;br /&#62;
  integralYaw+=KiYaw*errorYaw*DT;&#60;br /&#62;
  //limita integralYaw&#60;br /&#62;
  integralYaw=constrain(integralYaw,-outLimYaw, outLimYaw);&#60;br /&#62;
  //Salida y limitada&#60;br /&#62;
  OutputYaw+=integralYaw;&#60;br /&#62;
  OutputYaw=(-1)*constrain(OutputYaw,-outLim,outLim);&#60;br /&#62;
  //renueva estado&#60;br /&#62;
  lastErrYaw=errorYaw;&#60;br /&#62;
  lastAngYaw=AngYaw;&#60;br /&#62;
  lastDerivYaw=derivYaw;&#60;br /&#62;
  lastTimeYaw = now;&#60;br /&#62;
}&#60;br /&#62;
//----------------------------------------------------&#60;br /&#62;
void ComputePIDAlt(void)&#60;br /&#62;
{&#60;br /&#62;
  unsigned long now = millis();&#60;br /&#62;
  float DT = (float)(now - lastTimeAlt)/1000.00;&#60;/p&#62;
&#60;p&#62;  //Error altura&#60;br /&#62;
  errorAlt=(-1)*(h_filter-SetpointAlt)*10;  //dm&#60;br /&#62;
  errorAlt=constrain(errorAlt,-errMaxAlt,errMaxAlt);&#60;br /&#62;
  //componente proporcional&#60;br /&#62;
  OutputAlt = errorAlt * KpA;&#60;br /&#62;
  //componente derivativa con filtro paso-bajo&#60;br /&#62;
  derivAlt = (errorAlt - lastErrAlt) / DT;&#60;br /&#62;
  derivAlt=lastDerivAlt+(DT/(RC+DT))*(derivAlt-lastDerivAlt);&#60;br /&#62;
  //suma componenete derivativa&#60;br /&#62;
  OutputAlt+=KdA*derivAlt;&#60;br /&#62;
  //componente integral&#60;br /&#62;
  integralAlt+=KiA*errorAlt*DT;&#60;br /&#62;
  //limita integralPich&#60;br /&#62;
  integralAlt=constrain(integralAlt,-outLim,outLim);&#60;br /&#62;
  //Salida y filtro PID&#60;br /&#62;
  OutputAlt+=integralAlt;&#60;br /&#62;
  OutputAlt=constrain(OutputAlt,-outLim,outLim);&#60;br /&#62;
  //renueva estado&#60;br /&#62;
  lastErrAlt=errorAlt;&#60;br /&#62;
  lastDerivAlt=derivAlt;&#60;br /&#62;
  lastTimeAlt = now;&#60;br /&#62;
}
&#60;/p&#62;</description>
		</item>
		<item>
			<title>xpomvid on "A quadcopter with Maple"</title>
			<link>http://forums.leaflabs.com/topic.php?id=2239#post-11948</link>
			<pubDate>Mon, 23 Jul 2012 17:38:26 +0000</pubDate>
			<dc:creator>xpomvid</dc:creator>
			<guid isPermaLink="false">11948@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Hi, here is the parts list and supplier. The code is not finished, it remains to debug and comments.&#60;/p&#62;
&#60;p&#62;/******************************************************************************&#60;br /&#62;
* MAPLECOPTER *&#60;br /&#62;
* ----------------------------------------------------------------------------*&#60;br /&#62;
* SOFTWARE CUADRICOPTERO: MCoptero v1.0 por XPOMVID&#60;br /&#62;
* ----------------------------------------------------------------------­------*&#60;br /&#62;
* Placa: Maple Rev5 (BricoGeek) *&#60;br /&#62;
* Procesador: 32-bit ARM Cortex M3 at 72MHz *&#60;br /&#62;
* Memory: 120 KB Flash and 20 KB SRAM *&#60;br /&#62;
* I/O Pins: 34 (of which 12 provide PWM output at 16-bit resolution) *&#60;br /&#62;
* ADCs: 9 (at 12-bit resolution) *&#60;br /&#62;
* Peripherals: 4 timers, 2 I2Cs, 2 SPI ports, 3 USARTs *&#60;br /&#62;
* ---------------------------------------------------------------------------*&#60;br /&#62;
* Sist. de medición inercial: 9DOF-Razor IMU-AHRS (BricoGeek) *&#60;br /&#62;
* Yaw Gyro: LY530AL - 300°/s single-axis gyro *&#60;br /&#62;
* Pitch and Roll Gyro: LPR530AL - 300°/s dual-axis gyro *&#60;br /&#62;
* Accelerometer: ADXL345 - 13-bit, ±16g, triple-axis accelerometer *&#60;br /&#62;
* Magnetometer: HMC5843 - triple-axis, digital magnetometer *&#60;br /&#62;
* Todas las salidas de los sensores son procesadas por un *&#60;br /&#62;
* &#60;a href=&#34;mailto:ATmega328@3.3V&#34;&#62;ATmega328@3.3V&#60;/a&#62; w/ external 8MHz resonator y Firmware v1.0. *&#60;br /&#62;
* ---------------------------------------------------------------------------*&#60;br /&#62;
* Sensor de presión barométrica BMP085 (BricoGeek) *&#60;br /&#62;
* ---------------------------------------------------------------------------*&#60;br /&#62;
* Motor brushless 1000KV Outrunner (BricoGeek) *&#60;br /&#62;
* Hélices 8x4.5 *&#60;br /&#62;
* ---------------------------------------------------------------------------*&#60;br /&#62;
* ESC TURNIGY Plush 25amp Speed Controller (HobbyKing) *&#60;br /&#62;
* ---------------------------------------------------------------------------*&#60;br /&#62;
* Emisora Turnigy 9X 9Ch Transmitter (HobbyKing) *&#60;br /&#62;
*****************************************************************************/
&#60;/p&#62;</description>
		</item>
		<item>
			<title>mbolivar on "A quadcopter with Maple"</title>
			<link>http://forums.leaflabs.com/topic.php?id=2239#post-11944</link>
			<pubDate>Mon, 23 Jul 2012 14:47:22 +0000</pubDate>
			<dc:creator>mbolivar</dc:creator>
			<guid isPermaLink="false">11944@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;cool! &#60;a href=&#34;https://twitter.com/leaflabs/status/227489817389301761&#34;&#62;tweeted&#60;/a&#62;.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>StephenFromNYC on "A quadcopter with Maple"</title>
			<link>http://forums.leaflabs.com/topic.php?id=2239#post-11935</link>
			<pubDate>Mon, 23 Jul 2012 08:49:19 +0000</pubDate>
			<dc:creator>StephenFromNYC</dc:creator>
			<guid isPermaLink="false">11935@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;xpomvid,&#60;/p&#62;
&#60;p&#62;I am glad you took the effort to create a new topic to describe your maple-based quadcopter project.  In your &#60;a href=&#34;http://forums.leaflabs.com/topic.php?id=1841#post-11862&#34;&#62;original post&#60;/a&#62; (part of the &#34;Using Vin pin&#34; topic) I did not understand the connection.&#60;/p&#62;
&#60;p&#62;Any chance you can share your code, parts list (and supplier), and other details with other LeafLabs users?&#60;/p&#62;
&#60;p&#62;Once again, congratulations and thanks!&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://forums.leaflabs.com/profile.php?id=843&#34;&#62;Stephen from NYC&#60;/a&#62; (full disclosure: I am not a member of the LeafLabs staff)
&#60;/p&#62;</description>
		</item>
		<item>
			<title>xpomvid on "A quadcopter with Maple"</title>
			<link>http://forums.leaflabs.com/topic.php?id=2239#post-11917</link>
			<pubDate>Sun, 22 Jul 2012 14:27:05 +0000</pubDate>
			<dc:creator>xpomvid</dc:creator>
			<guid isPermaLink="false">11917@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;A quadcopter with Maple rev5 + 9 DOF - Razor IMU - AHRS.&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://youtu.be/2EGoGld0Z_4&#34; rel=&#34;nofollow&#34;&#62;http://youtu.be/2EGoGld0Z_4&#60;/a&#62;
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
