//#include "ys32md211.h"
typedef struct 
{
	float kp; 
	float ki; 
	float out;
	float up;
	float ui; 
	unsigned int pi_cnt; 
}PI; 
extern PI pi;
//***************************************************//
typedef struct
{
	unsigned char value;
	unsigned char h1; 
	unsigned char h2; 
	unsigned char h3; 
	unsigned char dir_flag; 
	
	unsigned int speed; 
	unsigned int sp_cnt; 
	unsigned int change_flag; 
}HALL;
extern HALL hall;
typedef struct 
{
	unsigned int speed; 
	unsigned int bk_speed; 


	//float ui; 
	unsigned int pi_cnt; 
}Speed; 
extern Speed  Pro_Speed;

void mc_speed_calc(void);
void mc_ramp(unsigned int *set_value1, unsigned int *actual_value1);
unsigned int pi_control(unsigned int set_speed, unsigned int actual_speed);
void loop_control(void);
void pi_init(void);
void speed_int(void);
void Speed_process(void);


