Exemplo n.º 1
0
void idle_control(void)
{
    uint16_t target_rpm;
    int16_t duty;

    target_rpm = table1d_lookup(
        ecu.sensors.ect, IDLE_TEMP_SCALE_SIZE,
        (int16_t*)ecu.config.idle_temp_scale, (int16_t*)ecu.config.idle_rpm
    );
    pid_set_target(&idle_pid, target_rpm);
    duty = pid_do(&idle_pid, ecu.sensors.rpm);
    pwm_set_duty(PWM_IDLE, (512 + (duty >> 6)));
}
Exemplo n.º 2
0
void gnc_motor_stop(uint8 nr)
{    
    pid_set_target(nr, 0);
    pwm_set_raw(nr + 1, 0);
}
Exemplo n.º 3
0
void gnc_set_speed(pid_type target)
{
    pid_set_target(0, target);
    pid_set_target(1, target);
}
Exemplo n.º 4
0
void gnc_full_stop(void)
{
    robot_stop();
    pid_set_target(0, 0);
    pid_set_target(1, 0);
}