Carbon-R4 Setup with Axis FC
If you haven’t already download the latest version of Carbon-R4 from the Github link below. Right now this only supports quadcopters, but we are hoping to
Now that you have Carbon-R4 open in the Arduino IDE, compile it for the Arudino Nano R4 and make sure you don’t have any errors. There shouldn’t be any external libraries that you need to run Carbon-R4.
If it compiles, go the config.h file in the Arduino IDE.
Here you will have access to change all of the parameters to make sure the code will support your specific drone. The most important settings for you to check will be the following:
motors
MOTOR_1 through MOTOR_4 need to have a pin number assigned to them, make sure the right MOTOR is assigned to the right pin. We will be able to check this with the props off later.
Motor 1: Rear Left Motor that should rotate Counter-Clockwise
Motor 2: Front Left Motor that should rotate Clockwise
Motor 3: Front Right Motor that should rotate Counter-Clockwise
Motor 4: Rear Right Motor that should rotate Clockwise
RADIO SETTINGS
Radio settings will be another critical one to make sure align with your radio receiver. You can check this by enabling raw channel printing and looking at the serial monitor for the values for each channel.
Flight Controller Oreintation
How you mount the Axis FC in your drone is critical. It needs to know which way it pitch up, pitch down, roll left, roll right, and so on. Best practice will be to have the Axis arrow on your Axis FC pointed toward the front of the drone.
PID Controller Gains
The PID controller defines how much the motors will attempt to compensate and the drones moves away from its setpoint. This will be slightly different for each type of drone you build, but with trial and error you will find a good tune for your drone. The default tune works very well for 5-in Quads running 6S batteries, but here are other PID tunes that work well for other size drones to give you a starting point:
| 2in Quadcopter | 5in Quadcopter | 12in Quadcopter | |
|---|---|---|---|
| P (Roll/Pitch) | 0.40 | 0.60 | 0.80 |
| I (Roll/Pitch) | 6.00 | 5.00 | 4.50 |
| D (Roll/Pitch) | 4.00 | 4.00 | 13.5 |
| P (Yaw) | 0.75 | 1.00 | 2.25 |
| I (Yaw) | 10.0 | 7.50 | 4.00 |
| D (Yaw) | 0 | 0 | 0 |