Coder Social home page Coder Social logo

zubax / opengrab_epm_v3 Goto Github PK

View Code? Open in Web Editor NEW
31.0 6.0 18.0 3.89 MB

OpenGrab Electropermanent Magnet

Home Page: https://zubax.com/epm

License: GNU General Public License v3.0

Makefile 0.77% Shell 0.17% C 84.16% C++ 13.60% GDB 0.07% Python 1.23%
epm opengrab-epm electropermanent-magnet uavcan zubax robotics dronecode

opengrab_epm_v3's People

Contributors

andreasjochum avatar ctech4285 avatar pavel-kirienko avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

opengrab_epm_v3's Issues

Drwatson fixes

[21:06:48] Pavel Kirienko: I can actually add some idication saying whether the signatire was new or reused

[21:11:13] Andreas Jochum: PIO1_3 should J4
[21:11:38] Andreas Jochum: and PIO0_3 should J3
[21:13:34] Andreas Jochum: J3 open, J4 closed

Catastrophic failure mode possible on different hardware

Force 1 second delay when power stage misfires. Misfire = main capacitor is not discharged after firing

It is possible on different hardware that the holding current is reached. Via the cathode pull down resistor on the power stage
It cause the Thyristor to stay on for up to 1 second. Subsequently firing its lower pair will cause the two thyristors to eat to much power and fail as short.

I'll take care of it before we change out the thyristors for the next rev

Lots of magic numbers in voltage measurement functions

There's some weird arithmetic in getSupplyVoltageInMillivolts() that doesn't make sense. What were you trying to do? Why +700?

unsigned getSupplyVoltageInMillivolts()
{
    static std::uint16_t old_value = 0;

    std::uint16_t new_value = 0;
    (void)Chip_ADC_ReadValue(LPC_ADC, ADC_CH6, &new_value);

    // Division and multiplication by 2 are reduced
    unsigned x = static_cast<unsigned>((static_cast<unsigned>(new_value + old_value) * AdcReferenceMillivolts) >>
                                       AdcResolutionBits);

    old_value = new_value;

    x *= 5;
    x += 700;                           // Poor man's calibration, it's within 100mV - TODO WTF is this?
    if (x < 4500)                       // Under 4500mV Vref drops, mesurements useless
    {
        x = 0;
    }
    return x;                           // Voltage divider on board, shoud not go here
}

Prepare documentation for David

See the email sent Aug 8:

What I would need to work on this would be:

  1. HW with JTAG and optional DEBUG Console connectors and any special cables.
  2. Schematics in searchable pdf format
  3. The pin map for the EPM product in tabular form that list
    1. SoC pin capabilities (CPU Usage)
    2. SoC pin number (Pin)
    3. Signal name from the schematic (Signal),
    4. The use in the application (Signal in parens),
    5. Point of termination if it goes to a connector. (Board)

When button is presses repeatedly and fast ~200ms the EPM does funky things

Mag on 2
Mag ON chrg started
Mag ON chrg started
Mag off
Charger restart
Mag OFF chrg started cyc 0
Mag OFF chrg started cyc 1
Mag on 2
Charger restart
Mag ON chrg started
Mag ON chrg started
Mag off
Charger restart
Mag OFF chrg started cyc 0
Mag OFF chrg started cyc 1
Mag on 2
Charger restart
Mag ON chrg started
Mag ON chrg started
Mag off
Charger restart
Mag OFF chrg started cyc 0
Mag OFF chrg started cyc 1
Mag on 2
Charger restart
Mag ON chrg started
Mag ON chrg started
Mag off
Charger restart
Mag OFF chrg started cyc 0
Mag OFF chrg started cyc 1

Charger Time out not working

When Vout is not rising fast enough charger should quit, it doesnt
When Vout is not reached <1s charger should time out, it doesnt

Define magnet control sequences

We have two functions, magnetOn() and magnetOff(). At the moment they are filled with test patterns, we need to clean them up and implement the correct logic. What would be the correct logic?

I imagine it is as follows:

  • Charge the capacitor with a pre-defined amount of energy, or to a pre-defined voltage.
  • Switch the bridge.
  • Optionally repeat a few times.

When the magnet does not need to switch, the cap will remain discharged.

Also, the Charger class has to be rewritten in a non-blocking manner, since we can't block in run(), there is other logic to run too. I can refactor it myself once #2 is resolved.

Funky behavior when UAVCAN and PWM or button is used at the same time

Temporary fix: Don't use CAN and PWM together,

PWM should be ignored when CAN is being used.

The CAN command is being send over and over again and the receiver only response to a change in command.
This is the typical way to use CAN bus - the same state is being published at a fixed rate or when it changes
This allows to ensure consistency even if the receiving node restarts

There seems to be a bug in somewhere as well....

Clean up the mess in the charge pump driver

I can fix the problems with duplicated code (although it would be best to not write it like that in the first place), but I can't fix the functions cycleXXXX_XXXX() not understanding what they are. It seems like you were furiously trying to calibrate something, producing copious nop statements in the function bodies. Could you not just use board::delayUSec()?

Also, disabling interrupts for 1 ms would actually disrupt PWM input handling. I will evaluate our options to use hardware capture unit instead of software processing.

Properly handle the DIP switch

[12:05:07 AM] Andreas Jochum: how does the ID map to the dip switch postions?
[12:05:17 AM] Pavel Kirienko: directly
[12:05:51 AM] Pavel Kirienko: actually this should be changed a bit
[12:06:07 AM] Pavel Kirienko: the highest bit of the dip switch should configure node ID

Funky behavior when UAVCAN and PWM or button is used at the same time

Temporary fix: Don't use CAN and PWM together,

PWM should be ignored when CAN is being used.

The CAN command is being send over and over again and the receiver only response to a change in command.
This is the typical way to use CAN bus - the same state is being published at a fixed rate or when it changes
This allows to ensure consistency even if the receiving node restarts

There seems to be a bug in somewhere as well....

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.