Git Product home page Git Product logo

epos4-arduino's People

Stargazers

 avatar  avatar  avatar  avatar Raghavasimhan Sankaranarayanan avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

epos4-arduino's Issues

Warning : Example code spins motor up to high rpm

In the example, the section that moves the motor writes
0x1000 rpm per second max acceleration
0x1000 rpm per second max acceleration
0x1000 rpm target motor speed
The comment each time says that this is 1000rpm.
Problem: This is misleading and potentially somewhat dangerous
What happens is that 1000 Hex is written and the motor is spun up to 4096rpm (decimal).
It is also accelerating and decelerating at 4096rpm per second.
I would recommend that
a) Code: for an initial proof of motor movement, a much lower speed and acceleration would be chosen. So change 0x1000 to 0x20 everywhere and change the comment to indicate that this is 81rpm in decimal.
b) Environment: Make sure everything is safe - your motor's axis should be physically disconnected from external machinery.

Arduino running faster than serial input arriving

There is a somewhat nasty problem related to the
if (SerialEpcos.available() > 0)
loop, This is the loop that processes incoming serial data.
It's a long loop, but is is efficiently using the switch case statements.

Serial communications between Arduino and EPOS4 run at 9600 baud = 9600 bit per sec. Start+8data+1stop bit take 10/9600 of a second, roughly one millisec.

Problem: One can imagine this loop completes within one millisec, especially on the more powerful Arduino models. If at that time the next byte is still coming in through the serial port, SerialEpcos.available will be zero and read will fail.
Proposed solution1: Quick & dirty solution would be to add delay(1); somewhere inside the loop. That fixes the problem at 9600 bps, assuming the EPOS4 is sending characters one immediately after the other.
Alternative workaround would be to increase the baudrate in communications between Arduino & EPOS4.
Proposed solution2: Add an additional timeout per character, dependent on baudrate.

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.