Take off device for RC plane
Moderator: Benj
Take off device for RC plane
I’m doing a take off device for RC plane. It will be connected between speed controller and receiver. The program should work like this:
- when power is switched on during the next 6 seconds power is reduced into 50%.
- after 6 seconds the power should be 100%. In appendix is my try out which won’t
work.
I hope that someone can help me finalyze my flowchart. I have looked over it so many times and my eyes are getting crossed.
jjw
- when power is switched on during the next 6 seconds power is reduced into 50%.
- after 6 seconds the power should be 100%. In appendix is my try out which won’t
work.
I hope that someone can help me finalyze my flowchart. I have looked over it so many times and my eyes are getting crossed.
jjw
- Attachments
-
- Motor_delay_6s.fcf
- (20.01 KiB) Downloaded 633 times
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: Take off device for RC plane
Hi jjw,
You will need to:
1) Change statement within interrupt to (See if you can work out why).
2) int_count must be initialised with 0.
3) In Project options select
4) I would reset & int_count on first detection of switch (rising edge).
5) The PWM value should be set to 50% I would assume only when pulse is detected (only from then should seconds start to increment?) and then if less than 6 seconds has elapsed.
When 6 seconds has elapsed then stop seconds from counting since when seconds reach 255 then if one is added seconds = 0. Set PWM = 100%
If you make the above corrections we can take it from there.
Martin
You will need to:
1) Change statement within interrupt to
Code: Select all
int_count < 61
2) int_count must be initialised with 0.
3) In Project options select
Code: Select all
Auto clear watchdog
Code: Select all
second_count
5) The PWM value should be set to 50% I would assume only when pulse is detected (only from then should seconds start to increment?) and then if less than 6 seconds has elapsed.
When 6 seconds has elapsed then stop seconds from counting since when seconds reach 255 then if one is added seconds = 0. Set PWM = 100%
If you make the above corrections we can take it from there.
Martin
Martin
Re: Take off device for RC plane
Hi Martin,
Not knowing if did those changes you described right... Anyway the second try out here......
jjw
Not knowing if did those changes you described right... Anyway the second try out here......
jjw
- Attachments
-
- Motor_delay_6s_v1.fcf
- (19.99 KiB) Downloaded 583 times
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: Take off device for RC plane
I have made some mods for you.
I have modified so that if switch is activated again then duty will drop to 50% for another 6 seconds.
Martin
I have modified so that if switch is activated again then duty will drop to 50% for another 6 seconds.
Martin
- Attachments
-
- Motor_delay_6s V2.fcf
- (19.77 KiB) Downloaded 601 times
Martin
Re: Take off device for RC plane
Hi Martin,
Thanks again Martin of your great help for me!
I put in appendix a scheme in order to check that we both have understood this program in a same way. The switch was only to demonstrate those two states 50 % and 100 %. There aren’t such a switch only power on/off switch. My purpose was to to keep this simple only few other components not even a pot having a fixed delay. I tried to test this with Real Pic simulator but without any big success....
Can’t test this with hardware until next month.
Hope this helps.
jjw
Thanks again Martin of your great help for me!
I put in appendix a scheme in order to check that we both have understood this program in a same way. The switch was only to demonstrate those two states 50 % and 100 %. There aren’t such a switch only power on/off switch. My purpose was to to keep this simple only few other components not even a pot having a fixed delay. I tried to test this with Real Pic simulator but without any big success....
Can’t test this with hardware until next month.
Hope this helps.
jjw
- Attachments
-
- Take off timer.jpg (56.4 KiB) Viewed 12753 times
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: Take off device for RC plane
Hi jjw
I started it from scratch.
Latest version is also not tested in real pic but I cant see why it should not work.
Martin
In that case the attached file is a lot simpler.jjw wrote:switch was only to demonstrate those two states 50 % and 100 %. There aren’t such a switch only power on/off switch. My purpose was to to keep this simple only few other components not even a pot having a fixed delay.
I started it from scratch.
Latest version is also not tested in real pic but I cant see why it should not work.
Martin
- Attachments
-
- Motor_delay_6s V3.fcf
- (7 KiB) Downloaded 619 times
Martin
Re: Take off device for RC plane
Hi Martin,
Tested with Real Pic Simulator works fine. It really looks simple now . Thanks for your help.
jjw
Tested with Real Pic Simulator works fine. It really looks simple now . Thanks for your help.
jjw
Re: Take off device for RC plane
Hi Martin,
Tested the program with the hardware but without any success. Now I wonder how to check that pin 4 (input pulse from receiver) and pin 5 (pulse from speed controller) are in a program equal with my scheme above?
jjw
Tested the program with the hardware but without any success. Now I wonder how to check that pin 4 (input pulse from receiver) and pin 5 (pulse from speed controller) are in a program equal with my scheme above?
jjw
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: Take off device for RC plane
Hi jjw
Since you stated at the start:
So its MCLR = low, code not running.
MCLR high = code running so start at 50% then rise to 100 after a period of time elapsed.
If you want to change so a pulse triggers duty to 50 % then 100% it's a different design.
What I thought you was going to do from the initial spec is just have MCLR on internal. then connect receiver supply to microcontroller supply so both are powered up at the same time.
Martin
The thing is, the pulse input to MCLR has to go & stay high for this to work.jjw wrote:Tested the program with the hardware but without any success. Now I wonder how to check that pin 4 (input pulse from receiver) and pin 5 (pulse from speed controller)
Since you stated at the start:
This is no mention of a trigger pulse.jjw wrote:- when power is switched on during the next 6 seconds power is reduced into 50%.
- after 6 seconds the power should be 100%.
So its MCLR = low, code not running.
MCLR high = code running so start at 50% then rise to 100 after a period of time elapsed.
If you want to change so a pulse triggers duty to 50 % then 100% it's a different design.
What I thought you was going to do from the initial spec is just have MCLR on internal. then connect receiver supply to microcontroller supply so both are powered up at the same time.
Martin
Martin
Re: Take off device for RC plane
You wrote:
So any idea what to do?
jjw
I don’t exactly understand what do you mean with a different design. As far as I understand your comment is to add a pot with it can be reduced power from 50% to 100%.“If you want to change so a pulse triggers duty to 50 % then 100% it's a different design.”
Yes MCU and receiver will powered at the same time.”What I thought you was going to do from the initial spec is just have MCLR on internal. then connect receiver supply to microcontroller supply so both are powered up at the same time”
So any idea what to do?
jjw
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: Take off device for RC plane
In that case you don'r require MCLR.
You can disable it and just connect PMW o/p to the speed controller.
When power is 1st applied to microcontroller duty will start at 50%, then goes to 100% after 6 seconds.
Martin
You can disable it and just connect PMW o/p to the speed controller.
When power is 1st applied to microcontroller duty will start at 50%, then goes to 100% after 6 seconds.
Martin
Martin