daffy99 said:
Cool, now submit a pull request for all the usability (Java) changes that you made!
I fear a pull request will end up at my own desk....
@casainho: can you please confirm this program sequence for the motor control:
Fast Loop:
The timerinterrupt handler calls the functions
1.
hall_sensors_read_and_action ();
2.
motor_fast_loop ();
the
motor_fast_loop () calls the function
pwm_duty_cycle_controller ()
the
pwm_duty_cycle_controller () calls the function
pwm_apply_duty_cycle (ui8_duty_cycle)
Slow Loop:
First thread in parallel in the main.c:
the function
motor_controller_high_level () is called. The content of this function is disabled at the moment.
If enabled, the functions for speed and current control are called. They get their setpoints from the
throttle_pas_torque_sensor_controller (); that runs in parallel.
Then the function
motor_set_pwm_duty_cycle_target is called.
The function
motor_set_pwm_duty_cycle_target does nothing but calling the function
pwm_set_duty_cycle_target (value);
The function
pwm_set_duty_cycle_target (value); sets the value of ui8_duty_cycle_target, that is used in the fast loop for motor control.
Second thread in parallel in the main.c:
the function
throttle_pas_torque_sensor_controller (); is called
throttle_pas_torque_sensor_controller (); calls the function
ui8_adc_read_throttle ();
then
throttle_pas_torque_sensor_controller (); calls the function
motor_set_pwm_duty_cycle_target (ui8_temp); at the moment directly instead of calling the functions
motor_controller_set_current (ui16_temp); and / or
motor_controller_set_speed_erps (ui16_temp); that are disabled at the moment.
If enabled these functions would set the setpoints of the
motor_current_controller and
motor_speed_controller functions that are called in the
motor_controller_high_level () that runs in parallel....
a bit confusing...
regards
stancecoke