View Single Post
Old 12-02-2010, 06:53 PM   #4071 (permalink)
MPaulHolmes
PaulH
 
MPaulHolmes's Avatar
 
Join Date: Feb 2008
Location: Maricopa, AZ (sort of. Actually outside of town)
Posts: 3,832

Michael's Electric Beetle - '71 Volkswagen Superbeetle 500000
Thanks: 1,362
Thanked 1,202 Times in 765 Posts
Quote:
Originally Posted by Greg Fordyce View Post
Code:
#define THROTTLE_FAULT (1 << 0)
#define VREF_FAULT (1 << 1)
#define PRECHARGE_WAIT (1 << 5)
#define MOTOR_OS_FAULT (1 << 6)
#define HPL_FAULT (1 << 7)
So what is the values for the above faults, and can the controller set multiple faults at the same time?
1 << 5 (for example) means 2^5, which is 32. 1 << x means 2^x. So, you can set each of those bits individually. If everything is working,
fault_bits = 00000000 (in binary)

If fault_bits = 11100011, then that's just horrible! haha. That means that there is a high pedal lockout fault set, and a motor overspeed fault, and a precharge wait fault, and the current sensor is out of range, and the throttle is out of range.

fault_bits = 00100000 would mean a precharge wait fault.

__________________
kits and boards
  Reply With Quote
The Following User Says Thank You to MPaulHolmes For This Useful Post:
Greg Fordyce (12-03-2010)