diff --git a/README.md b/README.md index 070960e25ce5978a581d37bf58ea5e75c9eb5fae..e150b6d0e9305ee2019ae97081a14b9acc512346 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,7 @@ This is a circuit & mount for a small desktop DC PSU and embedded system bus-hea - clear LED indication of 24v presence, 5v presence on bus ### What's Up: + - uses [the module](https://gitlab.cba.mit.edu/jakeread/ucbus-module) - breaks out 24V 350W & UCBus on one 2x15 IDC - second 24V 40W UCBus channel available diff --git a/firmware/motion-head/src/main.cpp b/firmware/motion-head/src/main.cpp index 60398044fd5aac6d8fea83ef8ba0cc83302cb6d5..cf7aaac058ef42b6c1794a775d5788b567ebf3d0 100644 --- a/firmware/motion-head/src/main.cpp +++ b/firmware/motion-head/src/main.cpp @@ -32,6 +32,7 @@ boolean smoothie_is_moving(void){ EP_ONDATA_RESPONSES onMoveData(uint8_t* data, uint16_t len){ // can we load it? if(!conveyor->is_queue_full()){ + DEBUG3PIN_TOGGLE; // read from head, uint16_t ptr = 0; // feedrate is 1st, @@ -227,50 +228,17 @@ void setup() { // r8 settings osapAddVertex(rateSettingsEp); // 8 // smoothie (and frequency of loop below) - #warning pls reconsider maximal rates / etc given new loop freq... and how / where to parameterize smoothieRoll->init(20000); - // bare serial - //Serial.begin(9600); - // barebus - //ucBusHead_setup(); // 25kHz base (40us period) or // 20kHz base (50us period) d51ClockBoss->start_ticker_a(50); } -//#define TEST_TX - -#ifdef TEST_TX -unsigned long lastTx = 0; -uint8_t testTx[33] = { - 1, 2, 3, 4, 0, 6, 7, 8, 9, 10, - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, - 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 31, 32, 33 }; - -uint8_t tstRx[256]; -#endif - void loop() { // write ~ every second, transmit on chb to drop 1 // check indices on the way down / up ... was shifting, are not anymore osapLoop(); conveyor->on_idle(nullptr); - - #ifdef TEST_TX - if(ucBusHead_ctr(1)){ - uint16_t len = ucBusHead_read(1, tstRx); - logPacket(tstRx, len); - } - if(millis() > lastTx + 100){ - lastTx = millis(); - if(ucBusHead_ctsB(1)){ - //logPacket(testTx, 15); - ucBusHead_transmitB(testTx, 22, 1); - DEBUG1PIN_TOGGLE; - } - } - #endif } // end loop // runs on period defined by timer_a setup: @@ -287,19 +255,18 @@ void TC0_Handler(void){ timeTick ++; timeBlink ++; if(timeBlink > blinkTime){ - //DEBUG1PIN_TOGGLE; + DEBUG1PIN_TOGGLE; timeBlink = 0; } // do bus action first: want downstream clocks to be deterministic-ish ucBusHead_timerISR(); // do step tick - /* smoothieRoll->step_tick(); // every n ticks, ship position? // each of these ticks drops 10 data bytes, so if we have 17 byte packet, can do every 2nd packet // which would occupy the full bus - notgood - or we can do every 3rd... I'll pick every 4th. if(timeTick > 3){ - DEBUG2PIN_TOGGLE; + DEBUG2PIN_HI; timeTick = 0; uint16_t mpptr = 0; // motion packet pointer if(planner->do_set_position){ @@ -314,9 +281,7 @@ void TC0_Handler(void){ ts_writeFloat32(smoothieRoll->actuators[2]->floating_position, motion_packet, &mpptr); ts_writeFloat32(smoothieRoll->actuators[3]->floating_position, motion_packet, &mpptr); // write packet, put on ucbus - //DEBUG3PIN_ON; - //ucBusHead_transmitA(motion_packet, 17); - //DEBUG3PIN_OFF; + ucBusHead_transmitA(motion_packet, 17); + DEBUG2PIN_LO; } - */ } diff --git a/firmware/motion-head/src/osape-d51 b/firmware/motion-head/src/osape-d51 index af5f9a0e004a6134b38f0f1996bebda271f9c655..eeabe1a173dc1c7270b0099a7a1a0e0e7735e1be 160000 --- a/firmware/motion-head/src/osape-d51 +++ b/firmware/motion-head/src/osape-d51 @@ -1 +1 @@ -Subproject commit af5f9a0e004a6134b38f0f1996bebda271f9c655 +Subproject commit eeabe1a173dc1c7270b0099a7a1a0e0e7735e1be diff --git a/firmware/motion-head/src/smoothie/modules/robot/Conveyor.cpp b/firmware/motion-head/src/smoothie/modules/robot/Conveyor.cpp index 9e6248ba86b1f56ae96ef1c0a2d607a391e664c7..0903d54a27ffa02e77288ab94efc97264c5fc2e9 100644 --- a/firmware/motion-head/src/smoothie/modules/robot/Conveyor.cpp +++ b/firmware/motion-head/src/smoothie/modules/robot/Conveyor.cpp @@ -121,7 +121,8 @@ void Conveyor::on_idle(void*) // Cleanly delete block Block* block = queue.tail_ref(); // if not-super-full, light on: buffer close to starving - (queue.space() > 32) ? DEBUG2PIN_ON : DEBUG2PIN_OFF; + #warning this was useful w/ buffer starvation debug / indication + // (queue.space() > 32) ? DEBUG2PIN_ON : DEBUG2PIN_OFF; /* sysError(String(block->millimeters) + " " + String(block->entry_speed) + " " @@ -259,6 +260,8 @@ void Conveyor::check_queue(bool force) // called from step ticker ISR bool Conveyor::get_next_block(Block **block){ + // indicate consumption + DEBUG4PIN_TOGGLE; // mark entire queue for GC if flush flag is asserted if (flush){ while (queue.isr_tail_i != queue.head_i) { diff --git a/log/ucbus-psu-breakout-log.md b/log/ucbus-psu-breakout-log.md index 5f42392bd94fb7772bdba04f1a812629bdabed84..b544a2094220c8ef6b20375fc31ec4cabb969b5f 100644 --- a/log/ucbus-psu-breakout-log.md +++ b/log/ucbus-psu-breakout-log.md @@ -9,4 +9,24 @@ OK, through most of the setup. - pick sercom for rpi serial - label cut-jumpers, config auto -OK, done. \ No newline at end of file +OK, done. + +## Next Revision + +**2021 08 09** + +I get a lot of use out of these and it would be useful if they had a few more features. + +- ferrite bead, maybe SMT? inspect gnd plane when something is consuming power (i.e. the A4950 drivers), there's a 20kHz wobble (about +/- 1V!) and a longer mode ~ maybe 1kHz or so. +- 24v remote shutoff, and might as well add reverse polarity protection if it's easy +- 24v should auto-shutoff when logic is removed, presumably can pull the shutoff gate low +- 24v power sense w/ shunt resistor +- hardware 'power-present' led, +- 5v (!) remote shutoff: helps when debugging, to remote reset everything down-branch +- more intentional packaging with the PSU itself, current situation a little awkward. +- one 30pin and one 10pin connector, same lines, don't bother with 2nd RS485 link +- *so many* debug LEDs +- keep this option for i2c display +- some... buttons ? +- label the 5v select jumpers, +- I had more notes about this somewhere else... see if you can find old haystack log \ No newline at end of file