![]() |
PBASIC problem
I started programming today. Two motors work on pin 1 and 2 off of port 1 and 2 joysticks on the y-axis. So, each joystick is running one motor on its y-axis.
What I want to do is have a drive train with 4 motors. How can I made 4 motors run on only y-axis of two joysticks, i.e. two motors on y-axis of each joystick Thanx Punar :confused: |
Basically, just set a speed controller on each motor, and send the same value to both of the left motors, and the same signal to both of the right motors
|
All ya gots to do is...
Download the default program from the Innovation First site and edit it to output p1_y and p2_y to two more PWMs. So if you hook up your other two motors to PWM3 and PWM4, your serout command would be:
PHP Code:
|
Re: PBASIC problem
Quote:
|
um. y-splitter. Hook up the left motors to independent victors, then attach the victors to a y-splitter and then put the other end to pwm1. do the same on the right with pwm2. its the simplest method.
|
Quote:
|
Y's are okay I think...
I am pretty sure that a Y on a PWM cable is just fine.
Joe J. |
There are definantly several different ways to solve this problem.
Mechanically: You could run a chain from one motor to drive two wheels on one side. Electronically: You could use the Y splitters from one PWM output to go to two different speed controllers (each controlling a different motor) Softwar(ly?): The "Serout" command at the end of the default code is what sends out the signals to all the electronics. You could simply connect each motor's speed controller to its own PWM output. (Let's suppose the motors on PWM 1 and PWM 2 are the two motors you want to run simultaneously from one joystick [plugged into port1], and PWM 3 & 4 from the other joystick [plugged into port 2]) You could change the output line from: Serout USERCPU, OUTBAUD, [255,255,p1_y,relayA,p2_y,relayB,p3_y,p4_y,... (etc) to: Serout USERCPU, OUTBAUD, [255,255,p1_y,relayA,p1_y,relayB,p2_y,p2_y,...(etc) Or you could leave the output line alone and simply add, right before the Serout command: p4_y = p2_y 'This makes PWM 4's output be controlled by Port 2's joystick (y-axis) p3_y = p2_y 'This makes PWM 3's output be controlled by Port 2's joystick p2_y = p1_y 'This makes PWM 2's output be controlled by Port 1's joystick ' Default program's comment code.... ' blah blah blah Serout USERCPU, OUTBAUD, [255,255,p1_y,relayA,p2_y,relayB,p3_y,p4_y,...(etc) Whatever method is best for you, go for it :) |
| All times are GMT -5. The time now is 01:17. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi