Maker Pro
Maker Pro

Digital Pot setup

Justin, does the manufacturer of the motor controller spec the input impedance / Resistance of the 0-5V speed control input? This figure is rather important for the DAC output to work properly. If it's too low I'll have to add a buffer to the circuit.

Hi Chris

This is the reply I have had from Anaheimautomation

"We have a input buffer at the vcontrol pin with an input impedence of 1Mohm."

I will crack on with ordering the parts and let you know when they arrive, you can then tell me what to do, LOL!

Regards

Justin
 

CDRIVE

Hauling 10' pipe on a Trek Shift3
Justin, I received your PM and I know you're in a hurry but we have to nail down a few things. This thread is so long that much of what may have been covered I've now forgotten and I don't feel like sifting though all the posts. So, here's some questions.

I think you said that the motor and controller are powered by a 12V battery. Is this correct? Is there a 5V source in your system? If not I'll have to add a 7805 (5V) voltage regulator to the schematic. Picaxe sells them too.
 
Hi Chris

These are the details of the power source:

Max. Continous Discharge Current 8A
Max. Peak Current20A for 10mS
Nominal Voltage 12V
Discharge Cut-Off Voltage 9V
Charging Voltage 12.6V
Temperature Range (charging )0°C to 45°C
Temperature Range (discharging) -20°C to 60°C
Capacity 8Ah +/-5%

I was then going to attach the following :

http://www.virtualvillage.co.uk/12v-to-24v-dc-dc-power-converter-module-003602-013.html

to step up the power for the motor.

The reason I am using this battery is its a company I deal with and their products are really smart. They come packaged with a belt and will suit the final application. Unfortunately they do not produce a 24V version. So this will initially be trial and error. As I said in the original post, the original brush less motors were not powerful enough and I am awaiting a new motor from Russia.

Deatils:

Output power,W 52
Rated speed, rpm 4000
Speed range, rpm 400 – 4000
Rated torque, kgf*cm 1.25 (0.12 N*m)
Maximum torque, kgf*cm 3.8 (0.37 N*m)
Voltage, VDC 24
Maximum current, Amp 10.6
Torque constant, N*m/A 0.0355
Line-to-line resistance, Ohm 0.8
Line-to-line inductance, mH 1.2 0.5
Rotor inertia, g*cm2 48

If you think this is not the best way, as always I am open to suggestions.:rolleyes:

Regards

Justin
 

CDRIVE

Hauling 10' pipe on a Trek Shift3
I thought that this may be the case and I have already received 10 units of LM7805CT `s

Are these suitable?

Justin

They'll work fine but a 78L05 would have worked too, while taking up about 1/4 of the real estate. Not a problem though because (currently) your project board has plenty of room. I'll stress "currently" because we're prototyping here. Live tests often produce contrary results to an untested schematic or even Spice simulations. You should be prepared for this.

"Electronics is an exact sinus!" Quote: Jeff Blum (The Answer Grape) 1976.

Chris
 

CDRIVE

Hauling 10' pipe on a Trek Shift3
Justin here's my latest version of the DAC controller. After reading the Picaxe pdf regarding the DAC output it states that the 5v Vdd can't be achieved. The best documented results has been 4.78V. I doubt that a 220mV drop is going to be an issue but if it is there are ways of overcoming it, albeit with additional circuitry.

Chris
 

Attachments

  • AxeStaircase08M2.JPG
    AxeStaircase08M2.JPG
    68.5 KB · Views: 100
Justin here's my latest version of the DAC controller. After reading the Picaxe pdf regarding the DAC output it states that the 5v Vdd can't be achieved. The best documented results has been 4.78V. I doubt that a 220mV drop is going to be an issue but if it is there are ways of overcoming it, albeit with additional circuitry.

Chris
The easiest way would be to up the Vdd to 5.5V which is legal for a PIC12F1840.

Bob
 

CDRIVE

Hauling 10' pipe on a Trek Shift3
The easiest way would be to up the Vdd to 5.5V which is legal for a PIC12F1840.

Bob

Thanks Bob, that's one of the options I was thinking about. I've been reading the M2 parts pdf. As I recall, the min Vdd has been lowered since the M parts. I'll check to see if Max Vdd has been increased too. If I can get away with it I'll just stick a diode in the GND leg of the 7805. ;)

Chris
 
Hi Chris

Thanks for your work, shall I now go ahead with an order from Picaxe.

If so I need to clarify some points, these are quite novice!

1) R3 330 is that 330ohm
2) LED1 is this a specific type, ie which one?

These are probably simple questions, I'm sure but I would just like to make sure rather than order the parts and then wonder why the LED is always on!!

Justin
 

CDRIVE

Hauling 10' pipe on a Trek Shift3
Hi Chris

Thanks for your work, shall I now go ahead with an order from Picaxe.

If so I need to clarify some points, these are quite novice!

1) R3 330 is that 330ohm
2) LED1 is this a specific type, ie which one?

These are probably simple questions, I'm sure but I would just like to make sure rather than order the parts and then wonder why the LED is always on!!

Justin

R3=330 Ohms
LED1 is a common low power red LED.

When you get the supplies let us know. Don't solder anything. The protoboard, that you'll be prototyping on, is a solderless system. If the protoboard kit isn't supplied with jumpers you'll want to find some CAT3, CAT5 or CAT6 cable. The wire AWG is about perfect for protoboard jumpers.

Do not attempt to plug the 7805 directly into the protoboard!!! It's pins are too large and can damage the board. In your initial tests you won't be using it anyway because the protoboard has an on board 7805. I doubt this, but If you don't own an 8V to 12VDC wallwart you should buy one. The power connector on the protoboard is a common coaxial type. If Picaxe sells a compatible wallwart with plug you should probably get it too. You definitely don't want to be using your high current battery for your early prototyping. Not unless you like the effects of exploding chips! :D
 

CDRIVE

Hauling 10' pipe on a Trek Shift3
Your design is way too compilicated. I can eliminate 2 of the 7 parts. The pullups are not needed as their are internal pullups you can enable :)

<snip>

Bob

Bob, I just wanted to let you know that I found confirmation on your statement. The new M2 parts support a "pullup" command. It's in the picaxe_manual2.pdf, titled 'Basic Commands' on the Help menu. It's found on page 159. Unfortunately, there are only two pins on the 08M2 that support it and Justin is going to be using one of them for the DAC output. So, in this case, the two 10K pullups have to stay. ;)

Chris
 
Last edited:

CDRIVE

Hauling 10' pipe on a Trek Shift3
That's good. Have you been playing with the sample code in the pdf''s? Copy some of the simple progams and past them into the interpreter and hit simulate. It'll give you a feel for it.

Chris
 
Hi Chris

The order has turned up today!! I have had a look at it tonight. I have also tried a few simple simulations eg LED on, off etc

Although there are over 400 hundred pages to read!! It might take some time to get through this. I have been looking through the PDF`s to try and understand how I might be able to create this program but so far, I think I am a million miles away from the end result!

Looking forward to your help.

Justin
 

CDRIVE

Hauling 10' pipe on a Trek Shift3
I promised the wife a bike ride to our local wildlife preserve. Talk to you when I get back.

Chris

PS. Your program is already written. :D
 

CDRIVE

Hauling 10' pipe on a Trek Shift3
Justin I'm really tired but I wanted to post this before hitting the sack. I'll explain why I changed the PBS logic in the morning. Copy & Paste this code into your editor. It will format correctly when pasted. Don't attempt to create straight left hand alignment.

Chris

Code:
' Title: DAC Control
' Developer: CDRIVE (CJS) 26 May 2012
' Chip Set: Picaxe 08M2
' Description: Produces an Up/Down staircase voltage (DAC) determined 
'              by the Input states of Pin4 (DAC Up) and Pin3 (DAC Down).
' Relationships: https://www.electronicspoint.com/digital-pot-setup-t248126p7.html#post1467672
' Related Files: AxeDacPinHi08M2.TSC (Tina Schematic File)
' ********************************************************************************

Init:
DacSetup %10100000       ' Reference DAC to Vdd

Main: 

	If Pin4=1 Then
	  Pause 20             ' 20mS debounce period
		If Pin4=1 Then       
	  	If B1<25 And B2=0 Then 
			  B1=B1+5
			  DacLevel B1      ' Set DAC output voltage
			  B2=1
			  Pause 500      ' Pause before testing state of Up Button (B2) again
			EndIf
		    If B1=25 And B2=0 Then
				  B1=B1+6
				  DacLevel B1    ' Set DAC output voltage
				  B2=1
				  Pause 500    ' Pause before testing state of Up Button (B2) again
			  EndIf
			If B1=31 Then
				Low 1            ' Switch LED On when DAC=Max
			EndIf
		EndIf
	EndIf
		
		
	If Pin4=0 Then				' Test Up Button to see if user released it 	
		B2=0            ' If Up Button was released then reset B2 to 0	                      
	EndIf
	

	If Pin3=1 Then
		Pause 20             ' 20mS debounce period
		If Pin3=1 Then 
			If B1=31 And B3=0 Then
				B1=B1-6
				DacLevel B1      ' Set DAC output voltage 
				B3=1
				High 1           ' Switch LED Off if DAC is <Max
				Pause 500    ' Pause before testing state of Down Button (B3) again
			EndIf
			 
			If B1<=25 And B1>0 And B3=0 Then
				B1=B1-5
				DacLevel B1      ' Set DAC output voltage
				B3=1
				Pause 500	   ' Pause before testing state of Down Button (B3) again
			EndIf
		EndIf
	EndIf
	
	If Pin3=0 Then				' Test Down Button to see if user released it 	
		B3=0   					' If Down Button was released then reset B3 to 0	              
	EndIf

	
GoTo Main
 

Attachments

  • AxeDacPinHi08M2.JPG
    AxeDacPinHi08M2.JPG
    68.3 KB · Views: 87
Hi Chris

Sorry for the delay, I too had to entertain the other half last night as it was our anniversary, so a trip to a local restaurant for some French cuisine and then off to the comedy club was the order of events.

I have taken a look at your code and I have to say it takes me back to my youth and many years of BASIC programming, except for some unique commands like Dacsetup it is virtually the same. I love it! I only wish my electronic skills were greater so that I could make the most of this new found marvel that is chip programming.

Now the code is in front of me it looks simple, but I think I would have been weeks before I would have got anywhere near an end result!!

I'm off to work now, but as soon as I get home I'm going to crack on with using the axe091,,,to put this to the test..

Are there any pitfalls I should avoid.

Regards

Justin
 
Top