Alex's ardumower - My DIY ardumower modification

So new boards are produced and on the place. Also basic connection is also done. Looks it works fine. Now I must check, if odometry is working and make correct configuration for all measurements. Keep you informed.

Mainboard :
[attachment=3546]WP_20170319_16_04_44_Rich.jpg

Charge board (now without INA):
[/attachment]
WP_20170319_16_05_00_Rich.jpg


Also sending my last version of ALEX BUMPER :

With description:
WP_20170319_20_53_04_Rich2.jpg

WP_20170319_20_53_04_Rich.jpg

Microswitch detail :
WP_20170319_20_53_24_Rich.jpg

Switched:
WP_20170319_20_53_44_Rich.jpg


For sure, all must work with ardumower-1.0a6-Azurit
 
So time is running and now all boards and wires are connected :

WP_20170422_16_23_40_Rich.jpg


WP_20170422_16_23_44_Rich.jpg


But now I'm working on problems which I found out :
1. Motor L/R current measurement isn't working - really at this moment I don't know why.... It's MC motor driver (I tested more pcs with the same problem)
2. Odometry is working only with one sensor - If I will use two wires option (I have a two sensors ), I have always a odometry left error
3. I must check a chargé board, because there is still a charge voltage (maybe a wrong diode polarity...)
4. Button ont he back side isn't working for mower control ( also button on the pcb isn't working. I must start auto mode via SW app)

5. What I really HATE, HATE, HATE is sonar. I'm not able get running all 3 sonars correctly. Values from sonars are still jumping. I tested a lot of sonars :

WP_20170422_16_24_20_Rich.jpg


but really no luck. It makes me a crazy .....

Alex
Attachment: https://forum.ardumower.de/data/media/kunena/attachments/1183/WP_20170422_16_23_40_Rich.jpg/
 
Zuletzt bearbeitet von einem Moderator:
So point 3 charge board is solved. There was a error in relay connection. Solved :

chargingboardPCB.jpg


But I have a big problem with motor current measurement:
I tested 3 motor drivers and always current value on the right motor is 0 when it's running. Also voltage on the analog pin is 0. When left motor is running, on the analog pin is aprox 0,05V. So I took complete NEW motor driver and the same problem. Right motor current is 0.
But when motor driver is disconnected and I will apply 5V on the analog pin, I can see a measured value 10000mA. So analog pin is working corretly. I also measured that there isn't any short circuit on the PCB and all is OK.
Any proposals what can be a reason ?

Alex

update :
also problem with two wire odometry is solved, button on/off solved and also sonars looks like working. There was main problem with interupt definition. I checked all interupt definitions and now it's ok. Only right motor sense is still a problem.
Attachment: https://forum.ardumower.de/data/media/kunena/attachments/1183/chargingboardPCB.jpg/
 
Zuletzt bearbeitet von einem Moderator:
I'm celebrating.
I tested all components (bumpers, sonars, motor odometry, motor current, mower rpm measurement, mower current, battery voltage, charge voltage and charge current and charge relay). All is working. I found additional two small problems on the charge board. I sending picture with explenation :

chargingboardPCB_2017-05-03.jpg


After this changes are implemented, charging is working correctly (tested on my desk with electronics from charging station).
Now I'm working on the new "light" version of the charging station.
Grass grows :) so I want start mowing asap.
ALEX
Attachment: https://forum.ardumower.de/data/media/kunena/attachments/1183/chargingboardPCB_2017-05-03.jpg/
 
Zuletzt bearbeitet von einem Moderator:
...... little inspiration for contacts for the charging station (now I complete )

[attachment=3698]WP_20170510_15_05_08_Rich.jpg[/attachment]

Alex
 
Last days I spent with perimetr wire, sender and receiver. Full story I will send later, but result is very good :
https://youtu.be/o_NojozsoE8
Last two points for full operation: Charging station implementation (already running) and perimeter wire tracking adjustment (PID)- mower is quite big oscilating around perimeter wire when track a wire.
 
Regarding perimeter sender receiver and wire :
I placed 100m black wire around my garden. I don't use a plastic clips, but I put a wire 1cm deep into the ground. I used the cutter to make the groove. Also right angles I do not recommend, always make an arc. Resistance of the wire is 2Ohm, so it was necessary buy a resistor to increase loop resistence. I used 10ohm 50W resistor so complete resistence is 12Ohm.

As sender I'm using sender from Ardumower-Shop and SW from 1.0a6-Azurit.

As receiver I'm using LM386 with coil 100 mH.

On the start of the implementation I had a problems with big interference from the motors, because my receiver was too close to the motors. So I did a tests and found, that very good solution is metal plate between motors and receiver :

First time I tried a shield around motor :

WP_20170514_20_33_16_Rich_2017-06-02.jpg


But the same good job will do a simple plate :

WP_20170514_21_03_09_Rich_2017-06-02.jpg


Without plate was interference smag value around 200, with the plate around 100.
I also did a tests with twisted wires and motor housing grounding, but no major positive influence on the interference.

Here is final look if the receiver :

WP_20170530_07_18_06_Rich_2017-06-02.jpg


WP_20170530_07_18_20_Rich_2017-06-02.jpg


WP_20170530_07_18_42_Rich_2017-06-02.jpg

Attachment: https://forum.ardumower.de/data/med...183/WP_20170514_20_33_16_Rich_2017-06-02.jpg/
 
Zuletzt bearbeitet von einem Moderator:
On the sender I set 12V, so current into loop was around 1A. But I had a problems, that + and - measured value was different and system was unstable.
So I started with measurements :

I measured signal generated by sender:
WP_20170529_10_21_21_Rich_2017-06-02.jpg


I measured signal on the coil without amplifier:
WP_20170530_09_35_36_Rich.jpg


And also signal with amplifier:
WP_20170530_10_24_48_Rich_2017-06-02.jpg


After long, deep and detail discussion in German section I did a decision, that maybe signal is too strong, because perfect signal look like this :
IMG_0308_2017-06-01.jpg


and maybe also distance from the motors is still to short.
So I decreased voltage to 8V, so current is arrond 0,67A and moved receiver more to front:
WP_20170601_18_30_51_Rich.jpg


After this changes perimeter detection is working very good.
Now remains only one problem, that mower is too big oscilating around wire when start perimeter tracking. I will post a video later, maybe somebody will help, but it looks like a problem with PID setup.

Hope my description will help to other users.

Alex
Attachment: https://forum.ardumower.de/data/med...183/WP_20170529_10_21_21_Rich_2017-06-02.jpg/
 
Zuletzt bearbeitet von einem Moderator:
HI Alex,

I posted a possible solution to the oscillation problem when tracking here

Concerning RTC, did you try to get a replacement LIR battery before your mod? I am running also a problem with my RTC. It was always working fine until 1 month before, nothing changed in software, suddenly I start to get errors from RTC.

Are you still running into troubles with sonar? Check this . Also I am using RCW-0006 modules, which seem to be more stable. Two were in use 1 year and together with one HC-SR04. I had to change HC-SR04 twice while the RCW-0006 still lasting.


Best Chris
 
Hi Chris,
Concerning sonar - now it's quite ok, but still not perfect. Reason is, that it's cheap sonar and was necessary change two of them, because stop working. I'm still thinking about sonar like this : http://howtomechatronics.com/projects/arduino-radar-project/ it's very simple with one sonar and one servo, I think must be a easy to implement it insead of three sonars.

Concerning RTC - LIR battery was first component for replacement. I don't trust this chinese batteries.

Rest of modification was according drawing on Wiki :
Ds1307_schematics.jpg


Concerning oscillation - I will write a post into theme from your link, with some videos that all is collected together for other users. Hope here I can write final solution for my mower :)

Alex
Attachment: https://forum.ardumower.de/data/media/kunena/attachments/1183/Ds1307_schematics.jpg/
 
Zuletzt bearbeitet von einem Moderator:
IMPORTANT THREAD FOR SMOOTH PERIMETER TRACKING :
http://www.ardumower.de/index.php/d...i-reduce-vibration-when-tracking?limitstart=0
For my mower this solution is working perfect :

in robot.h
in the section perimeter state


Code:
int leftSpeedperi;
    int rightSpeedperi;
    unsigned long lastTimeForgetWire;
    int MaxSpeedperiPwm;
    int perimeterMagMaxValue;


in mower.cpp


Code:
perimeterMagMaxValue = 2000; // Maximum value return when near the perimeter wire (use for tracking and slowing when near wire
    MaxSpeedperiPwm = 160; // speed max in PWM while perimeter tracking


And the function you need to replace with one tonne of comment


Code:
//PID controller: track perimeter
void Robot::motorControlPerimeter() {

//3 states
//wire is lost
//On the wire staright line pid fast action
//Back slowly to the wire pid soft action


//Control the perimeter motor only each 30ms
  if (millis() < nextTimeMotorPerimeterControl) return;
  nextTimeMotorPerimeterControl = millis() + 30; //possible 15ms with the DUE
  //tell to the pid where is the mower   (Pid.x)
  perimeterPID.x = 5 * (double(perimeterMag) / perimeterMagMaxValue);
  //tell to the Pid where to go (Pid.w)
  if (perimeterInside) {
  perimeterPID.w = -0.5;
  }
  else {
    perimeterPID.w = 0.5;
  }
  //parameter the PID 
  perimeterPID.y_min = -motorSpeedMaxPwm ;
  perimeterPID.y_max = motorSpeedMaxPwm ;
  perimeterPID.max_output = motorSpeedMaxPwm ;
//and compute
  perimeterPID.compute();


//First state wire is lost
//important to understand TrackingPerimeterTransitionTimeOut It's if during this maximum duration the robot does not make a transition in and  out then it is supposed to have lost the wire, the PID is stopped to go into blocking mode of one of the two wheels. 
// If the trackingPerimeterTransitionTimeOut is too large the robot goes too far out of the wire and goes round in a circle outside the wire without finding it



// If the second condition is true the robot has lost the wire since more trackingPerimeterTransitionTimeOut (2500ms) for example it is then necessary to stop one of the 2 wheels to make a half turn and find again the wire
  if ((millis() > stateStartTime + 10000) && (millis() > perimeterLastTransitionTime + trackingPerimeterTransitionTimeOut)) {
     
	//If this condition is true one of the 2 wheels makes backward the other continues with the result of the PID (not advised)
	if (trackingBlockInnerWheelWhilePerimeterStruggling == 0) { //
      if (perimeterInside) {
        rightSpeedperi = max(-MaxSpeedperiPwm, min(MaxSpeedperiPwm, MaxSpeedperiPwm / 2  + perimeterPID.y));
        leftSpeedperi = -MaxSpeedperiPwm / 2;
      }
      else {
        rightSpeedperi = -MaxSpeedperiPwm / 2;
        leftSpeedperi = max(-MaxSpeedperiPwm, min(MaxSpeedperiPwm, MaxSpeedperiPwm / 2 - perimeterPID.y));
      }
    }
	//If this condition is true one of the 2 wheels stop rotate the other continues with the result of the PID (advised)
    if (trackingBlockInnerWheelWhilePerimeterStruggling == 1) {
      if (perimeterInside) {
        rightSpeedperi = max(-MaxSpeedperiPwm, min(MaxSpeedperiPwm, MaxSpeedperiPwm / 2  + perimeterPID.y));
        leftSpeedperi = 0;
      }
      else {
        rightSpeedperi = 0;
        leftSpeedperi = max(-MaxSpeedperiPwm, min(MaxSpeedperiPwm, MaxSpeedperiPwm / 2 - perimeterPID.y));
      }
    }
	
	//send to motor
    setMotorPWM( leftSpeedperi, rightSpeedperi, false);
    // we record The time at which the last wire loss occurred
    lastTimeForgetWire = millis();
// if we have lost the wire from too long time (the robot is running in a circle outside the wire we stop everything)
    if (millis() > perimeterLastTransitionTime + trackingErrorTimeOut) {
      Console.println("Error: tracking error");
      addErrorCounter(ERR_TRACKING);
      //setNextState(STATE_ERROR,0);
      setNextState(STATE_PERI_FIND, 0);
    }
	// out of the fonction until the next loop  
    return;
  }

  

 // here we have just found again the wire we need a slow return to let the pid temp react by decreasing its action (perimeterPID.y / 2)
  if ((millis() - lastTimeForgetWire ) < trackingPerimeterTransitionTimeOut / 1.5 ) {
    rightSpeedperi = max(0, min(MaxSpeedperiPwm, MaxSpeedperiPwm / 2 +  perimeterPID.y / 2));
    leftSpeedperi = max(0, min(MaxSpeedperiPwm, MaxSpeedperiPwm / 2 -  perimeterPID.y / 2));
 }
  else
//we are in straight line the pid is total and not/2
  {
    rightSpeedperi = max(0, min(MaxSpeedperiPwm, MaxSpeedperiPwm/1.5   + perimeterPID.y));
    leftSpeedperi = max(0, min(MaxSpeedperiPwm, MaxSpeedperiPwm/1.5  - perimeterPID.y));
    
  }

  setMotorPWM( leftSpeedperi, rightSpeedperi, false);


  //if the mower move in perfect straight line the transition between in and out is longuer so you need to reset the perimeterLastTransitionTime
    
if (abs(perimeterMag ) < perimeterMagMaxValue/4) { 
    perimeterLastTransitionTime = millis(); //initialise perimeterLastTransitionTime in perfect sthraith line
  }

  
}


Last improvement with perimeterMagMaxValue measured during STATE_PERI_FIND isn't till now tested.

Alex
 
Today I did a sonar adjustments for faster slow down and reaction :

in robot.cpp and checkSonar(){ :
nextTimeCheckSonar = millis() + 50; //original 200
and
if (tempSonarDistCounter >= 3){ //original 5

and in mower.cpp:
NewPing NewSonarLeft(pinSonarLeftTrigger, pinSonarLeftEcho, 150);
NewPing NewSonarRight(pinSonarRightTrigger, pinSonarRightEcho, 150);
NewPing NewSonarCenter(pinSonarCenterTrigger, pinSonarCenterEcho, 150);

original was 500 - not needed to wait and check obstackles 5m away.

Now sonar works better as before.

Alex
 
Oben