Arduino and Naze 32 Connection

Hello,

First of all,. I am wondering if it is possible to connect the arduino to a Naze 32 to use it as a flight controller for my quad copter.

In my last topic, I finally got my arduino with an xbee shield connected and working - sending data to another arduino that was able to control led's to represent motors. Now I got a Naze 32 rev 6 flashed with base flight and I want to connect it to the receiver xbee so that I can use it for my quad.

Some questions I have are: how do I go about connecting the receiving arduino with an xbee on it to a Naze 32 (I have no Idea what to do, I read some manual and got confused) and also, once I have it connected would I still be able to control the motors while also having the PID corrections at the same time?

Thanks for your time.


Maybe a bit more clearer way of wording my question?
So What i don't understand is what pins would i need to hook up from the naze32 and the arduino together to in order for me to send my motor control signals through to the motors.

I have and arduino on the ground wired with some potentiometers for my controller and it uses an xbee as the radio transmitter. on the other end i have a receiving arduino that also has an xbee.

So normally, to control the motors i could wire the receiving arduino to the motors and get them spinning, but that doesn't help much with flying since it would be very hard to control it.

I want to wire the arduino to the naze and then to the motors. From what i know the esc's go on the one ESC rail with the 5v and gnd correct? And then the esc's to the motor. But then where would i hook up the arduino, what pins do i use if the ESC is connected to the Naze already? I am also confused about how i would use the data from the serial monitor of the (receiving arduino) and then output it to the naze, do i just output the signals that i would normally use to control the motors into the 4 of the 8 pwm pins on the naze?

Check the NAZE32 manual:

. Up to 8 ch RC input - supports standard receivers (PWM), PPM Sum receiver (FrSky, etc), or Spektrum Satellite receiver.

PWM is just the separate Servo/ESC outputs from a receiver. The signal is a single pulse of about 1000 to 2000 microseconds every 20 milliseconds. You can do that with the Servo library and just connect each 'servo' pin to a NAZE32 input channel.

PPM is similar but all of the pulses are sent in sequence on a single pin. This has the advantage of only using one output pin on the Arduino and one input pin on the NAZE32. I'm sure someone has written a library to do it.

Spektrum uses serial communication (DSM2?). If your Arduino has a spare serial port or is not using SoftwareSerial for anything else you may be able to find a library to generate the messages.

johnwasser:
Check the NAZE32 manual:

. Up to 8 ch RC input - supports standard receivers (PWM), PPM Sum receiver (FrSky, etc), or Spektrum Satellite receiver.

PWM is just the separate Servo/ESC outputs from a receiver. The signal is a single pulse of about 1000 to 2000 microseconds every 20 milliseconds. You can do that with the Servo library and just connect each 'servo' pin to a NAZE32 input channel.

PPM is similar but all of the pulses are sent in sequence on a single pin. This has the advantage of only using one output pin on the Arduino and one input pin on the NAZE32. I'm sure someone has written a library to do it.

Spektrum uses serial communication (DSM2?). If your Arduino has a spare serial port or is not using SoftwareSerial for anything else you may be able to find a library to generate the messages.

So if i wanted to connect it and control the motors with pwm pins, do i just connect four output pins from the arduino to any 4 of the pwm on the naze and send some signal to it? say i sent like a value of 1000 would that value pass through the naze and then be corrected?

Totomyl:
So if i wanted to connect it and control the motors with pwm pins, do i just connect four output pins from the arduino to any 4 of the pwm on the naze and send some signal to it? say i sent like a value of 1000 would that value pass through the naze and then be corrected?

No. The Arduino, like an RC receiver, doesn't control motors directly. It provides control inputs to the Flight Controller and it's the Flight Controller that converts those control inputs into motor speed signals. The control signals are traditionally named after the control servos of an RC airplane: Throttle, Aileron, Elevator, and Rudder. In a quadcopter those controls are labeled Throttle, Roll, Pitch, and Yaw. You control altitude with Throttle, direction with pitch and roll, and heading with yaw.
If you want direct control of the motors you would eliminate the Flight Controller and connect the Arduino servo outputs directly to the ESCs. Then it would become the Arduino's responsibility to take accelerometer and gyroscope inputs and adjust the motor controls dynamically to keep the quadcopter stable (the job of a Flight Controller).

johnwasser:
No. The Arduino, like an RC receiver, doesn't control motors directly. It provides control inputs to the Flight Controller and it's the Flight Controller that converts those control inputs into motor speed signals. The control signals are traditionally named after the control servos of an RC airplane: Throttle, Aileron, Elevator, and Rudder. In a quadcopter those controls are labeled Throttle, Roll, Pitch, and Yaw. You control altitude with Throttle, direction with pitch and roll, and heading with yaw.
If you want direct control of the motors you would eliminate the Flight Controller and connect the Arduino servo outputs directly to the ESCs. Then it would become the Arduino's responsibility to take accelerometer and gyroscope inputs and adjust the motor controls dynamically to keep the quadcopter stable (the job of a Flight Controller).

So instead of sending direct values to the motors through the naze 32, how would i send these inputs so that the naze can read them? at the moment, i have the controller sending data like A100 or B325 and the receiving arduino reads the values and digitalWrites them to some output pin.

I guess i have to modify these codes for the naze? also would i still be connecting the pins to the pwm pins on the naze? or would i have to use I2C or something like that.

apologies if my questions seem repetitive, i am new to this.

Totomyl:
So instead of sending direct values to the motors through the naze 32, how would i send these inputs so that the naze can read them?

The NAZE32 expects servo signals from the receiver so you just use the Servo library to generate servo signals and wire them to the Throttle, Roll, Pitch, and Yaw inputs of the NAZE.

Totomyl:
at the moment, i have the controller sending data like A100 or B325 and the receiving arduino reads the values and digitalWrites them to some output pin.

It depends a lot on what the data is supposed to mean. A digitalWrite() only does ON or OFF and an analogWrite() only works for values up to 255 so it is unclear what your receiving Arduino does with the messages it receives. If those are supposed to be direct commands for motor speeds then you should probably remove the NAZE and talk to the speed controllers directly.

johnwasser:
The NAZE32 expects servo signals from the receiver so you just use the Servo library to generate servo signals and wire them to the Throttle, Roll, Pitch, and Yaw inputs of the NAZE.
It depends a lot on what the data is supposed to mean. A digitalWrite() only does ON or OFF and an analogWrite() only works for values up to 255 so it is unclear what your receiving Arduino does with the messages it receives. If those are supposed to be direct commands for motor speeds then you should probably remove the NAZE and talk to the speed controllers directly.

Oh okay, so where would I find these inputs on the Naze? I found a diagram on images but it doesn't label those pins, also thx for ur information I'm gonna try this out, I'll let u know how it goes!

johnwasser:
The NAZE32 expects servo signals from the receiver so you just use the Servo library to generate servo signals and wire them to the Throttle, Roll, Pitch, and Yaw inputs of the NAZE.
It depends a lot on what the data is supposed to mean. A digitalWrite() only does ON or OFF and an analogWrite() only works for values up to 255 so it is unclear what your receiving Arduino does with the messages it receives. If those are supposed to be direct commands for motor speeds then you should probably remove the NAZE and talk to the speed controllers directly.

Oh okay, so where would I find these inputs on the Naze? I found a diagram on images but it doesn't label those pins, also thx for ur information I'm gonna try this out, I'll let u know how it goes! Also, I am using the Naze 32 rev 6 if tht helps

Totomyl:
Oh okay, so where would I find these inputs on the Naze?

Here is one of the many Google results for NAZE32 Manual:
[http://horejsi.cz/DataFilesEN/emax/naze32%20manual.pdf](http://"http://horejsi.cz/DataFilesEN/emax/naze32 manual.pdf")
The inputs are marked "RC Input" and are labeled by channel number.