2021-04-13, 07:17 PM
I am currently testing an IBT-2 with the latest motor.ino available on github repository with almost no code modifications. It works fine (after the usual dismantling of the radiator to ensure electrical isolation and apply thermal conductive paste before reassembling).
As Sean exposed, uncommenting #define VNH2SP30 is enough. Here are some notes taken:
* IBT2 is supported but may require some adjustments for current image accuracy
* Motor current is given by formula Il=Is*Kilis with Kilis=[3000,14000] centered on 8500.
* This is a quite wide range and require calibration thanks to a potentiometer to avoid code modification
* The current signal is at PWM frequency and may require a low pass filter (to be tested)
IBT2 <-> arduino
1. RPWM D2
2. LPWM D3
3. R_EN D9
4. L_EN D9
5. R_IS R_IS & L_IS are connected together and linked to GND by 200ohm+1k potentiometer
6. L_IS A low pass RC filter based on 1uF and 1K resistor may be needed
7. VCC 5V
8. GND GND
The sole modification required is the computation of the current image to match the output given by the IS resistor to GND.
if(pwm_style == 2) // VNH2SP30
return v * 9 / 34 / 16;
The last line need to be updated.
I have chosen to keep the PWM frequency low to enable low velocities and limit BTS7960 dissipation.
Independently of the value of Kilis, I still have to check the accuracy of the current image vs PWM cycle (ie, at various velocities). This is on the list as well as a PWM on the Clutch to limit the power drawn by solenoids such as the ones of hydraulic pilots (the solenoid need to be energized full rate just a few seconds and then a PWM cycle between 50-70% is enough).
All in all and should Sean agree, I can propose some (very minor) mods to the code to support explicitly the IBT-2 based on #define options and Clutch PWM. It would be nice to have a hold-on and pwm as parameters through the various interfaces such as pypilot, web and opencpn but I have not looked at these codes yet.
Regards,
Xavier.
As Sean exposed, uncommenting #define VNH2SP30 is enough. Here are some notes taken:
* IBT2 is supported but may require some adjustments for current image accuracy
* Motor current is given by formula Il=Is*Kilis with Kilis=[3000,14000] centered on 8500.
* This is a quite wide range and require calibration thanks to a potentiometer to avoid code modification
* The current signal is at PWM frequency and may require a low pass filter (to be tested)
IBT2 <-> arduino
1. RPWM D2
2. LPWM D3
3. R_EN D9
4. L_EN D9
5. R_IS R_IS & L_IS are connected together and linked to GND by 200ohm+1k potentiometer
6. L_IS A low pass RC filter based on 1uF and 1K resistor may be needed
7. VCC 5V
8. GND GND
The sole modification required is the computation of the current image to match the output given by the IS resistor to GND.
if(pwm_style == 2) // VNH2SP30
return v * 9 / 34 / 16;
The last line need to be updated.
I have chosen to keep the PWM frequency low to enable low velocities and limit BTS7960 dissipation.
Independently of the value of Kilis, I still have to check the accuracy of the current image vs PWM cycle (ie, at various velocities). This is on the list as well as a PWM on the Clutch to limit the power drawn by solenoids such as the ones of hydraulic pilots (the solenoid need to be energized full rate just a few seconds and then a PWM cycle between 50-70% is enough).
All in all and should Sean agree, I can propose some (very minor) mods to the code to support explicitly the IBT-2 based on #define options and Clutch PWM. It would be nice to have a hold-on and pwm as parameters through the various interfaces such as pypilot, web and opencpn but I have not looked at these codes yet.
Regards,
Xavier.