# Using curves in block coding

I have been teaching my students the basics right now using the block coding, but can’t seem to get the curve function to work correctly unless you leave z at 0. Using the simulator I see that if I change z to 1 while making a circle the circle would tilt 45 degrees. If I change z to 2, it turns the circle up on end 90 degrees. Should I be able to use z to make the curve do something like a corkscrew? Does someone have a good explanation of curves that can help me? I am not a beginner programmer, I programmed for many years before becoming a teacher.

Hi Seth, let me see if I can help explain and I will point you to a lesson where we talk about this:

Understanding the Curve Block | DroneBlocks Curriculum

First off, keep in mind that we try to stay consistent with how the Tello drone behaves when flying a curve. That means a positive X value is forward and a positive Y value is left. Here is an example of the curve block with the default values. This is looking straight down on the X/Y plane since Z is 0 in the default case.

You’ll notice I’ve plotted the values on the simulator output. Think of it this way… when any curve command is being executed Tello assumes its current location as 0, 0, 0. Then the two points in the curve block are plotted based on this starting location. Once they are plotted Tello then flies the curve pattern. When I use the term “plot” Tello (and our simulator) are doing a real-time calculation of where to fly.

Here is another example except that negative Y values are used and therefore flies the curve to the right:

The following example includes the Z axis and therefore Tello flies a vertical arc. The view is from the right looking left:

I also just ran a test in our V2 simulator that we will be launching in a couple of weeks. I like to make sure our code still works properly in the new sim. This is the 3rd example from above, but in the new DroneBlocks simulator:

I hope this helps and please feel free to respond with any questions or concerns.

Thanks for the pictures and comments, but I still have the same issue. Let me try to rephrase my question.

Let’s say that I want the drone to fly in a corkscrew pattern. Is that possible? So as it curves, I want the drone to rise slowly. In your last example, if I put in 50 for z2, would that do it? In the simulator, it look like if I put in a 1 for z1 in your example it would do the same thing as your picture. Am I better off not changing the values for all x, y, and z when using a curve but only change 2 of them? I will go back to the simulator and try some more things.

Thanks.
Seth

This isn’t perfect due to the way Tello flies its curve pattern but you can probably experiment with these values. I’ll spend some time later trying to get this to be a tighter corkscrew: