2022-03-28, 04:42 PM
(2022-03-27, 07:32 PM)seandepagnier Wrote: You can use analog write on an external attiny, sure.. but if you try that in the main motor.ino it will potentially have issues. Always let us know what works!Sean, I changed the following code to no longer have BADVOLTAGE fault.
In any case... bad voltage is nothing to do with current measurement shunt. It is voltage measurement. You will see on the schematic:
https://pypilot.org/schematics/hbridge_controller.pdf
A0 has 10k and 560 ohm resistor. You just need to add these. bad voltage ensures it stops the motor if the voltage is too low or high (avoid damage, also useful as it beeps if your battery voltage is way off...)
Anyway... you can also check the source code to motor.ino and modify/disable it to avoid this quite easily as well.
if(volts <= 900 || volts >= max_voltage) {
//disengage();
flags &= ~BADVOLTAGE_FAULT;
} else
flags &= ~BADVOLTAGE_FAULT;
I plugged my daughter board (mosfet) on pin 11 but it doesn't work.
I'm sure my daughter board is good because if I connect on the ENGAGE_LED_PIN 7 in the motor.ino of Andreasw29 I have a constant amperage and the clutch works
Pierre