Giter VIP home page Giter VIP logo

nearzero1's People

Contributors

jhaupt 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nearzero1's Issues

Robowheel getting stuck or cogging

Connected two robowheels to one near zero, operating voltage is 36 and batteries are 7 ah.

channel 1: 1000 ma operating current, 200 ma testing current
Channel 2: 1000 ma operating current, 200 ma testing current

tested in both pwm and i2c mode. This happens after changing the direction of spinning of the motors. Irrespective of the speed the bug has been reproduced at different current settings.

Motors don't stop when PWM input signal stops

Functions.ino line 760
if(pwm1_t > 0){ //Is the pwm active?

pwm1_t and pwm2_t are only set to 0 prior to setup() until the first pwm signal is received. After that, they always hold some positive value. That value is only set by ISR_pwm1() which will not occur if the R/C transmitter is switched off or goes out of range. The result is motors keep turning at the last speed unless R/C transmitter is switched back on and signal is set to neutral, or power is disconnected. There needs to be something like
// PWMtimeout around 100mS
if (micros() - risemark1 > PWMtimeout) { pwm1_t = 0; pwm2_t = 0; }

Never exiting the initial current calibration with some motors

With some motors, the controller never gets out of the initial current calibration. I think this is because the resistance of the motor is too large to reach the target current even with maximum duty. If I start up the controller with a different motor and switch back to the higher resistance motor after the calibration, I can use the motor without any problems. This is a little cumbersome though.

One possible solution would be to allow the user to skip the calibration and control the motor directly by duty instead of by current. This may be desirable for other reasons too.

A related issue is that when sending I2C commands with a high current, there is no check that the resulting duty is not too high. This leads to overflows and violent jumps in motor position. It's not easy for the user to know what the maximum current that can be used is, because it will be different for different motors. This would also be easier if controlling directly by duty.

Resetting phase index in velocity mode

In the functions Roll1_vel() and Roll2_vel() the following code is supposed to keep the phase index in the interval 0 to 2*pi:

	//RESET PHASE INDEX AFTER 2PI
	if (phaseindex1 >= 2*pi) {   //Reset phaseindex_U1 once it completes 2*180o in phase.
		phaseindex1 = 0;
	}
	else if (phaseindex1 <= 0){
		phaseindex1 = 2*pi - phaseindex1;
	}

For the case of phaseindex1 <= 0, I believe is should really be phaseindex1 = 2*pi + phaseindex1; rather than phaseindex1 = 2*pi - phaseindex1;. For the case of phaseindex1 >= 2*pi, it's not really wrong, but setting it to 0 could cause a small speed inconsistency. It would be better to use phaseindex1 = phaseindex1 - 2*pi;.

All together, I would propose the following code:

	//RESET PHASE INDEX AFTER 2PI
	if (phaseindex1 >= 2*pi) {   //Reset phaseindex_U1 once it completes 2*180o in phase.
		phaseindex1 -= 2*pi;
	}
	else if (phaseindex1 < 0){
		phaseindex1 += 2*pi;
	}

The reason I found this was that I experienced that the motor got stuck after rotating just a little bit at certain speeds. I believe this is due to the controller getting stuck in an infinite loop jumping between the edge cases. It only seems to happen at certain negative speeds, which I think is due to floating point imprecision.

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.