Understanding Radio control (Remote control by location)

Thread Starter

camerart

Joined Feb 25, 2013
3,730
If your multicopter control works that way but usually setting servo signal to neutral in throttle channel does not cause altitude hold, copter will ascend or descend depending of current altitude.

On yaw, nick and roll channels servo neutral means steady behavior, increasing difference between servo neutral pulse converts to movement speed through nick and roll angles and may result flip upside down if difference from neutral is applied too fast and on extreme amount. On yaw channel the last is not an issue.
Hi T,
That's correct, in my last post, I said that once the REMOTE reaches the ALT of 1 sent by the TRANSMITTER (BASE) it sets the motors control to neutral, and keeps comparing, and adjusting. If it goes too high, then it slows the motors, and low, it speeds the motors.

Yes, the comparison of each control, should lessen as it nears the desired input, for all channels.
C.
 

Thread Starter

camerart

Joined Feb 25, 2013
3,730
Hi,
As Trigonemetry is needed for the understanding of 3D, and will be needed here soon, Over the years, I've learnt and forgotten how Trigonometry work, and a mate of mine was reminding me.

Where we got so far: on a 2D square to move 1x unit up and 1x unit across, one is the opposite and one is the adjacent. TAN of OP/AD = HYP which is the angle of HYPONENUSE. Now I've got to do some practice to check this.
C
 
Last edited:

trebla

Joined Jun 29, 2019
549
If you move control stick on your transmitter 45 degrees forward and right, to you system sees this movement differently- exactly by one unit to right and one unit to forward difference. And if your receiver unit passes these commands to your copter control unit then the copter moves 45 degrees forward and right. No need to make trigonometry calculations here.
 

Thread Starter

camerart

Joined Feb 25, 2013
3,730
If you move control stick on your transmitter 45 degrees forward and right, to you system sees this movement differently- exactly by one unit to right and one unit to forward difference. And if your receiver unit passes these commands to your copter control unit then the copter moves 45 degrees forward and right. No need to make trigonometry calculations here.
Hi T,
This is a new system, that maybe hasn't been seen before.

If I outline it again:
The base is at location LAT=0 LON=0 ALT=0. If we stick to ALT for now, as the LAT LON may be too complicated to explain at the moment.

The ALT READing will be a barometric pressure READing from the ALT peripheral. The number READ from both ALTs will be converted and zeroed, so now at rest Both BASE and REMOTE will be set to 0. When the throttle joystick is moved forward a number (The scale is yet to be worked out) 'say' 1 (Mtr) will be added to the BASE= 0 so now the BASE ALT reads 1. This is transmitted to the REMOTE that compares it's ALT READing of 0 to the received ALT from BASE, and speeds the motors up untill the height of the REMOTE = 1.
If you understand what I mean please let me know?
C.
 
Last edited:

MrChips

Joined Oct 2, 2009
30,824
What you are creating is a control system, no different from any control system.
The classic design of a control system uses the PID method of control,
P = Proportional
I = Integral
D = Derivative

Take for example a classic temperature controller.
Treal = temperature reading
Tset = target temperature (setpoint)

error = Tset - Treal

The P component is a value that gets smaller as you get closer to the set point.
The I component is the sum of all the error values. This reduces the error to zero and gets you to the setpoint.
The D component looks at the rate of change in the error and corrects for any perturbations, e.g. a gust of wind takes you off course.

Your control value is the sum of all three components.

control value = P + I + D
P = Kp x error
I = Ki x sum of error
D = Kd x rate of change of error

where Kp, Ki, and Kd are called the loop constants.

Tuning a PID control systems means finding the appropriate values of Kp, Ki, and Kd to give you the smoothest and fastest response.
1598012486466.png
 

trebla

Joined Jun 29, 2019
549
There no else matters as only the end coordinates. Each control channel got its control signals from REMOTE more or less same time and the copter starts moving by the shortest way toward end coordinates. Your sensors (altimeter, GPS, IMU etc) give constantly information about actual coordinates and your REMOTE is responsible to give PWM signals to copter control unit to ramp-up or-ramp down its movement speed. Speeding needs to be calculated depending how far is copter from the end coordinates, with PID or another suitable algoritm. I mean by "copter control unit" a device with gyroscopes which is responsible to control multicopter motors accordingly input channel signals ( yaw, nick, roll, throttle etc.)
 

Thread Starter

camerart

Joined Feb 25, 2013
3,730
What you are creating is a control system, no different from any control system.
The classic design of a control system uses the PID method of control,
P = Proportional
I = Integral
D = Derivative

Take for example a classic temperature controller.
Treal = temperature reading
Tset = target temperature (setpoint)

error = Tset - Treal

The P component is a value that gets smaller as you get closer to the set point.
The I component is the sum of all the error values. This reduces the error to zero and gets you to the setpoint.
The D component looks at the rate of change in the error and corrects for any perturbations, e.g. a gust of wind takes you off course.

Your control value is the sum of all three components.

control value = P + I + D
P = Kp x error
I = Ki x sum of error
D = Kd x rate of change of error

where Kp, Ki, and Kd are called the loop constants.

Tuning a PID control systems means finding the appropriate values of Kp, Ki, and Kd to give you the smoothest and fastest response.
View attachment 215233
Hi Mr C,
At the moment, I'm trying to explain how it works, with only one component, the "ALT" (Barometric pressure) of the system, then I'll fill it out to explain the whole system. As it seems a bit difficult for me to get over the whole concept, I'll explain the whole system. If you understand the concept, then please let me know.

The finished system:
The REMOTE starts at 0 ALT, 0 LAT 0 LON, and 0 DIRECTION (degrees around a compass that the REMOTE is pointing toward)

The BASE sends to the REMOTE:
'say' 1 MTR ALT

(I'm not sure yet what 1MTR LAT LON would look like, but for now)

1 MTR north of its 'now' latitude 'say' 50.001°.

1MTR east of it's 'now' longitude 'say' 03.001°.

AIM in degrees 'say' 15°.

The REMOTE would be at a 3D location (The last received location) and calculate the difference between it's 'now location and the one just received, and set itself to move to the new position.

C.
 

Thread Starter

camerart

Joined Feb 25, 2013
3,730
There no else matters as only the end coordinates. Each control channel got its control signals from REMOTE more or less same time and the copter starts moving by the shortest way toward end coordinates. Your sensors (altimeter, GPS, IMU etc) give constantly information about actual coordinates and your REMOTE is responsible to give PWM signals to copter control unit to ramp-up or-ramp down its movement speed. Speeding needs to be calculated depending how far is copter from the end coordinates, with PID or another suitable algoritm. I mean by "copter control unit" a device with gyroscopes which is responsible to control multicopter motors accordingly input channel signals ( yaw, nick, roll, throttle etc.)
Hi T,
I think you have it :)

The "copter control unit" is the KK2 flight controller, and this would correct the flight. (Perhaps it should be Kopter Kontrol :) )

C.
 

trebla

Joined Jun 29, 2019
549
I understood that AIM means difference in yaw channel? Simplest way to move copter to new position is set AIM channel to zero position (forward direction from BASE) and then apply roll and nick commands until copter reaches end coordinates, after that you can restore AIM angle. If you ca'nt or want set AIM temporarily to zero, then you must make some simple trigonometric calculations but only in horizontal plane. In vertical plane you need calculate angles only then if you wish visualise flight path somewhere. If you know what output readings you sensors gave at certain altitude, angle and Long/Lat position then you can easily convert that data to meters and angles. If you don't, then you need make some test readings to be sure what data you get from sensors at different positions.
 

Thread Starter

camerart

Joined Feb 25, 2013
3,730
I understood that AIM means difference in yaw channel? Simplest way to move copter to new position is set AIM channel to zero position (forward direction from BASE) and then apply roll and nick commands until copter reaches end coordinates, after that you can restore AIM angle. If you ca'nt or want set AIM temporarily to zero, then you must make some simple trigonometric calculations but only in horizontal plane. In vertical plane you need calculate angles only then if you wish visualise flight path somewhere. If you know what output readings you sensors gave at certain altitude, angle and Long/Lat position then you can easily convert that data to meters and angles. If you don't, then you need make some test readings to be sure what data you get from sensors at different positions.
Hi T,
AIM is a speciality!
As the BASE has an incremental encoder, that outputs DEG 0-359, which is sent to the REMOTE. The REMOTE compares this input to it's COMPASS and AIMs till they both READ the same. (This needs thinking about, as I'm not sure yet, what method of 'field' we're working on)

e,g, See Grids, image.

NOTE: I added this as I can't always tell which way round the REMOTE is aiming, so to avoid going where it shouldn't , I normally crash it down, and repair it.
C.
 

Attachments

trebla

Joined Jun 29, 2019
549
You should first make this AIM function working correctly because all lateral movements are depending from copters "nose" direction. Maybe you should attach to the BASE a beacon-like reference point to be able calibrate your compass on the fly.
 

Thread Starter

camerart

Joined Feb 25, 2013
3,730
You should first make this AIM function working correctly because all lateral movements are depending from copters "nose" direction. Maybe you should attach to the BASE a beacon-like reference point to be able calibrate your compass on the fly.
Hi T,
Ok, AIM first. Actually, once you think that you understand the system, perhaps we can run through generally how it works, as that is the reason for this post.

I'm not quite sure what you mean by "reference point", but how it is supposed to work, is on the fly. The BASE simply AIMs the DIAL, or steering wheel, the BASE sends the READing (0-359), and the REMOTE reads the degrees, and compares it with it's COMPASS 0-359), and if it is different, then it AIMs the nose in that direction.

One slight complication is: The DIAL sends 0-359, so if the REMOTE is IAMing at 359, then the next CW (clockwise), is 0. The REMOTE is checking to see if it should go left or right, by comparing, 'is it more or is it less' More to the right of 359 is 0, which looks less. Earlier, I made a TRACKER, which did a similar thing, and onother memeber E.G. wrote a bit of CODE to correct this. (Later)
C
 

Deleted member 115935

Joined Dec 31, 1969
0
Not really answering the question, so sorry,
but some thoughts.

You seem to be using the 0 to 360 degrees measurement system,
that is logical, its what were all taught at school,
but in "robotics" and similar areas , it gets you into trouble real quick.

Take as an example, a simple compass ,
its is only in two dimensions , one plane, but the craft its on is a little wobbley
so you want to filter the compass reading, to get a steady number.

Ok, you take a mean of say 5 readings and divide by 5,

you get 4 , 6 , 5 , 6 , 4 .
the average is 5 degrees, looks good.

but now platform has moved 5 degrees, you get

359 , 1, 0 , 1 , 359.

take the average, you get 144 degrees, VERY wrong.

the answer is to either have clever what if algorithm , or to use sin and cos of the angle. average those then take tan to get degrees.

What happens if you want magnitude , how fast to go in that direction,

And this is in only two dimensions, what happens when you get to X,Y and Z.

The standard answer, is to not work in degrees, but work in X,Y Z vectors,

I'd strongly suggest you move away for angles, and go to vectors.
 

trebla

Joined Jun 29, 2019
549
I mean by reference point the point zero or the BASE physical location. The beacon must in that location must constantly emit encoded signal, maybe infrared spectrum, and REMOTE can receive and compare this signal with two sensor in aft section, helping to AIM copter tail to BASE direction. Then you can recalibrate COMPASS to point right direction on the fly. This requires simple trigonometric calculations based on GPS position readings if you use square grid.

Which radio TX-RX equipment you have choosen to this project?
 

MrChips

Joined Oct 2, 2009
30,824
I don't know how the pros do it but here is one way to implement the AIM function.
Send a compass direction, N,S,E,W, and a signed angle.

For example, if you want to AIM 170°, send -10S.
 

Thread Starter

camerart

Joined Feb 25, 2013
3,730
I mean by reference point the point zero or the BASE physical location. The beacon must in that location must constantly emit encoded signal, maybe infrared spectrum, and REMOTE can receive and compare this signal with two sensor in aft section, helping to AIM copter tail to BASE direction. Then you can recalibrate COMPASS to point right direction on the fly. This requires simple trigonometric calculations based on GPS position readings if you use square grid.

Which radio TX-RX equipment you have choosen to this project?
Hi T,
I'm not sure I understand you! Why is there a beacon? The idea at the moment is to send a direction to AIM towards. With the square grid model, this will be N,S,E,W and all points in between. The REMOTE has a COMPASS which is fixed N S in the model. It READs what direction it is AIMing, and compares the sent AIM from the BASE.

The BASE is at a known location LAT and LON, both are set to this initially.

All messages are exchanges via radio link.

C.
 

Thread Starter

camerart

Joined Feb 25, 2013
3,730
I don't know how the pros do it but here is one way to implement the AIM function.
Send a compass direction, N,S,E,W, and a signed angle.

For example, if you want to AIM 170°, send -10S.
Hi Mr C,
I've just sent a message to 'T', does it explain what you are saying?

I'm not sure what a signed angle is, can you give a simple explanation of the '-10S' in your message, please?
C
 

Thread Starter

camerart

Joined Feb 25, 2013
3,730
Not really answering the question, so sorry,
but some thoughts.

You seem to be using the 0 to 360 degrees measurement system,
that is logical, its what were all taught at school,
but in "robotics" and similar areas , it gets you into trouble real quick.

Take as an example, a simple compass ,
its is only in two dimensions , one plane, but the craft its on is a little wobbley
so you want to filter the compass reading, to get a steady number.

Ok, you take a mean of say 5 readings and divide by 5,

you get 4 , 6 , 5 , 6 , 4 .
the average is 5 degrees, looks good.

but now platform has moved 5 degrees, you get

359 , 1, 0 , 1 , 359.

take the average, you get 144 degrees, VERY wrong.

the answer is to either have clever what if algorithm , or to use sin and cos of the angle. average those then take tan to get degrees.

What happens if you want magnitude , how fast to go in that direction,

And this is in only two dimensions, what happens when you get to X,Y and Z.

The standard answer, is to not work in degrees, but work in X,Y Z vectors,

I'd strongly suggest you move away for angles, and go to vectors.
Hi A,
Regarding your 'wobbley' line, I'll have a think?

I think of AIM as 2D really, and will need to also have a think?

Regarding the 'average' My first thought is to only average the numbers <=359, and a separate average for numbers >=0 then choose. Does this satisfy average?

Regarding 'vectors' This keeps cropping up, if the 'simple' method doesn't work, as you suggest, by your robotics comment, then I will have a to learn. I've never been good at Trigonometry, as I have to go through everything in too much detail. (Blame that teacher, who kept me in detention, because I couldn't carry the units into the tens column, I was aged 7):)

Can you give me a quick explanation of what a compass would look like if it only outputted vectors instead of degrees, please?
C.
 

MrChips

Joined Oct 2, 2009
30,824
@andrewmm points out a serious problem if you send directions as 0-359°

To overcome this I suggest that you send values that can be positive or negative.
For example, ... -10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, ...

Therefore if you were heading North, your direction would be N ± degrees.
If you were heading South, your direction would be S ± degrees.

North and South alone would be sufficient.

Thus N+90 is the same as S-90, that is, they are both E+0.
 

Deleted member 115935

Joined Dec 31, 1969
0
@andrewmm points out a serious problem if you send directions as 0-359°

To overcome this I suggest that you send values that can be positive or negative.
For example, ... -10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, ...

Therefore if you were heading North, your direction would be N ± degrees.
If you were heading South, your direction would be S ± degrees.

North and South alone would be sufficient.

Thus N+90 is the same as S-90, that is, they are both E+0.

Good try,
what do you now do when you get to -179 and +179 ?

I have seen this work as a get around,
the system worked out if the needle was in the top or bottom half then used the 0 to 360 or the 0 to 360 coordinates system,
they then moved to three dimensions, and the system became totally un manageable,
 
Top