Forum Replies Created
- AuthorPosts
- RC Tractor GuyKeymaster
Here is the receive code:
/* Crane Reciever Code */ // Variables used in the program int Motor_1_Speed = 127; int Motor_2_Speed = 127; int Motor_3_Speed = 127; int Magnet_State = 1; int LED_State = 0; int move1 = 0; uint8_t buf[8]; #include <SPI.h> #include "RF24.h" RF24 radio(9,10); // Controller Address const uint64_t Controller_1 = 0xE8E8F0F0E1LL; void setup() { pinMode(2, OUTPUT); // Motor 1 Direction 1 pinMode(3, OUTPUT); // Motor 1 PWM pinMode(4, OUTPUT); // Motor 1 Direction 2 pinMode(5, OUTPUT); // Motor 2 PWM pinMode(5, OUTPUT); // Motor 3 PWM pinMode(7, OUTPUT); // Motor 2 Direction 1 pinMode(8, OUTPUT); // Motor 2 Direction 2 pinMode(A0, OUTPUT); // Motor 3 Direction 1 pinMode(A1, OUTPUT); // Motor 3 Direction 2 pinMode(A2, OUTPUT); // Magnet Pin pinMode(A3, OUTPUT); // LED Pin radio.begin(); // Initialize the NRF24 Radio Module radio.openReadingPipe(1,Controller_1); // Set Address of Controller 1 radio.startListening(); // Start listening for commands from the controllers } void loop() { if (radio.available())radio.read(buf, 8);{ Motor_1_Speed = buf[0]; Motor_2_Speed = buf[1]; Motor_3_Speed = buf[2]; Magnet_State = buf[3]; LED_State = buf[4]; update_motor(Motor_1_Speed,3,2,4); update_motor(Motor_2_Speed,5,7,8); update_motor(Motor_3_Speed,6,A0,A1); //Turn on or off the magnet if(Magnet_State==1){ digitalWrite(A2,HIGH); } else{ digitalWrite(A2,LOW); } //Turn on or off the LEDs if(LED_State==1){ digitalWrite(A3,HIGH); } else{ digitalWrite(A3,LOW); } } } void update_motor(int drive_val, int motor_pwm, int motor_dir1, int motor_dir2){ if (drive_val < 120){ // These if functions leave a buffer zone of 15 bits above and below the drive center value move1 = map(drive_val, 120, 0, 0,255);//drive_min, drive_max); // scale the data value for use with the motor analogWrite(motor_pwm,move1); // Set the PWM vlue on pin 5 to move the motor digitalWrite(motor_dir1, HIGH); // Set the direction with pins 7 and 8 digitalWrite(motor_dir2, LOW); } else if (drive_val > 135){ move1 = map(drive_val, 135, 255, 0,255);//drive_min, drive_max); // scale the data value for use with the motor analogWrite(motor_pwm,move1); // Set the PWM vlue on pin 5 to move the motor digitalWrite(motor_dir2, HIGH); // Set the direction with pins 7 and 8 digitalWrite(motor_dir1, LOW); } else{ move1=0; analogWrite(motor_pwm,move1); // Set the PWM vlue on pin 5 to move the motor digitalWrite(motor_dir1, LOW); // Set the direction with pins 7 and 8 digitalWrite(motor_dir2, LOW); } }
RC Tractor GuyKeymasterThe first vehicle in the code is a Massey 8680 which is identified with the code:
command[0] = 0x4D; // M command[1] = 0x38; // 8 command[2] = 0x36; // 6 command[3] = 0x38; // 8
The code for the receiver of that tractor is found here and is described as the code for the Arduino in the cab of the RC Massey 8680. I needed extra pins for this model so a second Ardiuno in the body of the tractor controls the motors and other LEDs, this code is described as the code for Arduino in the body of the tractor.
RC Tractor GuyKeymasterHi, welcome to the forum. You’re the first person here building a crane as far as I know, hopefully we can help you get it working.
RC Tractor GuyKeymasterOops now that I look again I see the tractor balancing on the lens cap of a camera so it’s definitely pretty big, you’re probably right about it being 1:14 scale.
RC Tractor GuyKeymasterAh okay I should have asked. I don’t think you can do that without having full control over the entire system unfortunately. Anyway having two N20 drive motors should give you loads of pulling power so just hang a heavy weight from the front and the steering should hopefully be okay.
RC Tractor GuyKeymasterOh sorry I didn’t realise you were the same guy, I get lots of emails, youtube comments and forum post and I try to get through as many as I can in one go so I sometimes don’t realise I’m talking to the same person ๐
You would have great grip with the dual wheel alright, probably be good at ploughing in coffee grind and other jobs like that.
If you use dual wheels and you use two N20 motors then I highly recommend you control each motor individually. That way when cornering to the left you can slow the left motor down and thus corner better and when cornering right slow the right motor down. I originally had dual wheels on my 9560R with a single solid axle and it had a hard time cornering. Also I have two N20 motors in my Ford TW35 and slow them down as I mentioned above and it corners great, you can even brake steer.
RC Tractor GuyKeymasterThat is a really nice job, the SMD LEDs look great. I think I’ll do it that way too now, I was planning to just use 1.8mm through hole LEDs.
RC Tractor GuyKeymasterLooks great, all those wheels would be hard to turn but man are you going to have great grip.
January 3, 2016 at 6:58 pm in reply to: Question: Use a Siku Control 32 controller for a custom build? #1436RC Tractor GuyKeymasterIf you mean the IR controller the answer is possibly but if you mean the 2.4 GHz controller then I don’t think so. I plan to try to figure out what IR information is being sent by the siku controller so that I can include that in my own controller i.e. control my Siku Control 32 infrared tractor from my own controller so that I don’t need to use two controllers.
If you use a Siku controller you are limited to the buttons they chose, if you make your own you can have any buttons, joysticks, lcds or anything like. On the other hand the siku controller is in a nice case which feels comfortable in your hands which is tricky to get right with a custom build. You could remove the electronics from any RC controller and replace with your own but I doubt you want to do that to your control 32 controller.
I just finished designing my own controller and plan to run a kickstarter in a few months. My controller has a NRF24L01 socket, an XBee socket, IR leds, two xbox joysticks, two encoders, loads of push buttons and a 2.4 inch touch screen LCD. If you keep an eye on my channel you’ll see me assembling and testing the prototype in a few weeks. It’s something you might consider as an option but it would be months away before you got it as it would take time to run the kickstarter and then get everything sent out.
By the way I have been assuming you know about this very basic controller http://rctractorguy.com/controllers/basic-rc-controller. It’s very useful for testing if you don’t have a controller already but its limited controls can make it a bit awkward.
RC Tractor GuyKeymasterHi Ryan, welcome to the forum. The John Deere is a good starting model, plenty of space for everything. I know what you mean about the parts, here in Ireland you’d have it hard to find the parts and if you did they’d be ten times the price of ebay easily.
Yes best to post your questions it the most relevant sections, makes things easier for everyone to follow.
I’m sure we will learn a lot, sounds like you have some interesting ideas already.
RC Tractor GuyKeymasterNo when I first started this hobby I used XBee’s because they are great and easy to use. The problem is I was looking at how much it was going to cost me to put an XBee in every model so I switched to the NRF24L01 radio transceivers instead. So the John Deere 9560R now uses NRF24L01 radio modules which is why it’s not in the parts list. However some people prefer to use them still which is fine they are really good but I don’t have the code for them as I haven’t used them in a tractor in a long time sp if you wanted to use them you’d have to modify my code slightly.
RC Tractor GuyKeymasterCool, I have some ideas about how I’ll modify my Fendt 930 nothing too flashy just add some work lights and beacons because I was asked about adding beacons. Hopefully it wont be too complicated ๐
RC Tractor GuyKeymasterI don’t have any out of the models at the minute, I’ll try remember when I’m modifying the Fendt 930 to take a few measurements.
RC Tractor GuyKeymasterHi it’s not 100% working yet so I haven’t uploaded it but I save those things for the patrons as a thank you for their support.
December 14, 2015 at 2:15 pm in reply to: Arduino + NRF24L01 Radio Module RC Control Tutorial Code #1417RC Tractor GuyKeymasterHave you seen this video, you can see the set up there.
I use an Arduino pro mini to control the NRF24L01 radio module and I use pins 9 and 10 for the CE and CS. I just uses the RF24 library to control it and here is a video about using that.
- AuthorPosts