Go Down

Topic: on the fly control of Roboclaw written settings. (Read 243 times) previous topic - next topic

cambering

Sep 20, 2019, 07:48 am Last Edit: Sep 22, 2019, 01:28 am by cambering Reason: to clarify the question
  Hello,  I made an enquiry  to Core Electronics see below, and I was told that  there is an Arduino code already available to do what I want.  However I cant locate it.  If you can assist it would be much appreciated  Cheers   Phillip


Hello, I am using a Roboclaw 60 amp solo to steer a small vehicle. I use 2 potentiometers to create closed loop analog control of the wheels. The system works fine. However, the ideal settings for the controller vary with vehicle speed. Normally to test the vehicle I note the speed and then observe and then stop the vehicle and adjust the controller settings to suit that speed. etc etc.
In this way I have experimentally observed the settings required for various speeds.
Now to the question: The settings are written to the controller each time, but is it possible to alter the settings with a speed signal [ normally a pulse train driven off the transmission etc] so that the controller settings automatically adjust as vehicle speeds vary?
The settings that I would potentially need to adjust with vehicle speed is 1] the maximum amperage available to the steer motor and/or 2] the maximum acceleration available for the steer motor.
I assume that if this is possible it will involve code writing in a microprocessor connected to Roboclaw which I would then need to learn to do.
But before going further " Is it possible" to do this?
Thanks Phillip





Yes it is possible to adjust the speed on the fly. There is even an Arduino library available to do this. Read the docs for more information.

UKHeliBob

I am not familiar with the Roboclaw but this might help
Roboclaw library
Please do not send me PMs asking for help.  Post in the forum then everyone will benefit from seeing the questions and answers.

Slumpert


60amp motor to control steering is what I would expect in a full size car, is that what you mean by "small" vehicle?

Are you just running the controller in RC mode?
How are you "actually" adjusting the controller between tests?  Plugging in usb programmer and changing settings or adjusting the POTS?
What is controlling the forward speed of the small vehicle? 


cambering

  hello and thanks .  This is a steer by wire development  of a small 2 person vehicle.  Its true that  60amps is not required .  Generally 20 amps will steer the wheels at stopped.  This leads  further to the point of my question:    At stopped the vehicle needs say  20 amps to steer,  but at say 20mph the amperage required is much reduced.  IF the amps or the acceleration are constant over all of the vehicle speed range the steer can be undesirably twitchy.   I have evaluated what I need  to optimise steering response over the  vehicle range of speed.   and now I need to be able to adjust Roboclaw " on the fly" by using a speed sensor attached to the vehicle transmission.
  At the moment I am using analog closed loop control of the wheels.  The driver steers with a steering wheel attached to a potentiometer.  The steering actuator consists of an electric motor and gearbox fitted with a feedback potentiometer.  I have incorporated force feedback to the steering wheel to give  artificial feedback to the driver.

  Yes, to adjust at the moment and to gain insights  I stop the vehicle, plug into a computer,   make adjustments...  and then drive up to the speed I am testing and observe  etc.

  I am not adjusting the pots... or the closed loop system  I  adjust  1]  the maximum amperage  draw of the motor and 2]  the  maximum acceleration of the motor.

  I expect that if I can communicate with Arduino  I will need to alter my system from analog to packet serial.

  I have been told this is " easy" but I am not knowledgeable with code so I don't really know if it is.

  Thanks for your assistance    Phillip [ cambering]

cambering

  missed this question from Slumper  :"What is controlling the forward speed of the small vehicle?" 

  The vehicle is controlled  with a conventional pedal operated by the driver.

  On another point,  I did look into adjusting the pots " on the fly".  However I cant see any way to achieve what I want doing this.     The Roboclaw in analog uses control voltage  between 0v and 2v.     0v = full steer one way ,  1v = straight ahead steer,   2v=  full steer the other way.

   The vehicle needs full steer lock to lock at all speeds up to 20mph.  So, if the pots are manipulated then full steer wont be possible.  It would be possible to reduce the range of steer but I need to retain the range while altering the sensitivity of the steer.     Phillip

Robin2

#5
Sep 21, 2019, 08:43 am Last Edit: Sep 21, 2019, 08:46 am by Robin2
However, the ideal settings for the controller vary with vehicle speed.
This may be a very simple problem to solve, or very complicated.

You need to describe in great detail {A} how the feedback control within the system works and {B} exactly what happens at different speeds with the same settings (so we can properly understand the problem).

I remain to be convinced that the solution has anything to do with the current draw of the motor - I suspect that is just a kludge.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

cambering

 hi,   I have described the feedback control.
  I use a Roboclaw motor controller in analog closed loop mode.  [  no Arduino required]  This simply means that there is a control potentiometer on the drivers input [ steering wheel/ joystick  whatever] and a feedback potentiometer on the steer actuator. 

  To tune the steer characteristics to optimise driver experience over a speed range I have experimentally established that at different vehicle speeds  the " written settings"  in Roboclaw need to be altered as speeds alter.  This is not really " unexpected"

  The only real question is,:  "can the settings [ written to Roboclaw] be altered " on the fly" with a speed signal  by connecting Roboclaw to Arduino?" so that the settings  alter as speeds alter?

  However, I do appreciate your point that there may be other ways to do this other than with Arduino.

  I  also agree that my earlier statements including varying amperage may be a confusion.

  The main focus is "  deadband"  / "motor speed"  / "motor acceleration"  and these settings can be written to Roboclaw   But,  can the settings be altered " on the fly via Arduino?


  That's the nub of the enquiry.  Because I have no experience with  an Arduino connected to a Roboclaw,  I need to establish this as a possibility or not.

  The control system at the moment does NOT use Arduino.  However I could use Arduino with the Roboclaw if it would do what I hope.

  So, my question is fundamentally quite straight forward.


  Cheers and thanks   P.




cambering

 PS  I should change the thread to "  on the fly control of Roboclaw  SETTINGS  "

  cheers  P

Robin2

#8
Sep 21, 2019, 11:32 am Last Edit: Sep 21, 2019, 11:36 am by Robin2
If you edit your Original Post you can modify the Title.


I see some stuff on Page 53 of the user manual about "Analog Mode with feedback for velocity or position control" but there seems very little information. Probably I am not looking at the right page, maybe you can point me to the correct one.


I guess my comments in Reply #5 are based on a sense that if you have to modify the values on the fly then this is not the correct controller for the job.

Or (another thought) use that controller to operate the motor but with a completely separate feedback system - perhaps using an Arduino. However I am always nervous of DIY solutions where there is a risk of personal injury.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

UKHeliBob

Quote
The main focus is "  deadband"  / "motor speed"  / "motor acceleration"  and these settings can be written to Roboclaw   But,  can the settings be altered " on the fly via Arduino?
Have a look at the library that I linked to earlier

It has, for instance, a SetDeadBand() function, so I suspect that there may also be other options that you can set and there is a setConfig() function that, from its name, sounds like it could be useful, but I have not looked any further than the library .h file to see the names of the functions
Please do not send me PMs asking for help.  Post in the forum then everyone will benefit from seeing the questions and answers.

cambering

  Robin...  yes you are on the right page of the manual.  However the manual is difficult [ for me]. 

The Roboclaw range of controllers are constantly being upgraded and the manual is cut and paste from various earlier manuals.  For example, there is no specific manual for the Roboclaw Solo which is  for controlling a single DC motor.  The main focus seems to be differential steering robots  [ tank skid steer]

  Yes,  it might be that the Roboclaw is not suitable to do on the fly adjustments to " settings"

  To compound my problem I have a poor understanding of Arduino.

  However there is always a way.  For example I could place a variable spring/ damper between the driver  control element and the control pot.  In this way there would be a delay as the driver turned the steering wheel.  The " spring / damper"   value could then be adjusted on the fly with a vehicle speed signal

  However this type of complication should not be necessary and I am confident that a different controller can be found to do all of this without reverting to mechanical systems.

  Heli bob...  yes I have looked at the library you linked to.  Trouble is I don't really know enough to understand what I am looking at.

  Thanks to everyone for suggestions.  I will keep an eye on this thread and I will update with any solutions I find.    Thanks   P.

Robin2

To compound my problem I have a poor understanding of Arduino.
You never answered part {B} of my Reply #5 and without that I have no idea what problem you are trying to solve.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

cambering

  hello robin  your question {B} exactly what happens at different speeds with the same settings (so we can properly understand the problem).....

  .... is a vehicle steering dynamics question not relevant  to the thread topic or to this forum.... but,

   its common for  steering systems to be adjusted for vehicle speed.  For example all electric power steer is adjusted by a speed signal input to the ECU/ controller.  Hydraulic systems also adjust pressure  etc.    SBW is no different

  I did not want  the question to be confused that's all. { otherwise we will be here forever!}

  Cheers   P



Robin2

.... is a vehicle steering dynamics question not relevant  to the thread topic or to this forum.... but,
Obviously you are free to disagree with me but to my mind the actual behaviour and the desired behaviour are central to this Thread.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

cambering

    yes, the actual behaviour and the desired behaviour  has been isolated [ as I reported] to be determined by 1[  the motor max acceleration and  2] the motor max speed. and these settings have been adjusted and tested for various vehicle speeds to optimise the steering characteristics of the vehicle  Both of these behaviour characteristics are written to the controller.  That's why I need to be able to adjust the written settings  in the controller on the fly to achieve the desired vehicle behaviour  P

 Topic: on the fly control of Roboclaw  written settings. (Read 171 times)

Go Up