GithubHelp home page GithubHelp logo

ros_coils's Introduction

ROS Node for 3D coils

Attempt at adapting 3d coils backend into a ROS node in my spare time.

Usage: Remote Host

Follow these points on the host machine connected with the coils. This machine must clear the dependencies section.

  1. Clone the main branch in your ros workspace.

  2. Build messages and nodes.

catkin_make
  1. Make sure the following are in your ~/.bashrc
source /opt/ros/noetic/setup.bash
source ~/ros_ws/devel/setup.bash
export ROS_IP=192.168.0.10
export ROS_MASTER_URI=http://192.168.0.10:11311
  1. Run the nodes
roslaunch ros_coils middleware.launch

This spins up all the psus as a separate node each.

Usage: Local client

Follow these points on the local machine you want to push fields with. This machine does not need to clear the dependencies section.

  1. Clone the RemoteMachine branch in your ros workspace.

  2. Build messages.

catkin_make
  1. Make sure the following are in your ~/.bashrc
source /opt/ros/noetic/setup.bash
source ~/ros_ws/devel/setup.bash
export ROS_IP=192.168.0.15
export ROS_MASTER_URI=http://192.168.0.10:11311
  1. You should now be able to publish to the \field topic with no issues.

Notes

General Usage Notes

  • PSU nodes have a Voltage/Current interface, with embedded calls to polarity setting.

  • Each PSU node has a ROS Param "debug", to be used to omit all Serial calls to PSU.

  • V/I limits are set at 70% of each supply's rated values. Those can be set as ROS Params. See 6PSU + Field example for usage.

  • The middleware node is spun, with a Magnetic Field Interface, which is automatically translated to input msgs for each PSU node.

  • The Field Node, takes ROS Params x/y/z/Num and x/y/z/Root.

    • x/y/z/Num is an integer (1 or 2) that specifies how many supplies handle the given axis.
    • x/y/z/Root is a string that specifies the address of the first supply.

Example

xNum = 2; xRoot = "/PSU0". The X component of the "/Field" topic will be bound to "/PSU0", "/PSU1".

See 6PSU + Field example for usage.

  • The Z2 PSU is unique in that it lacks a Polarity interface, that is normal and handled internally.

  • New values are published only if they differ from the currently outputted values. This is to prevent the supplies from being overwhelmed.

  • Current Max frequency is unknown, but bound by X2 not getting overwhelmed by just existing. Needs investigation.

Polarity

All supplies (except PSU3) have a separate Polarity and VI interface.

The VI values given from the message get converted to unsigned int values.

The polarity command is complete nonsense, it works differently on different PSUs.

Technically the polarity command has 4 valid arguments: 0x00, 0x01, 0x02, 0x03.

On the original power supplies (now PSU2, PSU4), 0x00 -> Positive output, 0x01 -> Negative output, arguments 0x02 and 0x03 actuall trigger an error.

On PSU3, there is no polarity interface altogether, the sign of the output current is determined by the sign of the current value in the VI interface.

On PSU0, PSU1, the behaviour is more complicated. In short, not only you need to find the correct state for the desired output, but you also need to ensure that transitioning to it is allowed.

I could not find a logic to which state does what and what transition works, so I simply tested them all. See file ~ros_ws/src/ros_coils/transition_data.txt

From there, I used the states that allow free transition between them.

Dependencies

3d coils backend

Utilities

General Notes

If the PSUs are ever requested to push more voltage/current than they can handle (70% of the rated values), the field interface will shutdown. In this case, it is best you close ros nodes, check how the shutdown was triggered and then start again.

If the change in field magnitude is ever bigger than 15mT, the field interface will also shutdown. Similarly, there is a limit of 22/22/22mT on each axis.

Manual Field Input

Launch File. This program starts up the Field interface and takes in field inputs(e.g. bx ENTER -> by ENTER -> bz ENTER), one at a time. To exit, type "q" or "shutdown", then close the field interface with Ctrl+C as usual.

To launch this, use:

roslaunch ros_coils field_manual_op.launch

Manual sweep

Launch File. This program starts up the Field interface and sweeps between the negative and positive sides of the argument "MaxAbs". This argument can be edited in the launch file. While technically multiple axis can be swept at once, they will not be synchronous unless their respective magnitude is equal.

Absolute magnitude, frequency and increment size are editable from here.

To launch this, use:

roslaunch ros_coils sweep_man.launch

CSV Sweep

Launch File. This program starts up the Field interface and runs through a csv at a given frequency. The template for csv files is given here. Please be mindful this checks that all inputs in the csv are valid numbers, but all safety checks are still handled top-level by the field and PSU interfaces.

Csv file path (relative to the package) and frequency can be edited here.

To launch, use:

roslaunch ros_coils sweep_csv.launch

Author

Vittorio Francescon

ros_coils's People

Contributors

mdilecce avatar vfrancescon avatar

Watchers

 avatar

Forkers

mdilecce

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.