Anonymous flight controller (Turner) shielding remote control

1. Theory

The part of the program that needs to be modified

1. Find all rc_loss flags first, assign 0, and don't let it become 1.
2. Find the place where CH_N[] is assigned, change all the first 4 channels to 0, and other values ​​you need (such as changing the mode).
3. Just call one key to take off, and other marks do not need to be changed.
4. Note that the place where rc_loss is set to 1 should shield the light mark and one-key landing mark.

Two, practical operation

1. Pay attention

By searching, it is found that the parts that need to be changed are all in the ANO_RC.C subroutine

2. Mark

before change

//在ANO_RC.C中的第248行
	if(flag.unlock_sta)
	{
    
    
		if(switchs.gps_on ==0)
		{
    
    
			flag.auto_take_off_land = AUTO_LAND; //如果解锁,自动降落标记置位
		}
		else
		{
    
    
			flag.rc_loss_back_home = 1;
		}
	}
	LED_STA.noRc = 1;
}

1. Regarding the 1 flag of rc_loss, I only found flag.rc_loss_back_home = 1; so try it (I don’t know if it is), change 1 to 0

2. At the position set to 1, there is a light mark LED_STA.noRc = 1; shield it

3. At the position set to 1, there is a one-key landing flag flag.auto_take_off_land = AUTO_LAND; also shield it

after change

	if(flag.unlock_sta)
	{
    
    
		if(switchs.gps_on ==0)
		{
    
    
		//	flag.auto_take_off_land = AUTO_LAND; //如果解锁,自动降落标记置位
		}
		else
		{
    
    
		//	flag.rc_loss_back_home = 0;
		}
		
	}
	//LED_STA.noRc = 1;
}

3. CH_N[] assignment

before change

//在ANO_RC.C中的第191行
void RC_duty_task(u8 dT_ms) //建议2ms调用一次
{
    
    
	if(flag.start_ok)	
	{
    
    
		/获得通道数据
		for(u8 i=0;i<CH_NUM;i++)
		{
    
    
			CH_N[i] = rc_in.rc_ch.st_data.ch_[i]-1500;
			CH_N[i] = LIMIT(CH_N[i],-500,500);//限制到+—500
		}					

1. In the first assignment to CH_N[], it is found that the first 4 bits will be affected, so change it to i starting from 4, and then assign 0 to the first 4 bits.

//在ANO_RC.C中的第230行
void fail_safe(void)
{
    
    
	for(u8 i = 0;i<4;i++)
	{
    
    
		CH_N[i] = 0;
	}

2. In the second place where CH_N[] is assigned a value, it is found that it will not affect the first 4 bits, because even if the effect is still 0, no change will be made.

after change

void RC_duty_task(u8 dT_ms) //建议2ms调用一次
{
    
    
	if(flag.start_ok)	
	{
    
    
		CH_N[0] = 0;
		CH_N[1] = 0;
		CH_N[2] = 0;
		CH_N[3] = 0;
		/获得通道数据
		for(u8 i=4;i<CH_NUM;i++)
		{
    
    
			CH_N[i] = rc_in.rc_ch.st_data.ch_[i]-1500;
			CH_N[i] = LIMIT(CH_N[i],-500,500);//限制到+—500
		}					

result

According to the Tukonger manual, we can know that the indicator light has changed from an out-of- control state (red breathing) not connected to the remote control to a short flash + long interval
insert image description here
of normal operation . At this time, one-key takeoff and one-key landing instructions can be sent through the command packet. Verification succeeded.

Three, pay attention

Before making sure that your program can fully perform all takeoffs and landings, it is best not to block the remote control, because it will cause you to lose control of your plane, and you will not be able to save it with the remote control

Guess you like

Origin blog.csdn.net/a919964703/article/details/125964891
Recommended