7 replies
Jan '11

korel

Great! I like it. I have 3

Great! I like it.  I have 3 RC trucks and car with motors and steering and I was wondering what to do with them. You didn’t have problems fitting the servo for steering?  Keep up the nice work :slight_smile:

1 reply
Jan '11

mlandergan

great work!

great work!

Jan '11 ▶ korel

blc

The steering servo was

The steering servo was already part of the Grasshopper kit I bought; the servo horn and linkages it uses are designed to fit this car and align the wheels perfectly straight (with the option to adjust each linkage).  Originally the steering servo and the motor’s ESC were controlled by an E sky EK2-0422 4-channel receiver.

Once I took out the RC receiver/control unit, it was just a matter of finding the right PWM values for the Arduino to use as “left” and “right” (and of course, learning how to code the servo control in the process ;)).  I don’t need to use the full range of servo motion: after a certain point in either direction, the steering reaches full lock and the wheels no longer turn - any more than this actually makes the chassis creak a little.

In hindsight, a simpler RC car would have been easier to start learning with.  Although I think this will be better in the long run: I have more flexibility, a bigger platform and the motor is quite a powerful little beast.

2 replies
Jan '11 ▶ blc

korel

Hey thanks for the

Hey thanks for the explanations. My chassis are cheaper because they have a DC motor (bang bang) for steering and not as easy to control I guess.  Waiting for your next video to see how it’s gona work with “eyes”.

1 reply
Jan '11 ▶ korel

blc

No problem :slight_smile:
No problem :slight_smile:

Jan '11 ▶ blc

arbarnhart

Nice job! I have a similar

Nice job! I have a similar chassis, ESC and servo. I have been down the route of the “simpler” RC and to be honest I don’t think they are simpler at all. You have to make or wire to an H bridge, which has PWM and a couple of digital lines for each motor instead of just PWM. I think I have a similar ESC to yours. I need to implement braking on mine. Does your ESC have an idling adjustment screw or is the center preset to some value?

 

1 reply
Jan '11 ▶ arbarnhart

blc

My ESC (the Tamiya

My ESC (the Tamiya TEU-101BK) has a button you use to set the values for: neutral, full acceleration and full reverse.  I have the ESC set up as a servo in my code - the ESC responds to this with no problems.  To calibrate the values to use in my code, I programmed a simple script for the Arduino to cycle the ESC signal from 90, up to 180, down to zero, then repeat (not sure about other microcontrollers, but Arduino goes from 0 to 180 for servo control).  Each time it changes speed, I press the button to set the value.  I actually only use 105 and 75 as my forward and reverse values - anything higher/lower is far too fast without “real” sensors.  

I set up the “brake” command as a separate subprocedure to be triggered by an interrupt:

 

void Brakes() {

  throttle.write(0);

  Serial.println(“Brakes on!!”);

  Serial.println(’\n’);

}

All it does is just set the throttle to full reverse - before this is called, the car will be moving forward so it applies the brakes.  After this is called, there’s a 200ms delay before the “Stop” procedure is called; this procedure just sets the output to 90 - neutral.  Then there’s another 200ms delay before it reverses away.  I found that the delays had to be present, otherwise it simply refused to go into reverse - these were the lowest values I found that work.  This is probably because the ESC is not expecting the millisecond precision that a microcontroller can offer, and is expecting a (comparatively) slower meatsack to be at the controls ;).

 

The link to the full Arduino code is in the original post - of course it will only help if you are using Arduino or can read Arduino code ;).