Team B1 Update for 4.11.2020

Risks:

One major risk we’ve come across recently is that of a mix-up occurring during the shipping or ordering of items we order from the course staff. This week, instead of receiving the unipolar motor driver that was expected, we got an audio controller PCB from OSHPark. After a few days of inquiries, it was found that the PCB we received was in fact associated with another team’s design, and the course staff decided to re-order the board design. As a contingency for the delay caused by this particular mix-up, it was decided to order a set of darlington transistor arrays from Sparkfun to serve as a potential (if less effective) replacement for the PCB. As a contingency for future mix-ups, we intend to investigate alternatives to required components that can be physically picked up at a store by the team member responsible for assembling our project hardware.

System Updates:

Our previous design made use of an external touch enabled display to provide user interfacing with our raspi. However, in an attempt to reduce project complexity as well as to provide a contingency in the case that the raspi is not powerful enough to both compute image-based compensation on top of a GUI and touch screen feedback we will be altering the design. In our new altered design we will be emplogin a standard user-end notebook as the system for our GUI. This notebook will then communicate with the rpi via usart interfacing (alternatively via ethernet connection) and will provide the raspi with necessary user feedback and vice versa.

The above Gantt chart reflects the decision to move away from the usage of an external display to interface with users. Notably, the task labeled “User Interface Specification” has been struck through, indicating that it is no longer relevant for the project.

Yuyi Shen’s Status Update for April 4 2020

This week, I worked with Kenny to specify through-hole components suitable for driving the large NEMA-17 motors that were determined to be necessary for implementing the pan and tilt functions of our camera mount (see Team Status Report). Spinning out the PCB that was designed for this task earlier in the semester was found to be infeasible due to the risk of shipping delays impacting our ability to receive the boards from whichever manufacturer we decided to use (the boards would have needed to be manufactured overseas to keep costs low). We examined the possibility of simply ordering the motor drivers that were recommended on the motor supplier’s website (notably the Big Easy Driver on Sparkfun), but found them to be rated for far higher supply voltages than the motors were capable of handling.

First, we specified through-hole components for a 12V to 3V SMPS for powering the motors. We chose to use a LM2576T-ADJ/NOPB as the SMPS controller, and simply calculated the resistor feedback values for setting the output voltage to 3V. The inductor and capacitor values were kept to the recommended values in the datasheet. LtSpice was used to verify that the design would indeed produce the desired output voltage:

Then, I spec’d out through hole parts for implementing the actual H-bridges for controlling the motors (2 H-bridges per motor). IRFZ24N transistors and IR2302 gate drivers were selected, along with 24.9 Ohm gate resistors so that the driver circuit can tolerate up to 50 nH of parasitic inductance at the MOSFET gates (to reflect the implementation of the circuit on a breadboard). The gate drivers have built-in PWM and ENABLE inputs, so no additional logic was required past a single inverter for buffering the input of the 2nd gate driver. Because the gate driver ICs are synchronous, no special measures were required for generating dead time. High speed 1N4148 diodes were chosen to clamp the inductor voltages to the supply rails.

Verification was carried out in LtSpice:

Note that there are no spikes in the I(V1) waveform, indicating that the gate driver ICs are successfully mitigating shoot-through in the MOSFETs. Furthermore, the current through the inductor representing the motor coil falls rapidly to 0 when the ENABLE signal goes low, meaning that this functionality works in simulation.

There are voltage spikes at the motor coil during operation, but the flyback diodes successfully keep them within 1 diode drop of the supply rails. There’s also some ringing when the ENABLE signal goes low, but it eventually dies down to a steady-state.

Thus far, I believe I am on track for the 1st demo-in-lab, and the Gantt chart schedule. The first demo will consist of a slide show with simulation results for the motor controllers, and the layout for the motor controller PCB that was designed for the smaller compensator motor. Next week, I will first need to compile the slide show for the demo. Then, I will need to compile a Digikey cart for the final through hole components, and work with Kenny to ensure that we aren’t missing any mechanical components for the test-setup for our mount.

Team Status Update for April 4 2020

Risks:

With regards to the integration of the project components, the principal risk consists of coronavirus-induced shipping delays that could keep us from obtaining missing components on short notice. This is primarily being mitigated by having frequent discussions with one another (and especially Kenny) about parts that are missing or still in-transit.

Last week, we wrote about the increased distance between team members causing significant communication delays. This was addressed by first re-examining our regular meeting schedule, and updating it to reflect our present availabilities. Secondly, we set up a Google Form at https://forms.gle/HW3D9axC5a3YqB7x8 to serve as a rudimentary ticket system for team issues. Tickets are directed to a Google Spreadsheet within our Google Drive directory for later approval.

Changes to system:

This week, Kenny determined that the NEMA-17 400 step motors that we ordered earlier this semester are necessary to implement the panning and tilting functionality of our camera mount. This precludes the possibility of using the smaller 4096-step motors + pcbs that we ordered earlier. Because of the long shipping times associated with the cheaper manufacturers that we’d have to use to spin out the large PCBs that were designed earlier this semester for driving the NEMA-17 motors, we decided to have Kenny implement rudimentary H-bridges on a breadboard using through-hole components. Due to the timing with which orders are placed in this class, this change does not impact our schedule. Indeed, the new through-hole design has already been validated in SPICE simulation, and simply needs to be converted to a Digikey cart for ordering. The risks of implementing H-bridges on breadboard will be mitigated by using separate breadboards for each motor driver to avoid crosstalk, and a relatively large gate resistor was specified for the H-bridge MOSFETs to damp up to 50 nH of parasitic inductance at the FET gates (the circuit node that’s most sensitive to parasitic inductance). Note that this 50 nH corresponds to roughly 5 cm of wire (going by the classic approximation of 1 nH/mm for bond wires).

Changes to schedule:

The “assemble mount” task has been extended to Week 13 to allow for the arrival of the final mount components, while the laser array board layout task has been struck through to reflect our decision to have Kenny simply solder together through-hole components to implement the test setup’s laser drivers. Lastly, the User Interface board layout task has been revised to omit mentions of PCB layout, since the rudimentary UI can be implemented with switches on one of Kenny’s breadboards.

Joy’s Status Update for 2020-04-04

I hooked up the demo to the CV tracking and prototype panning and tilting by allowing output from the tracking algorithm to move the camera in the OpenGL model. The two virtual motors are controlled with a PID control loop. Code has been pushed to the s18-18400-b1-asterism repo.

Things I am behind on that I will catch up on next week:

  • Porting existing code to Raspbian
  • Figuring out how to communicate to the motor controller

Other things I will work on next week:

  • UI fixes (e.g. selecting an object to track from live video)
  • Automatic calibration for the compensator motor’s speed using CV

Joy’s Status Update for 2020-03-28

This week I have a demo for a mock sky, rendered with OpenGL:

I plan to hook up the demo to the CV tracking and prototype panning and tilting by allowing output from the tracking algorithm to move the camera in the OpenGL model. It was tricky getting OpenGL to work at first, so I spent some time getting the dependencies installed etc. Code has been pushed to the s18-18400-b1-asterism repo. I have yet to make sure it can compile on Raspbian, so I will be setting up a VM for that purpose later this week.

I expected to have more done by the end of this week, so I would say I am somewhat behind in terms of deliverables. I have a more concrete plan of action than I did at the end of last week though, and I consider that progress.

Plans for next week:

  • Tomorrow:
    • More points, randomly sampled from a hemisphere
    • Points that rotate around the origin independently (“objects” to track)
    • Modify mock sky and tracker so they can be hooked up together
    • https://docs.opencv.org/2.4/modules/core/doc/opengl_interop.html
  • Monday-Tuesday:
    • Modify tracker to calculate pixel distances(?)
    • Translate pixel distances into camera rotation (panning and tilting)
    • Modify the mock sky scene to allow the camera to move based on inputs
    • Calibrate based on camera fov and other parameters
  • Wednesday-Friday:
    • Port existing code to Raspbian
    • Figure out how to translate those into inputs to the motor controller

Team Status Update for March 28 2020

The primary risk to our project at the moment is the lag time associated with remote work. One team member’s already overslept and missed a morning meeting for discussing the ordering of one of the camera mount’s PCBs, and our Wednesday discussion this week was postponed by a substantial amount of time to accommodate the same team member’s breakfast. Even as I finish up this status report (barely an hour before it is due), one team member remains unresponsive to my messages even though a meeting was initially scheduled for 7 pm EST to do the report. This team member did not see fit to communicate a need to reschedule the meeting for a later time, or to keep the rest of the group up to date on their situation. The lack of punctuality (particularly in the case of morning meetings) is especially egregious in the context of one team member being in a time zone 3 hours behind the other two’s. This risk was originally managed by posting reminders of meeting times on the group chat, and explicitly confirming the times of future meetings before signing off from Zoom. However, since recent events have indicated that such measures are insufficient, I plan to collect phone numbers from team members and call missing group members at scheduled meeting times.

This week, the decision was made to change over to lower power unipolar stepper motors for driving the camera mount’s barn door compensator. This required the design and layout of an entirely new PCB for controlling said stepper motors and thus cost one of us a few days of time. This decision was justified by coronavirus-induced constraints on PCB fabrication, and the relatively lower torque requirements of a barn door compensator. The controller board associated with the original bipolar stepper motors was relatively large to accommodate the large currents needed for the motor windings, and would have needed to be fabricated by a Chinese manufacturer for us to remain in budget. Because the lower power unipolar stepper motors require less board area for heat sinking (and for the actual driver, since unipolar drivers are simpler than bipolar drivers), switching over to them allowed the affordable usage of a US-based PCB manufacturer that charged by the square inch and the avoidance of the undoubtedly long shipping times associated with overseas shipping at this time. Although the new unipolar stepper motors aren’t capable of providing as much torque as the original bipolar stepper motors, this is not an issue due to the lower torque requirements of a barn door compensator.

The updated Gantt chart for the remaining weeks of our project is as follows:

The majority of the assembly tasks have been delegated to Kenny, who has volunteered to integrate the mount components at his residence. Three tasks have been crossed out because of the change in the system design to a barn door tracker-based camera mount, and a task has been added for the investigation of Arduino-based alternatives for recording waveforms (since oscilloscopes are no longer available).

Updated Risk Management Plan:

Some notable risks for our project deal with failure to implement certain subsystems effectively or in a timely manner.

One risk we face is a failure to implement a working motor controller. This can happen due to several factors including stress and voltage spike test failures, and controller-driver interfacing errors. A solution for this subsystem failure would be to forgo implementing our own motor controller. Purchasing a driver controller module as a replacement would pose it’s own challenges as power distribution design would have to be altered to accommodate for the new module. We are also investigating means of debugging the motor controller upon arrival, in case there isn’t time to order a pre-packaged motor controller in the face of coronavirus-induced shipping delays. Thus far, this has taken the form of including means of monitoring the motor controller within the PCB (test points, current sensing resistors, etc.) and investigating the usage of an Arduino as a makeshift oscilloscope for interfacing to these means (now that an actual oscilloscope is no longer available).

In our original risk management plan, we mentioned a contingency for the failure of our project’s mechanical compensator in the form of a switch to a mechanically simple barn-door tracker-based compensator. Owing to the unavailability of CMU fabrication facilities and thus the inability to build our original design, this contingency has been implemented.

A third subsystem that could suffer failures is the computer vision software. If object-tracking is inaccurate, slow, or buggy, or if the latency of image transfer between the user-provided camera and the Raspberry Pi is too high to allow for real-time correction, real-time object-tracking will not be feasible. We can instead implement blind tracking based on known information about celestial objects or given input from the user. We could also repurpose the computer vision for drift alignment for polar alignment.

One major risk that has manifested in the move to remote work is the increased difficulty of debugging the software components of the project. The group member primarily responsible for our project’s computer vision routine is located in Pittsburgh, while the group member performing the integration of the mount’s hardware components is located in Miami, Florida. To alleviate the distance, we are investigating the possibility of setting up a ssh server on the camera mount’s Raspberry Pi so that remote debugging is possible for the person located in Pittsburgh. The principal challenge of this is making sure that the ssh server doesn’t compromise the security of the Miami-based group member’s network.

Fortunately, there are few new risks to the successful integration of the mount’s hardware. The team member in charge of physical assembly is familiar with both the mechanical and electrical sides of the project, and has assured the group that he is in possession of the equipment necessary to accomplish his tasks.

Regards,

Yuyi Shen

Yuyi Shen’s Status Update for March 28 2020

This week, I designed and laid out for a unipolar stepper controller board for the MIKROE-1530 stepper motor, which we’re switching to due to its lower power requirements. Although ready-made drivers do in fact exist for this stepper motor, the more common ones rely on BJTs to switch current through the motor windings, which have relatively high Vce,sat values. As a result, the decision was made to specify a controller board with low Rds,on MOSFETs (IRLR6225TRPBF) to bring the board’s power dissipation to a minimum.

Because of the relatively low complexity of unipolar motor drivers, the design process was fairly simple, with the exception of the selection of gate resistor values for the motor driver MOSFETs for limiting the degree to which the current waveforms through adjacent motor phases overlap. This overlap manifests as periodic spikes in the current from the power supply, and needs to be kept to a minimum to avoid overloading whichever module is supplying power to the motor. LtSpice simulation was performed with the below testbench to determine the impact of the gate resistor on the supply current spikes (graphed below):

The magnitude of the spike (measured using the steady-state supply current of 185 mA as a reference) was found to be inversely proportional to the gate resistor value:

Ultimately, a gate resistor value of 475 Ohms was selected to keep the supply current within 5% of the steady-state value. The logic gates for providing the motor controller’s ENABLE functionality and hardwiring the motor’s full-step sequence were included in the simulation to model the impact of their propagation delays on the supply current spikes. After this was finalized, high-speed 1N4148 diodes were added in shunt with the MOSFET body diodes to serve as flyback diodes and a transient simulation was performed to confirm that the voltages at the MOSFET drains did not rise beyond the 20V limit for the MOSFETs:

Because the current spikes through the flyback diodes do not exceed 92 mA in magnitude while the diodes themselves are rated for 2 A of surge current, this design is fine.

Unfortunately, due to a connection error during the layout, a revision had to be performed after the Google Form for the board order was submitted. The updated board order is linked here: https://oshpark.com/shared_projects/ezthQ1TM

The layout for the new motor controller board is shown here:

All IO pads on the board are surface mount, and so will require some skill from Kenny during assembly. Each logic input and the board outputs are equipped with either test points for debugging the board’s control inputs or current sensing resistors for measuring the board’s output current so that my SPICE simulations can be validated.

In addition to working on the motor controller for the mount, I also advised Kenny on the design of rudimentary constant-current drivers for the test setup’s laser diodes. To lower the strain on our budget and avoid the lead time associated with PCB fabrication, we chose to have Kenny solder together through-hole components in air for these drivers.

At present, I am on track with respect to our current schedule. Next week, I plan on going over the mount’s user interface with the others and designing a board based on their recommendations to serve as an electro-mechanical interface to the mount for the user. Thus far, we’ve been planning to use this interface board to permit the manual operation of the camera mount’s stepper motors and the selection of targets for object tracking.

Yuyi Shen’s Status Update for 03/21/2020

This week, I placed the finishing touches on the high power motor controller board. This mostly consisted of adding charge reservoir capacitors to decouple the H-bridges locally so that the voltage at the H-bridges won’t droop during operation. I also tidied up the PCB silkscreen so that the component designators are easily visible:

On JLPCB, the design should cost roughly $28.50, with an additional $17.55 for DHL shipping for 5 units. Thus far, shipping to the US with the aforementioned courier has not been impacted. With an estimated build time of 3 days, a shipping time of 4 business days, and a delay of 3 days (due to Coronavirus), we can get our designs done with a lead time of 10 days, which is still reasonable.

Due to changes in the scope of our project due to Coronavirus precautions, I’ve begun investigating the possibility of using a smaller 4096 step stepper motor (MIKROE-1530) for driving our project’s barn door compensator. This motor takes 5V (which would require a redesign of the primary SMPS), but only consumes 0.1 A per phase. Using IRLR6225TRPBF MOSFETs means that the static power consumption is less than a milliwatt, allowing the omission of area-intensive drain pads that would ordinarily be used for heat dissipation. The electrical complexity of the gate drivers also drops due to the motor being unipolar, allowing the usage of simple buffers (LM5114BMFX/S7003094) instead of proper half-bridge gate drivers like the LM5109B. Overall, changing over to this motor will allow the resultant motor controller board to be much smaller, giving us more headroom in the budget since the US-based PCB manufacturer we were planning to use as a backup in the case of further Coronavirus-based shipping restrictions charges by the square inch. Assuming that we fix a rotation rate of 1 RPM for this motor for the barn door compensator, the motor controller board will need to support 68 steps per second (which is well within the capabilities of an Arduino’s ADC to detect and record for debugging purposes).

Next week, I intend to consult with the faculty on the feasibility of performing the PCB fabrication through JLPCB in light of potential shipping restrictions. If it is possible, then I will perform a design review of the motor controller with Dr. Mukherjee and have the board ordered to Kenny’s location for assembly. As a contingency, I will proceed with the design and layout of a motor controller for the new 4096 step motor with the goal of keeping total PCB area below 4 square inches ($20 dollars on OSHpark).

Team Status Report for 03/21/20

The biggest risk we face right now is delays and assembly problems caused by the present pandemic. A lot of the testing that must be done normally requires specialty equipment that is not easily accessible outside of campus or prohibitively expensive. Similar issues are faced with assembly of the project including shipping times, equipment condition, and specialized tools. A lot of the changes we made during this week were in an effort to minimize the impact of these changes as well as lower the special requirements for assembly and construction that we relied on in the previous design. We will redesign the mount to reduce reliance on fabricated parts. This will take some time and put us somewhat behind.

We made a significant change to the original system design in switching to a barn door tracker-based design instead of a full equatorial mount. This was in response to the loss of access to fabrication facilities in light of the coronavirus situation, as the new design is mechanically simpler and is more easily constructed with standard components that can be shipped directly from McMaster. This change, and the implications for the capabilities we were aiming to support is fully detailed in our statement of work, which is attached here: http://course.ece.cmu.edu/~ece500/projects/s20-teamb1/wp-content/uploads/sites/83/2020/03/Statement-of-Work.pdf.

To reflect the change to the system design and the time lag caused by the uncertainties of our situation, we’ve updated the schedule:

One major change is that the majority of the assembly tasks have been delegated to Kenny. The actual integration of the various mount components will occur at his residence. Due to this, we have adjusted the division of other tasks to accommodate.

Joy’s Status Update for 2020-03-21

I have spent this week rescoping our project with my teammates. Due to lack of access of TechSpark, the hinge joint and the turntable portions of the mount will need to be somewhat modified to rely less on fabricated gears and instead on parts from McMaster-Carr. This will require some redesigning. For the object-tracking software, it seems that the bottleneck will most likely be the latency of image transfer, but the object tracking may also decrease the possible framerate. I need to start working on porting the software to the Pi, either by working in a VM or by ordering a Pi and running the software on the Pi directly. I will need to start working with libgphoto2 and attempting to feed images into the object-tracking software from a camera (e.g., a smartphone) connected via libgphoto2. It’s also important that I figure out how the mount and the motors will interface with the Pi, which GPIO pins to use, etc. As for verification of the object-tracking software, I will need to experiment with generation of mock inputs for the Pi. I am behind on this. I will also need to work out how to coordinate testing of the interface between the Pi and the motor controller board given that I will not have access to both.