Willkommen, Gast
Benutzername: Passwort: Angemeldet bleiben:

THEMA: Arctic Hare mod by Jussi

Arctic Hare mod by Jussi 1 Monat 3 Wochen her #18088

  • Bernard
  • Bernards Avatar
  • Offline
  • Benutzer
  • Benutzer
  • Beiträge: 1073
  • Dank erhalten: 210

I'm getting IMU-tilt errors during charging if saving settings (writing to eeprom)

It's occur only when saving or not ?
Is it the code with
void watchdogSetup(void) {}
If yes try to remove totaly this line ,it was the issue on IMU calibration so maybe ??

I also have the overload each 8 minutes in charging station and don't understand what the code do at the moment ??

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Arctic Hare mod by Jussi 1 Monat 3 Wochen her #18089

  • jussip
  • jussips Avatar Autor
  • Offline
  • Benutzer
  • Benutzer
  • Beiträge: 237
  • Dank erhalten: 22
Not only when saving, that last one is w/o saving. watchdog function is uncommented but defined false.
Is there IMU (auto)calibration during charging? (like during mowing?) This IMU is calibration which is saved to eeprom is done before watchdog. Maybe there's no reason to check imu tilt on charger at all
Didn't we discussed that 8 minutes mystery earlier something?
There's so many different delays to different functions.. Can it be that every 8 minutes all of them are executed on same loop? or memory fill up and flushing takes time?

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Letzte Änderung: von jussip.

Arctic Hare mod by Jussi 1 Monat 3 Wochen her #18091

  • Bernard
  • Bernards Avatar
  • Offline
  • Benutzer
  • Benutzer
  • Beiträge: 1073
  • Dank erhalten: 210

watchdog function is uncommented but defined false.

Please try to comment or remove the function.
The false option is not enought to make the calibration work ????

For the IMU .
The calibration is done only one time for the life of the mower using the pfod menu.
There is no Autocalibration, i need to change the text and find a more explicit one.
The IMU is composed with GYRO and COMPAS
The Gyro is very accurate and always use in the code for mower localisation, but it can drift slowly over time.
It's why each 10 or 20 minutes the mower stop and roll using Compas to find gain the real yaW , At this point i add offset to the GYRO to have same value on Gyro and Compass,.
During this stop i check if the Gyro move or not each 4 sec and wait until the drift stop or a timeout of 20 second occur.

Didn't we discussed that 8 minutes mystery earlier something?

YES i remember ,but why ??

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Arctic Hare mod by Jussi 1 Monat 3 Wochen her #18095

  • jussip
  • jussips Avatar Autor
  • Offline
  • Benutzer
  • Benutzer
  • Beiträge: 237
  • Dank erhalten: 22
Q2 mosfet is shorted, thats why pcb stays powered.

How to drive mow motors 'backwards'? negative pwm? knives wear out only other side and I'm thinking something like this:
boolean oddDay = (datetime.date.day / 2 % 1); //this return 0 or 1
  if (oddDay)
    motorMowSpeedMaxPwm = motorMowSpeedMaxPwm * -1;

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Arctic Hare mod by Jussi 1 Monat 3 Wochen her #18099

  • Bernard
  • Bernards Avatar
  • Offline
  • Benutzer
  • Benutzer
  • Beiträge: 1073
  • Dank erhalten: 210
Negative PWM , Normaly yes but be carreful to change the dir only if the motor is stop (pwm=0) to avoid explosion of the driver.
Also i have change the original code to add accel and brake on mow motor and never test this feature with pwm <0
To test you can simply unlock the PFOD mow motor pwm slider from -255 to 255

You can also simply reverse the blade when used.

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Arctic Hare mod by Jussi 1 Monat 2 Wochen her #18100

  • jussip
  • jussips Avatar Autor
  • Offline
  • Benutzer
  • Benutzer
  • Beiträge: 237
  • Dank erhalten: 22
Simple test code:
unsigned long lastSetMotorMowSpeedTime = 0;
int motorMowPWMCurr = 0;
int motorMowAccel = 2000;

void setup() {
  // put your setup code here, to run once:
  Serial2.begin(19200);
  Serial.begin(19200);

}

void setMotorMowPWM(int pwm, boolean useAccel) {

  unsigned long TaC = millis() - lastSetMotorMowSpeedTime; // sampling time in millis
  lastSetMotorMowSpeedTime = millis();
  if (TaC > 1000)
    TaC = 1;
  //bber13
  if ((!useAccel)) //accel is not use when stop the blade on tilt
    motorMowPWMCurr = pwm;
  else
  {
    motorMowPWMCurr += int(TaC) * (pwm - motorMowPWMCurr) / motorMowAccel;
  }
  Serial.print("motorMowPWMCurr: ");
  Serial.println(motorMowPWMCurr);
  //bber13
  //    setActuator(ACT_MOTOR_MOW, min(motorMowSpeedMaxPwm, max(0, motorMowPWMCurr)));
}

void loop() {
  setMotorMowPWM(-255, true);
  delay(250);
}
Result:
20:51:18.997 -> motorMowPWMCurr: 0
20:51:19.241 -> motorMowPWMCurr: -31
20:51:19.483 -> motorMowPWMCurr: -59
20:51:19.725 -> motorMowPWMCurr: -83
20:51:19.998 -> motorMowPWMCurr: -104
20:51:20.237 -> motorMowPWMCurr: -122
20:51:20.477 -> motorMowPWMCurr: -138
20:51:20.718 -> motorMowPWMCurr: -152
20:51:20.989 -> motorMowPWMCurr: -164
20:51:21.230 -> motorMowPWMCurr: -175
20:51:21.471 -> motorMowPWMCurr: -185
20:51:21.745 -> motorMowPWMCurr: -193
20:51:21.986 -> motorMowPWMCurr: -200
20:51:22.224 -> motorMowPWMCurr: -206
20:51:22.500 -> motorMowPWMCurr: -212
20:51:22.742 -> motorMowPWMCurr: -217
20:51:22.981 -> motorMowPWMCurr: -221
20:51:23.222 -> motorMowPWMCurr: -225
20:51:23.499 -> motorMowPWMCurr: -228
20:51:23.739 -> motorMowPWMCurr: -231
20:51:23.977 -> motorMowPWMCurr: -234
20:51:24.220 -> motorMowPWMCurr: -236
20:51:24.494 -> motorMowPWMCurr: -238
20:51:24.734 -> motorMowPWMCurr: -240
20:51:24.976 -> motorMowPWMCurr: -241
20:51:25.250 -> motorMowPWMCurr: -242
20:51:25.490 -> motorMowPWMCurr: -243
20:51:25.731 -> motorMowPWMCurr: -244
20:51:25.975 -> motorMowPWMCurr: -245
20:51:26.247 -> motorMowPWMCurr: -246
20:51:26.490 -> motorMowPWMCurr: -247
20:51:26.731 -> motorMowPWMCurr: -248
20:51:26.972 -> motorMowPWMCurr: -248
20:51:27.248 -> motorMowPWMCurr: -248
20:51:27.498 -> motorMowPWMCurr: -248
20:51:27.734 -> motorMowPWMCurr: -248
20:51:27.970 -> motorMowPWMCurr: -248
20:51:28.245 -> motorMowPWMCurr: -248
20:51:28.483 -> motorMowPWMCurr: -248
20:51:28.724 -> motorMowPWMCurr: -248
20:51:28.998 -> motorMowPWMCurr: -248
20:51:29.236 -> motorMowPWMCurr: -248
Looks like it work also negative number. Why this don't never reach 255 or -255?

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Arctic Hare mod by Jussi 1 Monat 2 Wochen her #18111

  • jussip
  • jussips Avatar Autor
  • Offline
  • Benutzer
  • Benutzer
  • Beiträge: 237
  • Dank erhalten: 22
New mosfet is ordered. I disabled IMU so charging work w/o errors. Few eeprom error came today also when mower hit to station. I think it's i2c issue caused by faulty mosfet. SDA and SCL lines are connected to IOREF via r47-48.
DIsabling imu affect minor driving issue, wheels go just like if they are lifted up.. not smooth and theres some over current error's

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Arctic Hare mod by Jussi 1 Monat 2 Wochen her #18113

  • jussip
  • jussips Avatar Autor
  • Offline
  • Benutzer
  • Benutzer
  • Beiträge: 237
  • Dank erhalten: 22
motorMowSpeedPWMSet is set to 255 beginning of robot.cpp, are all variables below right? w/o modulate mowspeed=motorMowSpeedPWMSet, where pfod pwmMax setting is taken account?
Just tried to set that negative via pfod. It's not work. instantly when pwm setting goes negative mower motor start to spin and it can't be stopped.
void Robot::setMotorMowPWM(int pwm, boolean useAccel)
{
  unsigned long TaC = millis() - lastSetMotorMowSpeedTime; // sampling time in millis
  lastSetMotorMowSpeedTime = millis();
  if (TaC > 1000)
    TaC = 1;
  //bber13
  if ((!useAccel)) //accel is not use when stop the blade on tilt
    motorMowPWMCurr = pwm;
  else
  {
    motorMowPWMCurr += int(TaC) * (pwm - motorMowPWMCurr) / motorMowAccel;
  }

  //bber13
  setActuator(ACT_MOTOR_MOW, min(motorMowSpeedMaxPwm, max(0, motorMowPWMCurr)));
}
void Robot::motorMowControl()
{
  if (millis() < nextTimeMotorMowControl)
    return;
  nextTimeMotorMowControl = millis() + 100;

  if (motorMowForceOff)
    motorMowEnable = false;

  double mowSpeed;
  if (!motorMowEnable)
  {
    mowSpeed = 0;
    lastMowSpeedPWM = mowSpeed;
    motorMowPID.esum = 0;
    motorMowPID.x = 0;
    if (stateCurr == STATE_ERROR)
    {
      setMotorMowPWM(mowSpeed, false); //stop immediatly on error (tilt etc....)
    }
    else
    {
      setMotorMowPWM(mowSpeed, true);
    }
  }
  else
  {
    //if ((motorMowModulate) && (motorMowRpmCurr != 0)){
    // speed sensor available

    if (motorMowModulate)
    {
      if (mowSpeed < motorMowRPMSet)
      {
        mowSpeed = lastMowSpeedPWM + 200;
        if (mowSpeed > motorMowRPMSet)
          mowSpeed = motorMowRPMSet;
      }
      else if (mowSpeed > motorMowRPMSet)
      {
        mowSpeed = lastMowSpeedPWM - 200;
        if (mowSpeed < motorMowRPMSet)
          mowSpeed = motorMowRPMSet;
      }

      motorMowPID.x = 0.2 * motorMowRpmCurr + 0.8 * motorMowPID.x;
      motorMowPID.w = mowSpeed; // 3300 => 2300
      motorMowPID.y_min = -motorMowSpeedMaxPwm / 2;
      motorMowPID.y_max = motorMowSpeedMaxPwm / 2;
      motorMowPID.max_output = motorMowSpeedMaxPwm / 2;
      motorMowPID.compute();

      setMotorMowPWM(mowSpeed / 20.0 + motorMowPID.y, false);
      lastMowSpeedPWM = mowSpeed;
    }
    else
    {
      if ((errorCounter[ERR_MOW_SENSE] == 0) && (errorCounter[ERR_STUCK] == 0))
      {
        // no speed sensor available
        mowSpeed = motorMowSpeedPWMSet;
        if (stateCurr == STATE_ERROR)
        {
          setMotorMowPWM(mowSpeed, false); //stop immediatly on error (tilt etc....)
        }
        else
        {
          setMotorMowPWM(mowSpeed, true);
        }
      }
    }
  }
}

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Arctic Hare mod by Jussi 1 Monat 2 Wochen her #18114

  • Bernard
  • Bernards Avatar
  • Offline
  • Benutzer
  • Benutzer
  • Beiträge: 1073
  • Dank erhalten: 210

where pfod pwmMax setting is taken account?

It's here :
setActuator(ACT_MOTOR_MOW, min(motorMowSpeedMaxPwm, max(0, motorMowPWMCurr)));

And maybe it's also the trouble with negative value , replace with a single test like this:
If motorMowPWMCurr>0 {
if motorMowPWMCurr > motorMowSpeedMaxPwm :{
motorMowPWMCurr = motorMowSpeedMaxPwm}
If motorMowPWMCurr<=0 {
if motorMowPWMCurr < -1* motorMowSpeedMaxPwm :{
motorMowPWMCurr = -1*motorMowSpeedMaxPwm}

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Arctic Hare mod by Jussi 1 Monat 2 Wochen her #18126

  • jussip
  • jussips Avatar Autor
  • Offline
  • Benutzer
  • Benutzer
  • Beiträge: 237
  • Dank erhalten: 22
Now it's working. I didn't understand setActuator line syntax and negative value didn't work there.
Positive directions motor run like just like before. negative directions sounds like they run like expected but power reading is about 50W.
void Robot::setMotorMowPWM(int pwm, boolean useAccel)
{
  // Drive mow motor both directions
  if (datetime.date.day % 2 == 0) // even numbers = 0
    pwm = pwm * -1;
  unsigned long TaC = millis() - lastSetMotorMowSpeedTime; // sampling time in millis
  lastSetMotorMowSpeedTime = millis();
  if (TaC > 1000)
    TaC = 1;
  //bber13
  if ((!useAccel)) //accel is not use when stop the blade on tilt
    motorMowPWMCurr = pwm;
  else
    motorMowPWMCurr += int(TaC) * (pwm - motorMowPWMCurr) / motorMowAccel;

  if ((motorMowPWMCurr > 0) && (motorMowPWMCurr > motorMowSpeedMaxPwm))
    motorMowPWMCurr = motorMowSpeedMaxPwm;

  if ((motorMowPWMCurr < 0) && (motorMowPWMCurr < motorMowSpeedMaxPwm * -1))
    motorMowPWMCurr = motorMowSpeedMaxPwm * -1;

  // setActuator(ACT_MOTOR_MOW, min(motorMowSpeedMaxPwmSET, max(0, motorMowPWMCurr)));
  setActuator(ACT_MOTOR_MOW, motorMowPWMCurr);
}

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Arctic Hare mod by Jussi 1 Monat 2 Wochen her #18129

  • jussip
  • jussips Avatar Autor
  • Offline
  • Benutzer
  • Benutzer
  • Beiträge: 237
  • Dank erhalten: 22
For some reason negative direction sensing is about double at startup but only startup. No idea why.. Real power/current is same both directions, checked this with multimeter

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Arctic Hare mod by Jussi 1 Monat 2 Wochen her #18139

  • Bernard
  • Bernards Avatar
  • Offline
  • Benutzer
  • Benutzer
  • Beiträge: 1073
  • Dank erhalten: 210
How did you manage the 2 motors and the sense , the original driver is parallel shunt ,so ??

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Arctic Hare mod by Jussi 1 Monat 2 Wochen her #18140

  • jussip
  • jussips Avatar Autor
  • Offline
  • Benutzer
  • Benutzer
  • Beiträge: 237
  • Dank erhalten: 22
Second sense is pin A6 and everything in code is doubled except err_mow_sense

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Arctic Hare mod by Jussi 1 Monat 2 Wochen her #18147

  • Bernard
  • Bernards Avatar
  • Offline
  • Benutzer
  • Benutzer
  • Beiträge: 1073
  • Dank erhalten: 210
I work on RL1000 mower and something strange in the pin driver on pcb1.3.
For the motor mow the Dual2 on kicad page 2/33
Without the driver I can read 3.28V between 2 and 3 and 3.28 between 6 and 7
But 3.31V between 15 and 16
All the mesure are between GND and IOREF so it is strange ??
Maybe it can explain strange result on sense reading

I suppose you have cut the bridge between 19/23 and 20/24 and use the 2 separate output ?

To manage the 3 RL1000 big motor i use 4 IBT-2 43A motor driver and 3 ina219 sensor at the input of each driver
I limit the power with soft at 75W on each motor and it is OK on very high grass.

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Arctic Hare mod by Jussi 1 Monat 2 Wochen her #18149

  • jussip
  • jussips Avatar Autor
  • Offline
  • Benutzer
  • Benutzer
  • Beiträge: 237
  • Dank erhalten: 22
Second motor output is taken directly on motor driver and theres extra protect pcb. Changing accel 2000 -> 3000 solved this for now. Both motors and directions take 2.0-2.2 A at start but negative direction keep startup current that level 1.5 s. longer time. Tried also to swap motor wires but same behaviour to negative direction. w/o load current is 0.4 A both motors/directions

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Arctic Hare mod by Jussi 1 Monat 1 Woche her #18179

  • jussip
  • jussips Avatar Autor
  • Offline
  • Benutzer
  • Benutzer
  • Beiträge: 237
  • Dank erhalten: 22
Mowing with IMU, moves much smoother than w/o


Funny thing about my charging issue is that charger from shop (1,5A) doesn't cause any error. Only other charger (3A) does this. Voltage is same both of them, so only variable is current??? Anyways new pcb is ordered and this broken one can be dev board in other platform.

For some reason watchdog reset due on every startup. Annoying because I have to start piardu manually. Is it possible to restart piardu if serial is lost from piardu python script? Like somekind self reset. If not then I'll find a way to do it from bash/linux
What are pyc files? Just noticed some of those are updated
Folgende Benutzer bedankten sich: Bernard

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Arctic Hare mod by Jussi 1 Monat 1 Woche her #18180

  • Bernard
  • Bernards Avatar
  • Offline
  • Benutzer
  • Benutzer
  • Beiträge: 1073
  • Dank erhalten: 210
Very well , maybe you can increase a little (5 or 10) the Minimum motor PWM because i see sometime some pause on the wire.
Did the Sonar are activate ?

For some reason watchdog reset due on every startup. Annoying because I have to start piardu manually

Very Strange that i Don't have this issue, Are you sure you have follow all the Git change or do you use the last RFID branch.
To be sure start with the PC connected and console on it( see mower.h for that) to check exactly when the reset occur and add a resetWatchdog() just before.
I use 2 PCB1.3 with original DUE and never see this issue.
I have a screen on the Pi so it's easier for me to see this,but The full startup and power OFF are always OK in auto mode using mower.sh script.

restart piardu if serial is lost

On my last change i check for the ACM0 or ACM1, so maybe if none of them are present
I do this in the past with the Due flashing process, see
def ButtonFlashDue_click():
It didn't close totaly PiArdu but reset totaly the Serial connection (need to check ACM0 or ACM1 before)

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Arctic Hare mod by Jussi 1 Monat 1 Woche her #18182

  • jussip
  • jussips Avatar Autor
  • Offline
  • Benutzer
  • Benutzer
  • Beiträge: 237
  • Dank erhalten: 22
Sonar's are not in use because mower won't go under bushes if they are use.
There's udev rule that set due always to /dev/ACM_DUE, on due reset piardu script stop here
Linux Platform
b''
RFID file loaded OK
heure change 0
heure change 1
heure change 2
heure change 3
heure change 4
refresh setting timer
Set the new time and date to PI
sudo date -s '2019-9-9 19:56:0'
09/09/19 19:55:45
Exception in Tkinter callback
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/serial/serialposix.py", line 490, in read
    'device reports readiness to read but returned no data '
serial.serialutil.SerialException: device reports readiness to read but returned no data (device disconnected or multiple access on port?)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.5/tkinter/__init__.py", line 1562, in __call__
    return self.func(*args)
  File "/usr/lib/python3.5/tkinter/__init__.py", line 608, in callit
    func(*args)
  File "/home/pi/Documents/PiArdumower/PiArdu.py", line 561, in checkSerial
    mymower.dueSerialReceived=Due_Serial.readline()
  File "/usr/lib/python3/dist-packages/serial/serialposix.py", line 497, in read
    raise SerialException('read failed: {}'.format(e))
serial.serialutil.SerialException: read failed: device reports readiness to read but returned no data (device disconnected or multiple access on port?)

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Arctic Hare mod by Jussi 1 Monat 1 Woche her #18183

  • Stockfisch
  • Stockfischs Avatar
  • Offline
  • Benutzer
  • Benutzer
  • Beiträge: 102
  • Dank erhalten: 2
Hello Jussip
Can you please tell me what 3A charger you use?
I have the 1,5A one from shop and I want to shorten charging time.
Thanks and best regards,
Bjoern

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Arctic Hare mod by Jussi 1 Monat 1 Woche her #18184

  • jussip
  • jussips Avatar Autor
  • Offline
  • Benutzer
  • Benutzer
  • Beiträge: 237
  • Dank erhalten: 22
What cells you have have and how many parallel?
x=e -> www.xbay.com/itm/29-4V-3A-Li-ion-Battery...p2060353.m2749.l2649

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Ladezeit der Seite: 0.385 Sekunden