Пример #1
0
void ramp_proc( double set_ref, double * out_ref)
{
	switch(code_ramp_func_mode){
	
	case 0:	RefFunc( set_ref, out_ref ); break;
	
	case 1:	test_ref_func( set_ref, out_ref ); break;
	
	default:RefFunc( set_ref, out_ref ); break;
	}

}
Пример #2
0
void hyd_unit_proc(int state, double * ref_out)
{
	static int hyd_low_count=0;
	static double ref_in = 1.0;
	double hyd_sensor_input;

	static unsigned long ulCount;

 	if( ulGetNow_mSec( )== ulCount ) return;

	ulCount = ulGetNow_mSec( );
	hyd_sensor_input = analog_ref_a;

	if( state == STATE_RUN ){

		if( hyd_sensor_input < ( hyd_sensor_set_ref * hyd_high_speed_on_ratio ) ) hyd_low_count++;
		else if ( hyd_sensor_input >  hyd_sensor_set_ref ) hyd_low_count --;	

		if( hyd_low_count > 3){
			hyd_low_count = 4;
			ref_in = hyd_max_ref;
		}
		else if( hyd_low_count <= 0 ){
			hyd_low_count = 0 ;
			ref_in = digital_speed2;
		}
	}
	else	ref_in = 0.0;

	RefFunc( ref_in, ref_out );

}