Skip to content

Commit

Permalink
Bug fixes, updated Eagle library a bit.
Browse files Browse the repository at this point in the history
  • Loading branch information
collin80 committed Dec 4, 2017
1 parent 1273c00 commit 5160366
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 6 deletions.
7 changes: 4 additions & 3 deletions CanHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,13 @@ void CanHandler::detach(CanObserver* observer, uint32_t id, uint32_t mask)
*/
void CanHandler::logFrame(CAN_FRAME& frame)
{
/*
if (Logger::isDebug()) {
Logger::debug("CAN: dlc=%X fid=%X id=%X ide=%X rtr=%X data=%X,%X,%X,%X,%X,%X,%X,%X",
frame.length, frame.fid, frame.id, frame.extended, frame.rtr,
frame.data.bytes[0], frame.data.bytes[1], frame.data.bytes[2], frame.data.bytes[3],
frame.data.bytes[4], frame.data.bytes[5], frame.data.bytes[6], frame.data.bytes[7]);
}
}*/
}

/*
Expand Down Expand Up @@ -209,12 +210,12 @@ void CanHandler::process()

if (bus->rx_avail()) {
bus->get_rx_buff(frame);

/*
Logger::debug("CAN:%d dlc=%X fid=%X id=%X ide=%X rtr=%X data=%X,%X,%X,%X,%X,%X,%X,%X",canBusNode,
frame.length, frame.fid, frame.id, frame.extended, frame.rtr,
frame.data.bytes[0], frame.data.bytes[1], frame.data.bytes[2], frame.data.bytes[3],
frame.data.bytes[4], frame.data.bytes[5], frame.data.bytes[6], frame.data.bytes[7]);

*/
if(frame.id == CAN_SWITCH) CANIO(frame);


Expand Down
2 changes: 1 addition & 1 deletion GEVCU6.ino
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Random comments on things that should be coded up soon:
#include <SPI.h>
#include <microsmooth.h>

//#define DEBUG_STARTUP_DELAY //if this is defined there is a large start up delay so you can see the start up messages. NOT for production!
#define DEBUG_STARTUP_DELAY //if this is defined there is a large start up delay so you can see the start up messages. NOT for production!

//Evil, global variables
PrefHandler *sysPrefs;
Expand Down
5 changes: 4 additions & 1 deletion MotorController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ MotorController::MotorController() : Device() {
mechanicalPower = 0;

selectedGear = NEUTRAL;
operationState=ENABLE;
operationState = ENABLE;

dcVoltage = 0;
dcCurrent = 0;
Expand Down Expand Up @@ -245,6 +245,9 @@ void MotorController::checkPrecharge()
throttleRequested = 0; //Keep throttle at zero during precharge
prelay=true;
Logger::info("Starting precharge sequence - wait %i milliseconds", prechargetime);
Logger::info("PRECHARGE ENABLED...DOUT0:%d, DOUT1:%d, DOUT2:%d, DOUT3:%d,DOUT4:%d, DOUT5:%d, DOUT6:%d, DOUT7:%d",
systemIO.getDigitalOutput(0), systemIO.getDigitalOutput(1), systemIO.getDigitalOutput(2), systemIO.getDigitalOutput(3),
systemIO.getDigitalOutput(4), systemIO.getDigitalOutput(5), systemIO.getDigitalOutput(6), systemIO.getDigitalOutput(7));

}
}
Expand Down
7 changes: 6 additions & 1 deletion RMSMotorController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ RMSMotorController::RMSMotorController() : MotorController()
online = 0;
activityCount = 0;
sequence = 0;
isLockedOut = true;
commonName = "Rinehart Motion Systems Inverter";
}

Expand All @@ -68,7 +69,7 @@ void RMSMotorController::setup()
void RMSMotorController::handleCanFrame(CAN_FRAME *frame)
{
int temp;
uint8_t *data = (uint8_t *)frame->data.value;
uint8_t *data = &frame->data.bytes[0];
online = 1; //if a frame got to here then it passed the filter and must come from RMS

if (!running) //if we're newly running then cancel faults if necessary.
Expand Down Expand Up @@ -540,6 +541,10 @@ void RMSMotorController::sendCmdFrame()
else {
torqueCommand = torqueRequested/2; //If at RPM limit, cut torque command in half.
}

if (torqueRequested < 0) torqueRequested = 0;

Logger::debug("ThrottleRequested: %d TorqueRequested: %d", throttleRequested, torqueRequested);

output.data.bytes[1] = (torqueCommand & 0xFF00) >> 8; //Stow torque command in bytes 0 and 1.
output.data.bytes[0] = (torqueCommand & 0x00FF);
Expand Down
36 changes: 36 additions & 0 deletions Shield/collin.lbr
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,20 @@
<pin name="GND3" x="40.64" y="2.54" visible="pin" length="middle" rot="R180"/>
<pin name="BIGGND" x="15.24" y="-5.08" visible="pin" length="middle" rot="R90"/>
</symbol>
<symbol name="FAN3227">
<wire x1="0" y1="0" x2="17.78" y2="0" width="0.254" layer="94"/>
<wire x1="17.78" y1="0" x2="17.78" y2="20.32" width="0.254" layer="94"/>
<wire x1="17.78" y1="20.32" x2="0" y2="20.32" width="0.254" layer="94"/>
<wire x1="0" y1="20.32" x2="0" y2="0" width="0.254" layer="94"/>
<pin name="ENA" x="-5.08" y="17.78" length="middle"/>
<pin name="INA" x="-5.08" y="12.7" length="middle"/>
<pin name="GND" x="-5.08" y="7.62" length="middle"/>
<pin name="INB" x="-5.08" y="2.54" length="middle"/>
<pin name="OUTB" x="22.86" y="2.54" length="middle" rot="R180"/>
<pin name="VDD" x="22.86" y="7.62" length="middle" rot="R180"/>
<pin name="OUTA" x="22.86" y="12.7" length="middle" rot="R180"/>
<pin name="ENB" x="22.86" y="17.78" length="middle" rot="R180"/>
</symbol>
</symbols>
<devicesets>
<deviceset name="ADE7913">
Expand Down Expand Up @@ -896,6 +910,28 @@
</device>
</devices>
</deviceset>
<deviceset name="FAN3227">
<gates>
<gate name="G$1" symbol="FAN3227" x="0" y="2.54"/>
</gates>
<devices>
<device name="" package="SOIC8">
<connects>
<connect gate="G$1" pin="ENA" pad="1"/>
<connect gate="G$1" pin="ENB" pad="8"/>
<connect gate="G$1" pin="GND" pad="3"/>
<connect gate="G$1" pin="INA" pad="2"/>
<connect gate="G$1" pin="INB" pad="4"/>
<connect gate="G$1" pin="OUTA" pad="7"/>
<connect gate="G$1" pin="OUTB" pad="5"/>
<connect gate="G$1" pin="VDD" pad="6"/>
</connects>
<technologies>
<technology name=""/>
</technologies>
</device>
</devices>
</deviceset>
</devicesets>
</library>
</drawing>
Expand Down

0 comments on commit 5160366

Please sign in to comment.