Show Posts
Pages: 1 ... 244 245 [246] 247 248 ... 844
3676  Using Arduino / Programming Questions / Re: Turning stepper one revolution on: November 08, 2013, 09:51:55 am
If I use Stepper motor1(200, 9, 10)  to specify 200 steps per revolution and then use motor1.step(200) it doesn't make one full rotation.  It only moves a little bit.

Does it move a consistent amount each time, and does that change when you load the output shaft forwards or backwards while it's moving? I'm wondering whether the motor may be slipping, perhaps because it's underpowered for the load.
3677  Using Arduino / Project Guidance / Re: rc car, arduino, and tb6612fng.. having trouble. on: November 08, 2013, 09:47:14 am
Looks to me as if it should work too. To understand what is happening it would be necessary to see the serial output and know what the 'bot actual did while that output was being produced. If you think that it is not executing the actions you think it should have done, then put print statements in each clause of the if statement to see which is being executed. Maybe it's trying to do the right thing and your motor/driver/power supply is simply not working correctly.
3678  Using Arduino / Project Guidance / Re: Seeking interrupt opinions / advise on: November 08, 2013, 09:42:36 am
as far as I am concerned a real time system / controller should always use interrupt.

As far as I'm concerned, regardless of the environment you're working in, interrupts should only be used where they are the most appropriate solution. In the context of an Arduino, using interrupts introduces considerable complexity and should be avoided as far as possible. The only sensible reason I can think of for using interrupts in this context is when there are latency requirements which can't be met any other way. Using interrupts to detect or generate a high frequency or short duration signal may be appropriate. Using interrupts to detect slow and non-time-critical inputs such as the position of manually operated switches is silly.
3679  Using Arduino / Project Guidance / Re: Race Dash on: November 08, 2013, 09:34:43 am
I see two problems. On the input side you need to deal with a variety of signals which we don't know about but will probably include noise and voltage transients outside the range that the Arduino will handle. You may need to design buffer circuits to protect the Arduino from these.

On the output side the Arduino is often used to drive small displays but I guess that for a dashboard you will be looking for a much larger display. Figuring out how to drive that directly from an Arduino might take significant research. If it involves the Arduino writing directly to the frame buffer then it might also require a considerable amount of software and data on the Arduino. Conceivably, you could find that the Arduino doesn't have enough storage for that. It would be a lot easier to just use a tablet for your display, in which case the problem is just how to implement the tablet part of the solution and establish a data connection to the Arduino.
3680  Using Arduino / Programming Questions / Re: output format question - XML? on: November 07, 2013, 08:44:30 pm
This part doesn't look quite right:

Quote
<id>ChannelNumberChannel 6 </id>

Wouldn't something like this be better?

Quote
<id>Channel 6</id>

3681  Using Arduino / Project Guidance / Re: Want to Build a Machine to Breed Shiny Pokemon on: November 07, 2013, 08:40:19 pm
An ordinary servo would do the job.
3682  Using Arduino / Project Guidance / Re: Arduino and CanOpen on: November 07, 2013, 06:13:55 pm
CAN encompasses lots and lots of standards, and just because it's CAN doesn't mean it will work with any other CAN implementation. You need to know what standards are being used starting from the physical layer and working up. Then you need to find a protocol implementation that supports what you need.
3683  Using Arduino / Programming Questions / Re: Problems with my temp (DS18B20) + Analog Read (potentiometer) and LCD project on: November 07, 2013, 12:28:23 pm
I'm sure PaulS has nailed it.

You could use PROGMEM to avoid those large lookup tables taking up RAM, or try to replace them with a formula to calculate the resulting values. Excel is a good way to fit curves to data sets.
3684  Using Arduino / Project Guidance / Re: Speed Measurement with Encoder on: November 07, 2013, 09:17:18 am
Speed is change in position over a time interval. If you measure the position at two known times it is trivial to calculate the speed. Displaying a speed is just like displaying any other number.
3685  Using Arduino / Project Guidance / Re: Buying really small GPS and GSM components on: November 07, 2013, 09:14:36 am
I suspect it will depend how many million you want to buy. Being an obscure part there would be little incentive for retailers to stock it so you'd be looking for somebody reselling them commercially, and that implies  large volumes.

I guess price is why you don't want to buy the pigeon tracker but if that's your only incentive you need to think how much time and effort you're willing to trade off making your own equivalent.
3686  Using Arduino / Project Guidance / Re: Arduino and CanOpen on: November 07, 2013, 09:04:54 am
There is at least one open source CAN protocol implementation and probably more. CAN can be used over different types of physical network and the CAN open source project I looked at only supported one specific network. I suggest you do some googling, see what implementations you can find and whether any of them support the type of physical network that you're using.
3687  Using Arduino / Project Guidance / Re: Choice of steppermotor for automated blind on: November 07, 2013, 09:02:12 am
The servo you have was originally designed to receive a control pulse in the 1500-2500 uSec range, convert that to a rotational position and then move to that position. So a 1500uSec pulse meant move to one end of its travel (aka 0 degrees position), a 2500 uSec pulse meant move to the other end (aka 180 degrees), and so on for the intermediate values. The servo has some electronics inside that measure the current position with a potentiometer and power the motor to move it towards the target position implied by the control signal. In practice different servos support different ranges of motion and the end limits don't always correspond to exactly 1500 and 2500 uSec pulses, but you get the idea - the pulse length corresponds to a target position. The Arduino Servo library lets you specify the servo control signal either in terms of the pulse length (1500 .. 2500), or as a nominal angular position (0 .. 180).

You say that your servo has been converted for continuous rotation. This is done by disconnecting the potentiometer so that the servo control logic thinks the servo isn't moving. Usually, the potentiometer is left positioned somewhere near the middle of its travel so the controller thinks the servo is somewhere near the middle of its range of movement i.e. somewhere near the 90 degree position.

If the servo control signal you send corresponds to the position the controller thinks the servo is at, it will leave the motor off. If the control signal represents a different position, the controller will try to move the motor towards the target position. Most servos implement a proportional control algorithm which means the further the servo needs to move, the more power is applied to make it move. Usually the gain is quite high so that if the controller is trying to move the servo more than a few degrees it will probably be up to full power, but for smaller angles it will try to move the motor but may not apply full power. Hence the nominal position you pass to the Servo library can be used as a sort of speed control. There will be some pulse length, probably around 2000 uSec (aka 90 degrees if you specify it as an angle), that stops the motor. Moving the position to either side makes the motor move in either direction, and the further you move it the faster the servo will go.
3688  Using Arduino / Project Guidance / Re: Running stepper and at the same time make pulses at a pin on: November 07, 2013, 08:34:49 am
I agree that interrupts should be avoided as far as possible and are not called for here.

There is another thread running at the moment with very similar requirements - are you working on the same project? I suggest you follow the same approach recommended there, running the stepper motor asynchronously and using a finite state machine to control what it does. This leaves your sketch free to monitor limit switches, make pins pulse and so on if it needs to as well.
3689  Using Arduino / Project Guidance / Re: I want my stepper motor to switch speed while traveling on: November 07, 2013, 08:30:34 am
The expression in the switch statement needs to be a variable, not a type.

I suggest you change enum state to enum States, and declare a global variable int state = PARKING;
3690  Using Arduino / Programming Questions / Re: SoftwareSerial: Bytes not sent in a round trip between two Arduino's on: November 06, 2013, 08:53:55 pm
As far as I understand it, SoftwareSerial disables interrupts during transmission which is why it can't send and receive at the same time. This is why you can't look it back to itself. It also means that input via the hardware Serial interface is going to be disabled (briefly) each time SoftwareSerial transmits a byte and might explain why you seem to be losing characters occasionally.

I think you might have more success if the sketch reading from the hardware Serial port waited until it had received a complete line before it sent it over the SoftwareSerial port, and the 'right hand' sketch waited until it had received the complete line before it echoed it back.
Pages: 1 ... 244 245 [246] 247 248 ... 844