Remote control by location (PIC in Oshonsoft)

Thread Starter

camerart

Joined Feb 25, 2013
3,838
Hi,
Still solving the SPI issue!
If I run the PCB live, with 2x on screen terminals. one showing the SLAVE 4431 GPS DATA buffer, and the other showing all of the peripherals on the MASTER 46K20, including the GPS buffer after SPI from the SLAVE. The MASTER shows gobbledegook GPS, until the Pickit3 programmer which is attached to the SLAVE is checked or WRITE etc, then it may keep showing on the MASTER but usually only once?
C
 
Last edited:

Thread Starter

camerart

Joined Feb 25, 2013
3,838
Hi, (Also posting on ETO)
I try all kind od techniques to help me program, including a kind of flow chart, but mine are simple and linea.
i've just realised that the problem I'm having with SPI between 2x PICs is because I'm working linearly, and the CODE seems to need a kind of parallelism, as 2x things are kind of happening at the same time.
This is difficult, but now I see it, I hope to be able to sort it out, [let's see].
C
 

Thread Starter

camerart

Joined Feb 25, 2013
3,838
Hi C,
It is called asynchronous operation, basically you have no control over the timing of some peripheral devices.

E
Morning E,
I can control the peripherals ok, using CS, but here I'm referring to INTERRUPTS from the GPS and UART.
As you know these can 'fire' as they choose, so if I 'catch' one and apply an IF ENDIF, the MAIN LOOP is using it's own IF ENDIFS, at what seems to be the same time, but of course isn't.
Having stared at the SIM and logic analyser for years trying to 'see' what's going on, I think I'm closing in on it.
What normally happens, is I get near, then I make a mistake, and it goes into a bag of spaghetti.
Perhaps this time, i'll get to eat it? :)
C
 

Thread Starter

camerart

Joined Feb 25, 2013
3,838
Hi C,
As I said, the Interrupts are initiated by the peripherals devices, which are asynchronous, over which you have no timing control.

E
Hi E,
True, I misread your meaning.
ages ago, I had a good exchange thread, where they were explaining the timing of INTERRUPTs etc, which is quite difficult to manage programming wise.
C
 

Thread Starter

camerart

Joined Feb 25, 2013
3,838
Ei C,

Can you summarize which is the most blocking problem you have at the moment? Let's go step by step through all of them.
Hi T,
Firstly, I haven't looked closely at your project, so these comments are from my experiences.

My project is a different way of controlling flying machines, mine is a Tricopter (I think today a quadcopter may be more modern)

If we ignore my methods, I'm fairly sure you will need peripherals, such as GPS, barometer for altitude, compass, joysticks, and a 360DEG Incremental encoder for aiming (This is for aiming the craft when it can't be seen which way it's aiming for). Understanding and being able to control each of these has taken a long time.
I chose each peripheral that can be controlled via SPI, you may chooses I2C? One consideration was as recent as possible, with cost in mind.
Today I use the Ublox M8N and M9N gps, AK8963C Iphone 6 compass module. BMP280 Barometer. and a redundant RC controller with joysticks, so put the BASE controller inside.
The REMOTE (craft) has similar, but no joysticks for example.

This week after approx 5 years, it looks like all of the peripherals are working, so after a lot of tidying up, then actual control methods can be started.
Any questions?
C
 

TommasoB

Joined Nov 26, 2023
27
Hi T,
Firstly, I haven't looked closely at your project, so these comments are from my experiences.

My project is a different way of controlling flying machines, mine is a Tricopter (I think today a quadcopter may be more modern)

If we ignore my methods, I'm fairly sure you will need peripherals, such as GPS, barometer for altitude, compass, joysticks, and a 360DEG Incremental encoder for aiming (This is for aiming the craft when it can't be seen which way it's aiming for). Understanding and being able to control each of these has taken a long time.
I chose each peripheral that can be controlled via SPI, you may chooses I2C? One consideration was as recent as possible, with cost in mind.
Today I use the Ublox M8N and M9N gps, AK8963C Iphone 6 compass module. BMP280 Barometer. and a redundant RC controller with joysticks, so put the BASE controller inside.
The REMOTE (craft) has similar, but no joysticks for example.

This week after approx 5 years, it looks like all of the peripherals are working, so after a lot of tidying up, then actual control methods can be started.
Any questions?
C
You are entering the world of systems control. You should have a basic of system dynamics to get across your current problems. My question is: Do you know why the quadcopter has become a so commonly used layout? As a suggestion I invite you to install an AI software like chatGPT and type for your doubts. Tricopter is a mess to control due to yaw moment induced by motors. This is a cool approach you can use if you want to use just three motors

Three copter with movable propellers
 

Thread Starter

camerart

Joined Feb 25, 2013
3,838
You are entering the world of systems control. You should have a basic of system dynamics to get across your current problems. My question is: Do you know why the quadcopter has become a so commonly used layout? As a suggestion I invite you to install an AI software like chatGPT and type for your doubts. Tricopter is a mess to control due to yaw moment induced by motors. This is a cool approach you can use if you want to use just three motors

Three copter with movable propellers
Hi T,
I think you are working in a more sensible way, to my methods, but I tend to start a project, then just work through it, for me it's very difficult.

When I started my project, Tricopters had better turning abilities, so I made them instead of quadcopters. Also I read that fewer rotors were more efficient (Helicopters only use one)
I think quadcoters maybe took over because of fashion, but I'm not sure.

I've used AI, but the questions I ask usually point to my posts, because they are specific questions.
C.
 

Thread Starter

camerart

Joined Feb 25, 2013
3,838
Did you read this article? It uses your same flight controller and could be a first step to understand how to define its input to reach a target location. Kk2.1.5
Hi T,
I read similar articles when I first used KK2 boards, which was quite a few years ago.
The KK2 board levels, corrects for 'say' a cross wind, and tunes up or down the aggressivness of the joystick movements.
I use KK2 boards for normal flying, to steady everything.
C
 

TommasoB

Joined Nov 26, 2023
27
Hi T,
I read similar articles when I first used KK2 boards, which was quite a few years ago.
The KK2 board levels, corrects for 'say' a cross wind, and tunes up or down the aggressivness of the joystick movements.
I use KK2 boards for normal flying, to steady everything.
C
Yeah but you can send yaw, pitch, roll a thrust targets from the transmitter
Hi T,
I read similar articles when I first used KK2 boards, which was quite a few years ago.
The KK2 board levels, corrects for 'say' a cross wind, and tunes up or down the aggressivness of the joystick movements.
I use KK2 boards for normal flying, to steady everything.
C
So you already have a flight controller and you need to set a destination from the remote for your drone. You wonder how to do so?
 

Thread Starter

camerart

Joined Feb 25, 2013
3,838
Yeah but you can send yaw, pitch, roll a thrust targets from the transmitter

So you already have a flight controller and you need to set a destination from the remote for your drone. You wonder how to do so?
Hi T,
I only use the KK2 board to save me learning how the accelerator works, as it works with my normal flying Tricopters, I'll just send the control data through it.

I don't use the term transmitter as it confuses me.
What you call transmitter, I call BASE, and what you call the drone, I call the REMOTE.
They both transmit and receive.

The BASE will send the location via radio link, from the joysticks etc, the REMOTE will receive this data, and calculate how to move to that location, which includes.

Nearly all of the BASE peripherals are working satisfactorily, just a few bits of final tidying up.

Once the BASE has finished, most of the REMOTE is similar, except it has motors, and no joysticks. Most of this has already been done, and tested.

Then the more interesting phase of control, and I'm not sure how to do it. I'll start by a simple up/down test on the spot. (A bit like the mars helicopter : ) )

C.
 

TommasoB

Joined Nov 26, 2023
27
Hi T,
I only use the KK2 board to save me learning how the accelerator works, as it works with my normal flying Tricopters, I'll just send the control data through it.

I don't use the term transmitter as it confuses me.
What you call transmitter, I call BASE, and what you call the drone, I call the REMOTE.
They both transmit and receive.

The BASE will send the location via radio link, from the joysticks etc, the REMOTE will receive this data, and calculate how to move to that location, which includes.

Nearly all of the BASE peripherals are working satisfactorily, just a few bits of final tidying up.

Once the BASE has finished, most of the REMOTE is similar, except it has motors, and no joysticks. Most of this has already been done, and tested.

Then the more interesting phase of control, and I'm not sure how to do it. I'll start by a simple up/down test on the spot. (A bit like the mars helicopter : ) )

C.
What you exactly send from the BASE and how is this info handled by the REMOTE?
 

Thread Starter

camerart

Joined Feb 25, 2013
3,838
What you exactly send from the BASE and how is this info handled by the REMOTE?
Hi T,
At the start both BASE and REMOTE are set at the same location (plus 'say' 2x mtrs for safety)
Say the up/down joystick is pushed forward, showing 'say' 1 mtr on it's screen, then the location the REMOTE should move to, is up 1mtr, so it accelerates it's propellors until the 1mtr height is satisfied, and hold there.
The same thing happens for all of the controls e,g, LAT, LON, ALT and AIM.
NOTE: I started with this concept, without knowing anything, apart from what I wanted, so it develops as I go along. Therefore the control part which will be soon, will develop, as I experiment.
C.
 

TommasoB

Joined Nov 26, 2023
27
Hi T,
At the start both BASE and REMOTE are set at the same location (plus 'say' 2x mtrs for safety)
Say the up/down joystick is pushed forward, showing 'say' 1 mtr on it's screen, then the location the REMOTE should move to, is up 1mtr, so it accelerates it's propellors until the 1mtr height is satisfied, and hold there.
The same thing happens for all of the controls e,g, LAT, LON, ALT and AIM.
NOTE: I started with this concept, without knowing anything, apart from what I wanted, so it develops as I go along. Therefore the control part which will be soon, will develop, as I experiment.
C.
You can start with some height control, keeping constant the position coordinates X and Y. As you set a different height as target, you change the speed of all the motors at the same time. The signal you should send to the flight controller is a throttle signal, proportional to the difference between target height and measured height. You should also add a contribution proportional to the vertical speed and one proportional to the time your Remote takes to reach the desired height. This is a basic PID controller.

There is a lot of documentation online.
 

Thread Starter

camerart

Joined Feb 25, 2013
3,838
You can start with some height control, keeping constant the position coordinates X and Y. As you set a different height as target, you change the speed of all the motors at the same time. The signal you should send to the flight controller is a throttle signal, proportional to the difference between target height and measured height. You should also add a contribution proportional to the vertical speed and one proportional to the time your Remote takes to reach the desired height. This is a basic PID controller.

There is a lot of documentation online.
Hi T,
Ok, thanks you.
I have just got all of the peripherals working on the BASE, and have sent the 2x BASE files to a mate of mine, to check and improve, but he doesn't have much time, so that will be a while.

Meanwhile I have just started working on the REMOTE, and have a test board with a couple of SERVOS on to simulate motors, while I figure how they work. So far the servo is moving backwards and forwards.
The REMOTE PCB is almost the same as the BASE PCB, apart from obviously outputs instead of inputs, so there are also 2x programs (2xPICS)
I have next got to get all of the peripherals working similarly to the BASE.

This will take a while, then once both BASE and REMOTE are sensing everything, I can start on the control side of the project.
I am not a fast programmer, and work in BASIC.

I'll post when I get both PCBs ready for experimenting.

How are you progressing with your project?
Cheers, C.
 
Top